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

Cannot restore VM snapshot on XenServer #8123

Open
MartinEmrich opened this issue Oct 20, 2023 · 6 comments · May be fixed by #9175
Open

Cannot restore VM snapshot on XenServer #8123

MartinEmrich opened this issue Oct 20, 2023 · 6 comments · May be fixed by #9175
Assignees
Milestone

Comments

@MartinEmrich
Copy link

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.

@weizhouapache
Copy link
Member

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%');

@MartinEmrich
Copy link
Author

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)

@AlexanderKgr
Copy link

AlexanderKgr commented Oct 26, 2023

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

@rohityadavcloud

@shwstppr
Copy link
Contributor

shwstppr commented Jun 5, 2024

@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 shwstppr moved this from Todo to In Progress in Apache CloudStack 4.19.1 Jun 5, 2024
@MartinEmrich
Copy link
Author

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.

@AlexanderKgr
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Dev In Progress
Development

Successfully merging a pull request may close this issue.

6 participants