mercredi 3 juin 2015

EC2 Instance without any attached Volume?

Is it Possible to have instances without any volume(root-device or attached volume)?
Lets say the instance_ids are [i-120cd3fe,i-23e46634]
Is it possible that any Instances are present without any attached volume in AWS?

    conn=get_ec2_connection(region=region)  
    instances = conn.get_only_instances(instance_ids=instance_ids)   
    volumes_list=[]
    for instance in instances:  
       dev_mappings = instance.block_device_mapping  
       for block_device in dev_mappings.keys():  
           volume_id = dev_mappings[block_device].volume_id
           volumes_list.append(volume_id)

    print volumes_list  

Output-Should be : [None]




Aucun commentaire:

Enregistrer un commentaire