)]}'
{"openstackclient/compute/v2/server.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ea1cf05375a17bcb0fc8335b909214173aec394","unresolved":false,"context_lines":[{"line_number":580,"context_line":"                   \u0027\u003cdev-name\u003e\u003d\u003cid\u003e:\u003ctype\u003e:\u003csize(GB)\u003e:\u003cdelete-on-terminate\u003e\\n\u0027"},{"line_number":581,"context_line":"                   \u0027\u003cdev-name\u003e: block device name, like: vdb, xvdc \u0027"},{"line_number":582,"context_line":"                   \u0027(required)\\n\u0027"},{"line_number":583,"context_line":"                   \u0027\u003cid\u003e: UUID of the volume, volume snapshot or image \u0027"},{"line_number":584,"context_line":"                   \u0027(required)\\n\u0027"},{"line_number":585,"context_line":"                   \u0027\u003ctype\u003e: volume, snapshot or image; default: volume \u0027"},{"line_number":586,"context_line":"                   \u0027(optional)\\n\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_cf3d03de","line":583,"updated":"2019-07-29 17:04:59.000000000","message":"It\u0027s unrelated but I added \"volume snapshot\" here since it\u0027s always confused me that this says snapshot and means volume snapshot since snapshots are generally associated with images rather than volumes.","commit_id":"808c1b338c7701233c917c33f05f3ca55b09ea9d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ea1cf05375a17bcb0fc8335b909214173aec394","unresolved":false,"context_lines":[{"line_number":814,"context_line":"                    image_id \u003d utils.find_resource("},{"line_number":815,"context_line":"                        image_client.images, dev_map[0]).id"},{"line_number":816,"context_line":"                    mapping[\u0027uuid\u0027] \u003d image_id"},{"line_number":817,"context_line":"                    # TODO(mriedem): What if --image is specified and the"},{"line_number":818,"context_line":"                    # IDs are different? Fail? Make the BDM a non-root"},{"line_number":819,"context_line":"                    # volume (does this happen anyway since boot_index is not"},{"line_number":820,"context_line":"                    # specified?)?"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_4f291399","line":817,"updated":"2019-07-29 17:04:59.000000000","message":"I need to do some manual testing in devstack to figure out the scenarios here and what\u0027s best.","commit_id":"808c1b338c7701233c917c33f05f3ca55b09ea9d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1f5f8a23f35442c7560d385f57f1d8e10b4c8eac","unresolved":false,"context_lines":[{"line_number":814,"context_line":"                    image_id \u003d utils.find_resource("},{"line_number":815,"context_line":"                        image_client.images, dev_map[0]).id"},{"line_number":816,"context_line":"                    mapping[\u0027uuid\u0027] \u003d image_id"},{"line_number":817,"context_line":"                    # TODO(mriedem): What if --image is specified and the"},{"line_number":818,"context_line":"                    # IDs are different? Fail? Make the BDM a non-root"},{"line_number":819,"context_line":"                    # volume (does this happen anyway since boot_index is not"},{"line_number":820,"context_line":"                    # specified?)?"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_e258fb31","line":817,"in_reply_to":"7faddb67_11d48b1f","updated":"2019-07-30 21:41:10.000000000","message":"If you try to specify the same --image as in --block-device-mapping vda\u003d$image_id:image:\u003csize\u003e it fails because nova\u0027s trying to create a root image-defined bdm from the --image at vda and the bdm passed in is conflicting with vda:\n\n$ openstack server create --image $IMAGE_ID --block-device-mapping vda\u003d$IMAGE_ID:image:1:true --flavor m1.tiny --wait test-vol-backed-vm-from-image\nThe volume cannot be assigned the same device name as the root device vda (HTTP 400) (Request-ID: req-b4569b5f-4415-4911-9119-7afd856e2714)\n\nHowever, if you use a different device name for the block device like vdb it works:\n\nstack@devstack:~$ openstack server create --image $IMAGE_ID --block-device-mapping vdb\u003d$IMAGE_ID:image:1:true --flavor m1.tiny --wait test-img-back-vm-with-img-vol\n\n+-------------------------------------+-----------------------------------------------------------------+\n| Field                               | Value                                                           |\n+-------------------------------------+-----------------------------------------------------------------+\n| OS-DCF:diskConfig                   | MANUAL                                                          |\n| OS-EXT-AZ:availability_zone         | nova                                                            |\n| OS-EXT-SRV-ATTR:host                | devstack                                                        |\n| OS-EXT-SRV-ATTR:hypervisor_hostname | devstack                                                        |\n| OS-EXT-SRV-ATTR:instance_name       | instance-0000000c                                               |\n| OS-EXT-STS:power_state              | Running                                                         |\n| OS-EXT-STS:task_state               | None                                                            |\n| OS-EXT-STS:vm_state                 | active                                                          |\n| OS-SRV-USG:launched_at              | 2019-07-30T21:37:15.000000                                      |\n| OS-SRV-USG:terminated_at            | None                                                            |\n| accessIPv4                          |                                                                 |\n| accessIPv6                          |                                                                 |\n| addresses                           | public\u003d2001:db8::1aa, 172.24.4.182                              |\n| adminPass                           | md6YTP32WGYp                                                    |\n| config_drive                        |                                                                 |\n| created                             | 2019-07-30T21:36:59Z                                            |\n| flavor                              | m1.tiny (1)                                                     |\n| hostId                              | c53e97b672cfe22e8c14bcbcddc7b5ad7e6992b9ec8876172f70443b        |\n| id                                  | a9d77bf3-dbbe-4832-80a6-f1bcc502e6f9                            |\n| image                               | cirros-0.4.0-x86_64-disk (05496c83-e2df-4c2f-9e48-453b6e49160d) |\n| key_name                            | None                                                            |\n| name                                | test-img-back-vm-with-img-vol                                   |\n| progress                            | 0                                                               |\n| project_id                          | c2ec23840e4447ed8b2dfbe08c8425c0                                |\n| properties                          |                                                                 |\n| security_groups                     | name\u003d\u0027default\u0027                                                  |\n| status                              | ACTIVE                                                          |\n| updated                             | 2019-07-30T21:37:15Z                                            |\n| user_id                             | 246edff52847429fa01f194d1f62f570                                |\n| volumes_attached                    | id\u003d\u0027cf15d909-3162-4476-8054-5030e8320ecd\u0027                       |\n+-------------------------------------+-----------------------------------------------------------------+\nstack@devstack:~$ openstack volume list\n+--------------------------------------+------+--------+------+--------------------------------------------------------+\n| ID                                   | Name | Status | Size | Attached to                                            |\n+--------------------------------------+------+--------+------+--------------------------------------------------------+\n| cf15d909-3162-4476-8054-5030e8320ecd |      | in-use |    1 | Attached to test-img-back-vm-with-img-vol on /dev/vdb  |\n+--------------------------------------+------+--------+------+--------------------------------------------------------+\nstack@devstack:~$ openstack volume show cf15d909-3162-4476-8054-5030e8320ecd -f value -c volume_image_metadata\n{u\u0027container_format\u0027: u\u0027bare\u0027, u\u0027min_ram\u0027: u\u00270\u0027, u\u0027disk_format\u0027: u\u0027qcow2\u0027, u\u0027image_name\u0027: u\u0027cirros-0.4.0-x86_64-disk\u0027, u\u0027image_id\u0027: u\u002705496c83-e2df-4c2f-9e48-453b6e49160d\u0027, u\u0027checksum\u0027: u\u0027443b7623e27ecf03dc9e01ee93f67afe\u0027, u\u0027min_disk\u0027: u\u00270\u0027, u\u0027size\u0027: u\u002712716032\u0027}\n\nThat doesn\u0027t make a ton of sense in a real world scenario since you\u0027d have essentially a bootable volume attached to the guest and have the same root disk OS image. In this case nova creates a bootable image-backed volume from the provided image and attaches it at vdb.\n\nAnyway, I think the point is specifying --image and --block-device-mapping with type\u003dimage is OK but has some caveats:\n\n1. can\u0027t use vda for the bdm\n2. if you use device!\u003dvda, nova creates a volume and attaches it to the server (as it does for the type\u003dsnapshot case).","commit_id":"808c1b338c7701233c917c33f05f3ca55b09ea9d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"621b8cc706c28bb5daa8786ada0916fe2a4e591a","unresolved":false,"context_lines":[{"line_number":814,"context_line":"                    image_id \u003d utils.find_resource("},{"line_number":815,"context_line":"                        image_client.images, dev_map[0]).id"},{"line_number":816,"context_line":"                    mapping[\u0027uuid\u0027] \u003d image_id"},{"line_number":817,"context_line":"                    # TODO(mriedem): What if --image is specified and the"},{"line_number":818,"context_line":"                    # IDs are different? Fail? Make the BDM a non-root"},{"line_number":819,"context_line":"                    # volume (does this happen anyway since boot_index is not"},{"line_number":820,"context_line":"                    # specified?)?"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_11d48b1f","line":817,"in_reply_to":"7faddb67_4f291399","updated":"2019-07-30 19:56:42.000000000","message":"OK it looks like if you use --image then the --block-device-mapping entries that get added are for non-root data volumes which is what I\u0027d expect.\n\n$ openstack server create --flavor m1.tiny --image $IMAGE_ID --block-device-mapping vdb\u003d$VOL_ID --wait test-image-backed-vm-with-data-vol\n\n+-----------------------------+-----------------------------------------------------------------+\n| Field                       | Value                                                           |\n+-----------------------------+-----------------------------------------------------------------+\n| OS-DCF:diskConfig           | MANUAL                                                          |\n| OS-EXT-AZ:availability_zone | nova                                                            |\n| OS-EXT-STS:power_state      | Running                                                         |\n| OS-EXT-STS:task_state       | None                                                            |\n| OS-EXT-STS:vm_state         | active                                                          |\n| OS-SRV-USG:launched_at      | 2019-07-30T19:42:40.000000                                      |\n| OS-SRV-USG:terminated_at    | None                                                            |\n| accessIPv4                  |                                                                 |\n| accessIPv6                  |                                                                 |\n| addresses                   | private\u003dfdb8:bc01:8364:0:f816:3eff:fe3f:677c, 10.0.0.56         |\n| adminPass                   | 3kLpMHb4YjrV                                                    |\n| config_drive                |                                                                 |\n| created                     | 2019-07-30T19:42:29Z                                            |\n| flavor                      | m1.tiny (1)                                                     |\n| hostId                      | 1e2d72c582e4542b3d9de026c6476d1e8ff3a5ed9cc7719ff22d914d        |\n| id                          | 68bb57ce-8204-4a70-9afa-ba2cf2e09bd6                            |\n| image                       | cirros-0.4.0-x86_64-disk (05496c83-e2df-4c2f-9e48-453b6e49160d) |\n| key_name                    | None                                                            |\n| name                        | test-image-backed-vm-with-data-vol                              |\n| progress                    | 0                                                               |\n| project_id                  | d091b3b4126942768751c69e2ae510ac                                |\n| properties                  |                                                                 |\n| security_groups             | name\u003d\u0027default\u0027                                                  |\n| status                      | ACTIVE                                                          |\n| updated                     | 2019-07-30T19:42:41Z                                            |\n| user_id                     | 52b44ebe1fca4bbb881d6e48a527427a                                |\n| volumes_attached            | id\u003d\u0027e8b6dc1e-3ea7-43f4-bdd7-9f2032f07cdc\u0027                       |\n+-----------------------------+-----------------------------------------------------------------+\n\nmysql\u003e select boot_index,volume_id,device_name from block_device_mapping where instance_uuid \u003d \"68bb57ce-8204-4a70-9afa-ba2cf2e09bd6\";\n+------------+--------------------------------------+-------------+\n| boot_index | volume_id                            | device_name |\n+------------+--------------------------------------+-------------+\n|          0 | NULL                                 | /dev/vda    |\n|       NULL | e8b6dc1e-3ea7-43f4-bdd7-9f2032f07cdc | /dev/vdb    |\n+------------+--------------------------------------+-------------+\n2 rows in set (0.00 sec)","commit_id":"808c1b338c7701233c917c33f05f3ca55b09ea9d"}]}
