Atom feed of this document
  
 

 Attach non-bootable volume to an instance

Use the --block-device parameter to attach an existing, non-bootable volume to a new instance.

  1. Create a volume:

    $ cinder create --display-name my-volume 8
    +---------------------+--------------------------------------+
    |       Property      |                Value                 |
    +---------------------+--------------------------------------+
    |     attachments     |                  []                  |
    |  availability_zone  |                 nova                 |
    |       bootable      |                false                 |
    |      created_at     |      2014-02-04T21:25:18.730961      |
    | display_description |                 None                 |
    |     display_name    |              my-volume               |
    |          id         | 3195a5a7-fd0d-4ac3-b919-7ba6cbe11d46 |
    |       metadata      |                  {}                  |
    |         size        |                  8                   |
    |     snapshot_id     |                 None                 |
    |     source_volid    |                 None                 |
    |        status       |               creating               |
    |     volume_type     |                 None                 |
    +---------------------+--------------------------------------+
  2. List volumes:

    $ cinder list
    +--------------------------------------+---------+--------------+------+-------------+----------+-------------+
    |                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
    +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
    | 3195a5a7-fd0d-4ac3-b919-7ba6cbe11d46 | available |  my-volume   |  8   |     None    |  false   |             |
    +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
    [Note]Note

    The volume is not bootable because it was not created from an image.

    The volume is also entirely empty: It has no partition table and no file system.

  3.  

    Run this command to create an instance and boot it with the volume that is attached to this instance. An image is used as boot source:

    $ nova boot --flavor 2 --image e0b7734d-2331-42a3-b19e-067adc0da17d \
            --block-device source=volume,id=3195a5a7-fd0d-4ac3-b919-7ba6cbe11d46,dest=volume,shutdown=preserve \
            myInstanceWithVolume
    +--------------------------------------+----------------------------------------------------+
    | Property                             | Value                                              |
    +--------------------------------------+----------------------------------------------------+
    | OS-EXT-STS:task_state                | scheduling                                         |
    | image                                | e0b7734d-2331-42a3-b19e-067adc0da17d               |
    | OS-EXT-STS:vm_state                  | building                                           |
    | OS-EXT-SRV-ATTR:instance_name        | instance-00000003                                  |
    | flavor                               | m1.small                                           |
    | id                                   | 8ed8b0f9-70de-4662-a16c-0b51ce7b17b4               |
    | security_groups                      | [{u'name': u'default'}]                            |
    | user_id                              | 352b37f5c89144d4ad0534139266d51f                   |
    | 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-10-16T01:43:26Z                               |
    | hostId                               |                                                    |
    | OS-EXT-SRV-ATTR:host                 | None                                               |
    | OS-SRV-USG:terminated_at             | None                                               |
    | key_name                             | None                                               |
    | OS-EXT-SRV-ATTR:hypervisor_hostname  | None                                               |
    | name                                 | myInstanceWithVolume                               |
    | adminPass                            | BULD33uzYwhq                                       |
    | tenant_id                            | f7ac731cc11f40efbc03a9f9e1d1d21f                   |
    | created                              | 2013-10-16T01:43:25Z                               |
    | os-extended-volumes:volumes_attached | [{u'id': u'3195a5a7-fd0d-4ac3-b919-7ba6cbe11d46'}] |
    | metadata                             | {}                                                 |
    +--------------------------------------+----------------------------------------------------+
  4. List volumes:

    $ nova volume-list

    Note that the volume is attached to a server:

    +--------------------------------------+-----------+--------------+------+-------------+--------------------------------------+
    | ID                                   | Status    | Display Name | Size | Volume Type | Attached to                          |
    +--------------------------------------+-----------+--------------+------+-------------+--------------------------------------+
    | 3195a5a7-fd0d-4ac3-b919-7ba6cbe11d46 | in-use    |  my-volume   | 8    | None        | 8ed8b0f9-70de-4662-a16c-0b51ce7b17b4 |
    +--------------------------------------+-----------+--------------+------+-------------+--------------------------------------+
Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page

loading table of contents...