Skip to content

Volumes made from image cache are snapshotted backwards #31

@rmb938

Description

@rmb938

This is a weird one, it may be an Openstack issue and not an issue with this driver.

  1. Set image_volume_cache_enabled = True for this driver and start with no images currently cached.
  2. Launch an instance so it creates a volume of the provided image, i.e
     resource "openstack_compute_instance_v2" "boot-from-volume" {
       name            = "boot-from-volume"
       flavor_id       = "1"
       key_pair        = "mykey"
       security_groups = ["default"]
       config_drive    = true
     
       block_device {
         uuid                  = "5cb160aa-5e5f-46e8-a217-a30135bed695"
         source_type           = "image"
         volume_size           = 50
         boot_index            = 0
         volume_type           = "ixsystems-iscsi"
         destination_type      = "volume"
         delete_on_termination = true
       }
  3. Delete the instance

The volume that was made for the instance will get stuck in Error Deleting, see screenshot of the instance volume + the image cache volume in horizon + in truenas UI:

Screenshot_20230128_124206

Screenshot_20230128_123949

In the truenas UI I see there is a snapshot on the instance volume.

Screenshot_20230128_124009

Per testing, this snapshot gets created when the image is cached, then is used to create a zvol for the cached image.

This seems a bit backwards to me. I would expect the volume to be created in openstack, zvol created in truenas which is the cached image, snapshot taken of that, then a new zvol created from that snapshot for the instance disk. But it seems to be taking a snapshot of the instance's volume to cache the image.

If I delete the image-5cb160aa-5e5f-46e8-a217-a30135bed695 volume, then reset the sate of 9f6a6172-27ba-4afc-ad02-28c826d8ec86 then delete 9f6a6172-27ba-4afc-ad02-28c826d8ec86 everything works fine. So I beleive it's due to this snapshot on the instance volume due to the image cache.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions