Create VM from volume having no "volume_image_metadata" should not be allowed

Bug #2009448 reported by Amit Uniyal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

Description
===========
VM creation from a volume with no image data should not be allowed.
Right now, we can create a bootable volume with no image, and then we can create a VM from the volume. The VM will get created, but it won't boot as there is no image to boot from.

Nova should verify this request and send an error message with the appropriate message.

Steps to reproduce
==================

$ openstack volume create --bootable --size 1 vol3
$ openstack server create --network public --flavor 1 vm_3 --volume vol3 --wait

$ openstack console log show vm_3 # it won't return any log
$ openstack console url show vm_3 # check via vnc

Expected result
===============
Nova should tell user, it's not correct.

Actual result
=============
VM gets created with without any issue, but user can't use it.

Revision history for this message
Amit Uniyal (auniyal) wrote (last edit ):

Volume with we can create VM:

$ openstack volume show vol4 -f json
{
  "attachments": [
    {
      "id": "17f4e508-9c56-40cb-aa80-e8083967ddfc",
      "attachment_id": "a7c68363-3792-40a6-95eb-9c6281a9d719",
      "volume_id": "17f4e508-9c56-40cb-aa80-e8083967ddfc",
      "server_id": "47753229-721a-4abd-af47-688770479263",
      "host_name": "devstack-amit",
      "device": "/dev/vda",
      "attached_at": "2023-03-06T11:38:42.000000"
    }
  ],
  "availability_zone": "nova",
  "bootable": "true",
  "consistencygroup_id": null,
  "created_at": "2023-03-06T11:03:00.000000",
  "description": null,
  "encrypted": false,
  "id": "17f4e508-9c56-40cb-aa80-e8083967ddfc",
  "migration_status": null,
  "multiattach": false,
  "name": "vol4",
  "os-vol-host-attr:host": "devstack-amit@lvmdriver-1#lvmdriver-1",
  "os-vol-mig-status-attr:migstat": null,
  "os-vol-mig-status-attr:name_id": null,
  "os-vol-tenant-attr:tenant_id": "0bb9ac25449143f495820368c9179fd7",
  "properties": {},
  "replication_status": null,
  "size": 1,
  "snapshot_id": null,
  "source_volid": null,
  "status": "in-use",
  "type": "lvmdriver-1",
  "updated_at": "2023-03-06T11:38:42.000000",
  "user_id": "0bc639c5dcaf41ceaf58f3b87d0d5a39",
  "volume_image_metadata": {
    "hw_rng_model": "virtio",
    "owner_specified.openstack.md5": "",
    "owner_specified.openstack.object": "images/cirros-0.5.2-x86_64-disk",
    "owner_specified.openstack.sha256": "",
    "image_id": "b8b357e3-0fa0-47ac-a9b4-03821ab383c1",
    "image_name": "cirros-0.5.2-x86_64-disk",
    "checksum": "b874c39491a2377b8490f5f1e89761a4",
    "container_format": "bare",
    "disk_format": "qcow2",
    "min_disk": "0",
    "min_ram": "0",
    "size": "16300544"
  }
}

Revision history for this message
Amit Uniyal (auniyal) wrote :

Volume with which we can create VM, but it do not boot:

$ openstack volume show vol3 -f json
{
  "attachments": [],
  "availability_zone": "nova",
  "bootable": "true",
  "consistencygroup_id": null,
  "created_at": "2023-03-06T10:51:10.000000",
  "description": null,
  "encrypted": false,
  "id": "7043e2ee-a73f-456c-b963-b755c230d74b",
  "migration_status": null,
  "multiattach": false,
  "name": "vol3",
  "os-vol-host-attr:host": "devstack-amit@lvmdriver-1#lvmdriver-1",
  "os-vol-mig-status-attr:migstat": null,
  "os-vol-mig-status-attr:name_id": null,
  "os-vol-tenant-attr:tenant_id": "0bb9ac25449143f495820368c9179fd7",
  "properties": {},
  "replication_status": null,
  "size": 1,
  "snapshot_id": null,
  "source_volid": null,
  "status": "available",
  "type": "lvmdriver-1",
  "updated_at": "2023-03-06T11:36:06.000000",
  "user_id": "0bc639c5dcaf41ceaf58f3b87d0d5a39"
}

Revision history for this message
sean mooney (sean-k-mooney) wrote :

this is a supported workflow.

its actully quite common for windows as you will create a VM and boot form an iso with an attached data volume
then you will delete the VM and boot a second VM form the volume

so image_metadata is not required on a volume

Changed in nova:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.