This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.api.ec2.ec2utils Module

nova.api.ec2.ec2utils.camelcase_to_underscore(str)
nova.api.ec2.ec2utils.dict_from_dotted_str(items)

parse multi dot-separated argument into dict. EBS boot uses multi dot-separeted arguments like BlockDeviceMapping.1.DeviceName=snap-id Convert the above into {‘block_device_mapping’: {‘1’: {‘device_name’: snap-id}}}

nova.api.ec2.ec2utils.ec2_id_to_id(ec2_id)

Convert an ec2 ID (i-[base 16 number]) to an instance id (int)

nova.api.ec2.ec2utils.id_to_ec2_id(instance_id, template='i-%08x')

Convert an instance ID (int) to an ec2 ID (i-[base 16 number])

nova.api.ec2.ec2utils.id_to_ec2_snap_id(instance_id)

Convert an snapshot ID (int) to an ec2 snapshot ID (snap-[base 16 number])

nova.api.ec2.ec2utils.id_to_ec2_vol_id(instance_id)

Convert an volume ID (int) to an ec2 volume ID (vol-[base 16 number])