Launch an instance from a volume After you create a bootable volume, you launch an instance from the volume. To launch and instance from a volume To create a bootable volume from an image, run the following command: # cinder create --image-id 397e713c-b95b-4186-ad46-6126863ea0a9 \ --display-name my-bootable-vol 8 You can also use the nova command to complete the same action: # nova volume-create \ --image-id 397e713c-b95b-4186-ad46-6126863ea0a9 \ --display-name my-bootable-vol 8 Optionally, to configure your volume, see the Configuring Image Service and Storage for Compute chapter in the OpenStack Configuration Reference. To list volumes, run the following command: $ nova volume-list +--------------------------------------+-----------+-----------------+------+-------------+-------------+ | ID | Status | Display Name | Size | Volume Type | Attached to | +--------------------------------------+-----------+-----------------+------+-------------+-------------+ | bd7cf584-45de-44e3-bf7f-f7b50bf235e3 | available | my-bootable-vol | 8 | None | | +--------------------------------------+-----------+-----------------+------+-------------+-------------+ Copy the value in the ID field for your volume. To launch an instance, run the nova command with the --block_device_mapping parameter, as follows: $ nova boot --flavor FLAVOR --block_device_mapping \ DEVNAME=ID:TYPE:SIZE:DELETE_ON_TERMINATE NAME The command arguments are: --flavor FLAVOR The flavor ID. --block_device_mapping DEVNAME=ID:type:size:delete-on-terminate DEVNAME. A device name where the volume is attached in the system at /dev/dev_name. This value is typically vda. ID. The ID of the volume to boot from, as shown in the output of nova volume-list. type. Either snap or any other value, including a blank string. snap means that the volume was created from a snapshot. size. The size of the volume, in GBs. It is safe to leave this blank and have the Compute service infer the size. delete-on-terminate. Boolean. Indicates whether the volume is deleted when the instance is deleted. You can specify: True or 1 False or 0 NAME The name for the server. You must specify an image when booting from a volume, even though the specified image is not used. Otherwise, the Attempt to boot from volume - no image supplied error is returned. You can also attach a swap disk on boot with the --swap flag, or you can attach an ephemeral disk on boot with the --ephemeral flag. For example, you might enter the following command to boot from a volume with ID bd7cf584-45de-44e3-bf7f-f7b50bf235e. The volume is not deleted when the instance is terminated: $ nova boot --flavor 2 --image 397e713c-b95b-4186-ad46-6126863ea0a9 --block_device_mapping vda=bd7cf584-45de-44e3-bf7f-f7b50bf235e3:::0 myInstanceFromVolume +-------------------------------------+-------------------------------------------------+ | Property | Value | +-------------------------------------+-------------------------------------------------+ | OS-EXT-STS:task_state | scheduling | | image | cirros-0.3.1-x86_64-uec | | OS-EXT-STS:vm_state | building | | OS-EXT-SRV-ATTR:instance_name | instance-00000003 | | flavor | m1.small | | id | 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 | | security_groups | [{u'name': u'default'}] | | user_id | 376744b5910b4b4da7d8e6cb483b06a8 | | OS-DCF:diskConfig | MANUAL | | accessIPv4 | | | accessIPv6 | | | progress | 0 | | OS-EXT-STS:power_state | 0 | | OS-EXT-AZ:availability_zone | nova | | config_drive | | | status | BUILD | | updated | 2013-07-16T20:14:19Z | | hostId | | | OS-EXT-SRV-ATTR:host | None | | key_name | None | | OS-EXT-SRV-ATTR:hypervisor_hostname | None | | name | myInstanceFromVolume | | adminPass | LhwEmx5Ho22M | | tenant_id | 66265572db174a7aa66eba661f58eb9e | | created | 2013-07-16T20:14:18Z | | metadata | {} | +-------------------------------------+-------------------------------------------------+ Now when you list volumes, you can see that the volume is attached to a server: $ nova volume-list +--------------------------------------+--------+-----------------+------+-------------+--------------------------------------+ | ID | Status | Display Name | Size | Volume Type | Attached to | +--------------------------------------+--------+-----------------+------+-------------+--------------------------------------+ | bd7cf584-45de-44e3-bf7f-f7b50bf235e3 | in-use | my-bootable-vol | 8 | None | 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 | +--------------------------------------+--------+-----------------+------+-------------+--------------------------------------+ Additionally, when you list servers, you see the server that you booted from a volume: $ nova list +--------------------------------------+----------------------+--------+------------+-------------+------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------------------+--------+------------+-------------+------------------+ | b3cdc6c0-85a7-4904-ae85-71918f734048 | myCirrosServer | ACTIVE | None | Running | private=10.0.0.3 | | 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 | myInstanceFromVolume | ACTIVE | None | Running | private=10.0.0.4 | +--------------------------------------+----------------------+--------+------------+-------------+------------------+