Bug 2110351 - Can not create VM from template and delete template.
Summary: Can not create VM from template and delete template.
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: General
Version: 4.5.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ovirt-4.5.3
: ---
Assignee: Shmuel Melamud
QA Contact: Nisim Simsolo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-25 09:38 UTC by Tzu-Yi Liao
Modified: 2022-09-19 14:30 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-09-19 14:30:51 UTC
oVirt Team: Virt
Embargoed:
mperina: ovirt-4.5+


Attachments (Terms of Use)
create fail log and screenshot (203.59 KB, application/zip)
2022-07-25 09:38 UTC, Tzu-Yi Liao
no flags Details
engine and vdsm log (2.33 MB, application/zip)
2022-08-16 09:46 UTC, Tzu-Yi Liao
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-engine pull 609 0 None open core: Remove image if CreateSnapshotFromTemplateCommand failed 2022-08-23 00:26:56 UTC
Red Hat Issue Tracker RHV-47758 0 None None None 2022-07-25 09:47:59 UTC

Description Tzu-Yi Liao 2022-07-25 09:38:51 UTC
Created attachment 1899160 [details]
create fail log and screenshot

Description of problem:
Ubuntu 22.04 VM create from template fail, and can not remove template.


Version-Release number of selected component (if applicable):
4.5.1

How reproducible:
1. Create Ubuntu OS.
2. Make template (Click seal), named ubuntu-22.04_template
3. Create Vm from template ubuntu-22.04_template
4. Fail to creation
5. Remove ubuntu-22.04_template and get fail.  It will alert a depend disk, but the disk ID is not exist.


Steps to Reproduce:
1.
2.
3.

Actual results:
1. Can not create ubuntu vm from template.
2. Can not delete template when 1. failed.


Expected results:


Additional info:
Please see attached file.

Comment 1 RHEL Program Management 2022-07-29 07:09:43 UTC
The documentation text flag should only be set after 'doc text' field is provided. Please provide the documentation text and set the flag to '?' again.

Comment 2 Milan Zamazal 2022-07-29 15:56:34 UTC
(In reply to Tzu-Yi Liao from comment #0)

> 1. Can not create ubuntu vm from template.

It works for me. The difference is that my fstab uses UUIDs to mount the disks, while yours uses paths and has trouble with them:

  guestfsd: error: mount_options_stub: /dev/disk/by-id/dm-uuid-LVM-bPjAuocnvLvMyvC1YMLCFoSreaRJ2zV5Kmr9XJYF6OI8595rv7Dhkd4GvRe06Zmt: No such file or directory

It seems your VM uses a disk arrangement that libguestfs cannot understand and/or process.

> 2. Can not delete template when 1. failed.

But this shouldn't happen. Could you please provide Engine and Vdsm logs with the corresponding action and its failure?

Comment 3 Shmuel Melamud 2022-08-16 00:19:45 UTC
I haven't succeeded to reproduce the issue. Creation of the sealed template goes without errors and template removal also succeeds.

Tzu-Yi, can you please reproduce the bug in your environment and put here the Engine and VDSM logs?

Comment 4 Tzu-Yi Liao 2022-08-16 09:42:35 UTC
(In reply to Shmuel Melamud from comment #3)
> I haven't succeeded to reproduce the issue. Creation of the sealed template
> goes without errors and template removal also succeeds.
> 
> Tzu-Yi, can you please reproduce the bug in your environment and put here
> the Engine and VDSM logs?

Hello Sir,
Sorry for my late.

Here is my steps today:
Steps:
1. Create Ubuntu 22.04 VM (UEFI), named  u22.04-uefi.
2. Create template named u22.04-uefi-seal from VM, and click "seal".
3. Create VM from u22.04-uefi-seal using thin, get fail.
4. Create VM from u22.04-uefi-seal using clone, get fail.
5. Remove  u22.04-uefi (Success).
6. Remove template u22.04-uefi-seal (Fail). (Message: Cannot remove Template. The following Disk(s) are based on it:
(ba7c756f-5d38-4c34-a5b8-9b0cc9ceed5b) .)

Thank you very much.

Steven

Comment 5 Tzu-Yi Liao 2022-08-16 09:46:47 UTC
Created attachment 1905715 [details]
engine and vdsm log

#c4 attachment file

Comment 7 Tzu-Yi Liao 2022-08-18 03:07:51 UTC
(In reply to Tzu-Yi Liao from comment #4)
> (In reply to Shmuel Melamud from comment #3)
> > I haven't succeeded to reproduce the issue. Creation of the sealed template
> > goes without errors and template removal also succeeds.
> > 
> > Tzu-Yi, can you please reproduce the bug in your environment and put here
> > the Engine and VDSM logs?
> 
> Hello Sir,
> Sorry for my late.
> 
> Here is my steps today:
> Steps:
> 1. Create Ubuntu 22.04 VM (UEFI), named  u22.04-uefi.
> 2. Create template named u22.04-uefi-seal from VM, and click "seal".
> 3. Create VM from u22.04-uefi-seal using thin, get fail.
> 4. Create VM from u22.04-uefi-seal using clone, get fail.
> 5. Remove  u22.04-uefi (Success).
> 6. Remove template u22.04-uefi-seal (Fail). (Message: Cannot remove
> Template. The following Disk(s) are based on it:
> (ba7c756f-5d38-4c34-a5b8-9b0cc9ceed5b) .)
> 
> Thank you very much.
> 
> Steven

I reproduce today.
Both UEFI and BIOS type are failed.

Prepare:
1. Destroy data domain.
2. Delete all files on share storage(NFS).
3. Mount data domain.

Steps (Phase1):
1. Create Ubuntu 22.04 VM (UEFI), named  ubuntu2204-uefi, using LVM.
2. Create Ubuntu 22.04 VM (UEFI), named  ubuntu2204-bios, using LVM.
3. Create template named t-u2204-uefi-seal from VM ubuntu2204-uefi, and click "seal", using QCOW2.
4. Create template named t-u2204-bios-seal from VM ubuntu2204-bios, and click "seal", using QCOW2.
5. Create VM from t-u2204-uefi-seal (using clone and thin), get fail.
6. Create VM from t-u2204-bios-seal (using clone and thin), get fail.
7. Remove t-u2204-uefi-seal, get fail (Cannot remove Template. The following Disk(s) are based on it: (a7067015-d04f-43fe-94d4-67ddea3058a5) .).
8. Remove VM from t-u2204-bios-seal, get fail (Cannot remove Template. The following Disk(s) are based on it: (7df7c81a-4f2c-4845-9659-51eb1eece0dd) .).


Steps (Phase2):
1. Create template named t-u2204-uefi from VM ubuntu2204-uefi, using QCOW2.
2. Create template named t-u2204-bios from VM ubuntu2204-bios, using QCOW2.
3. Create VM from t-u2204-uefi (using clone and thin), create success and can be poweron.
4. Create VM from t-u2204-bios (using clone and thin), create success and can be poweron.
5. Delete VMs from 3. and 4.
6. Remove t-u2204-bios success.
7. Remove t-u2204-uefi success.

Does seal function is not support Ubuntu?  If so, how can I remove template manually.

Thanks for everyone.

Comment 8 Milan Zamazal 2022-08-18 20:27:30 UTC
Thank you for the additional info. I cannot reproduce the scenario above but I could reproduce the problem with a non-removable template in a bit different way:

1. Create an Ubuntu VM (it would probably work with other guest OSes too).
2. Run the VM and change the entry for the root file system in /etc/fstab to a non-existent device path (e.g. "/dev/xxxxx / ...").
3. Shut down the VM and make a template from it, *without* sealing.
4. Try to create thin and cloned VMs from the template, *with* sealing. It fails, the VMs are not created.
5. Try to remove the template. It fails with "Cannot remove Template. The following Disk(s) are based on it: (DISK-UUID) ." The reported DISK-UUID is not present among the disks listed in Storage -> Disks.

BTW, sealing works for my Ubuntu VMs, both non-LVM and LVM (but the fstab entries are of different form than in your case). You probably managed to create a configuration that virt-sysprep cannot recognize. We cannot do anything about it but the problem with a non-removable template looks like an oVirt bug.

Comment 9 Shmuel Melamud 2022-08-23 00:26:26 UTC
Final steps to reproduce:

1. Create an Ubuntu VM (it would probably work with other Linuxes too).
2. Run the VM and change the entry for the root file system in /etc/fstab to a non-existent device path (e.g. "/dev/xxxxx / ...").
3. Shut down the VM and make a template from it, *without* sealing.
4. Try to create a thin-provisioned VM from the template, *with* sealing. It fails, the VM is not created.
5. Try to remove the template. It fails with "Cannot remove Template. The following Disk(s) are based on it: (DISK-UUID) ." The DISK-UUID is an image group ID, so it is not present among the disks listed in Storage -> Disks.

Comment 11 Casper (RHV QE bot) 2022-08-31 14:07:29 UTC
This bug has low overall severity and is not going to be further verified by QE. If you believe special care is required, feel free to properly align relevant severity, flags and keywords to raise PM_Score or use one of the Bumps ('PrioBumpField', 'PrioBumpGSS', 'PrioBumpPM', 'PrioBumpQA') in Keywords to raise it's PM_Score above verification threashold ({QE_LOWPRIO_SCORE}).

Comment 12 Casper (RHV QE bot) 2022-09-19 14:30:51 UTC
This bug has low overall severity and passed an automated regression suite, and is not going to be further verified by QE. If you believe special care is required, feel free to re-open to ON_QA status.


Note You need to log in before you can comment on or make changes to this bug.