Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volumes made from image cache are snapshotted backwards #31

Open
rmb938 opened this issue Jan 28, 2023 · 2 comments
Open

Volumes made from image cache are snapshotted backwards #31

rmb938 opened this issue Jan 28, 2023 · 2 comments
Assignees

Comments

@rmb938
Copy link

rmb938 commented Jan 28, 2023

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.

@rmb938
Copy link
Author

rmb938 commented Jan 28, 2023

It seems like I can "fix" the issue by promoting the "volume-45c47a88" dataset in the UI.

@YiHuangDB YiHuangDB self-assigned this Feb 1, 2023
YiHuangDB added a commit to YiHuangDB/cindertruenas that referenced this issue Apr 24, 2023
william-gr added a commit that referenced this issue Apr 25, 2023
1. #31 fix, add support for image volume cache. 2. Minor fix to improve code stability
@YiHuangDB
Copy link
Contributor

Hi Ryan, this issue is not fixed by PR#35 #35, with latest master branch code, cache volume now managed by driver properly by promoting the volume. Thank you for reporting this issue. -Yi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants