cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Cannot restore VM snapshot on XenServer

Open MartinEmrich opened this issue 2 years ago • 6 comments

ISSUE TYPE
  • Bug Report
COMPONENT NAME
Management Server/Hypervisor
CLOUDSTACK VERSION
4.18.1
CONFIGURATION

Single Host Pool with XCP-ng 7.5

OS / ENVIRONMENT

Management Server: CentOS 7

SUMMARY

Web UI presents this message when trying to revert a snapshot:

(i-39-6822-VM_VS_20231020072617) Revert VM: i-39-6822-VM to snapshot: i-39-6822-VM_VS_20231020072617 failed due to Hypervisor com.cloud.hypervisor.xenserver.resource.XenServer650Resource doesn't support guest OS type Debian GNU/Linux 12 (64-bit). you can choose 'Other install media' to run it as HVM

The message is IMHO wrong, the VM with Debian 12 worked fine before.

STEPS TO REPRODUCE

Import Debian 12 netinst ISO image Create VM from it (Type "Debian GNU/Linux 12 (64 Bit)") Take a VM Snapshot (no Quiesce, no RAM) (works fine) Shutdown VM Restore snapshot

EXPECTED RESULTS

I expected it to restore all Volumes to the snapshot state.

ACTUAL RESULTS

Above error message popped up shortly after trying to restore the snapshot.

Looks similar to #6941, but I was asked to create a new issue.

MartinEmrich avatar Oct 20 '23 09:10 MartinEmrich

thanks @MartinEmrich

can you share the results of mysql queries ?

select * from guest_os_hypervisor where guest_os_id in (select id from guest_os where display_name like 'Ubuntu 20.04 LTS') and hypervisor_type ='Xenserver';

select * from guest_os_hypervisor where guest_os_id in (select id from guest_os where display_name like 'Debian GNU/Linux 12 (64%');

weizhouapache avatar Oct 20 '23 09:10 weizhouapache

The first:

id;hypervisor_type;guest_os_name;guest_os_id;hypervisor_version;uuid;created;removed;is_user_defined
7402;Xenserver;Ubuntu Focal Fossa 20.04;305;8.2.0;03c0f7f7-5ec9-464f-88dc-aaed9eabb26a;2023-09-05 16:14:24;\N;0
7802;Xenserver;Ubuntu Focal Fossa 20.04;323;8.2.0;2e3d7eb0-8cb7-411c-a08b-0216b352cc0e;2023-09-06 11:57:33;\N;0

(Though I don't use Ubuntu 20.04)

The second:

id;hypervisor_type;guest_os_name;guest_os_id;hypervisor_version;uuid;created;removed;is_user_defined
7677;VMware;debian12_64Guest;367;8.0;5e3385eb-05e4-4163-b242-9bc7789fbd9f;2023-09-06 11:57:33;\N;0
7793;VMware;debian12_64Guest;367;8.0.1;a065c24b-3e5e-4ecd-aa66-2e8b6bd3b353;2023-09-06 11:57:33;\N;0

(No VMWare here either)

Hypervisor is XCP-ng 7.5, but installing and running Debian 12 worked flawlessly. (We plan to upgrade to XCP-ng latest, but no timeframe yet)

MartinEmrich avatar Oct 20 '23 10:10 MartinEmrich

i am facing the same issue with xcp-ng 8.2.1 image

@rohityadavcloud

AlexanderKgr avatar Oct 26 '23 05:10 AlexanderKgr

@MartinEmrich @weizhouapache @AlexanderKgr I investigated this and found that the error is because ACS Xenserver plugin is not able to find the stopped VM as it has been destroyed on the hypervisor (VM disks are intact but just the VM reference is removed on the hypervisor side). I've drafted PR #9175 which will change this behaviour. This would need some tests or maybe a discussion if this behavioural change (to not remove VM reference from the hypervisor when it is stopped by ACS) should be guarded with a global config. With changes I was successfully able revert a VM snapshot

shwstppr avatar Jun 05 '24 11:06 shwstppr

Though I reported it, I more or less noticed it by accident. We normally do not use Snapshots at all. And as the hardware is showing it's age, the whole cluster here now has a "do not touch" aura, and for various reasons beyond my control will not be replaced. So I most probably will never see ACS 4.19 in action, so I cannot give feedback on this issue.

MartinEmrich avatar Jun 05 '24 13:06 MartinEmrich

@shwstppr i have found a temporary fix for this issue. Going to Configuration - Guest OS mapping and adding the matching that it is missing , for exaxmple image

Fixes the error.

Your approach - VMs won't be destroyed on shutdown - will fix many issues. One big is that it will be possible to use xen orchestra backup system because vm will be there and shutdown. Backup on xen orchestra works with uuid of vm. Everytime cloudstack boots a vm it has a new uuid so every time it needs to be adjusted with the new.

I am capable of test any new behavior before fully releasing publicly

Thanks in advance

AlexanderKgr avatar Jun 05 '24 15:06 AlexanderKgr

Fixed with: https://github.com/apache/cloudstack/pull/9175

Pearl1594 avatar Apr 14 '25 03:04 Pearl1594