Bug 1910858
Summary: | vm_ovf_generations is not cleared while detaching the storage domain causing VM import with old stale configuration | ||
---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | nijin ashok <nashok> |
Component: | ovirt-engine | Assignee: | Pavel Bar <pbar> |
Status: | CLOSED ERRATA | QA Contact: | Evelina Shames <eshames> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 4.3.4 | CC: | dfodor, eshenitz, mavital, pbar, sfishbai, tnisan |
Target Milestone: | ovirt-4.4.6 | Keywords: | ZStream |
Target Release: | 4.4.6 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | ovirt-engine-4.4.6.4 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-06-01 13:22:11 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
nijin ashok
2020-12-25 09:10:39 UTC
All referenced patches are merged, can you please update on this bug status? Steps to Reproduce: ------------------ 0. Environment (2 engines): a. Engine 1 Data Center "DC1", Cluster, Host, Storage Domain "NFS_SD1", 1 disk. b. Engine 2 Data Center "DC2", Cluster, Host. Note: at the following steps where VM is mentioned, do *exactly the same* for VM template (can be tested in parallel, at the same flow). 1. Create a "VM1" VM on Engine 1 with 1 GB memory and 1 CPU. Click on the VM and attach a disk to it. 2. Increase VM memory to 2 GB and CPU to 2. 3. Put the Storage Domain in maintenance mode ("Storage" → "Storage Domains" → click on "NFS_SD1" → "Data Center" tab → select the "DC1" Data Center → Press the "Maintenance" button). 4. Run "engine-psql.sh" from the CLI on Engine 1 (use the correct vm_guid for VM / VM template): pbar@engine1$ ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c "select ovf_data from vm_ovf_generations where vm_guid='e397e809-1237-46fa-87de-fb669b1c9ec0'" | cut -c 2- | grep xml | xmllint --format - | egrep -B1 "Memory Size|Number of virtual CPU" <rasd:Caption>2 virtual cpu</rasd:Caption> <rasd:Description>Number of virtual CPU</rasd:Description> -- <rasd:Caption>2048 MB of memory</rasd:Caption> <rasd:Description>Memory Size</rasd:Description> 5. Detach the Storage Domain ("Storage" → "Storage Domains" → click on "NFS_SD1" → "Data Center" tab → select the "DC1" Data Center → Press the "Detach" button). 6. Run "engine-psql.sh" from the CLI on Engine 1: ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c "select vm_guid,ovf_generation from vm_ovf_generations;" vm_guid | ovf_generation --------------------------------------+---------------- e397e809-1237-46fa-87de-fb669b1c9ec0 | 5 (1 row) 7. Import the "NFS_SD1" Storage Domain on Engine 2 ("Storage" → "Storage Domains" → "Import Domain" button → fill "Name" and "Export Path" the same as you used when initially adding "NFS_SD1" to Engine 1). 8. Attach the "NFS_SD1" Storage Domain to "DC2" Data Center on Engine 2 ("Compute" → "Data Centers" → click on "DC2" → "Attach Data" button → Choose "NFS_SD1"). 9. Import the "VM1" VM to the "NFS_SD1" Storage Domain on Engine 2 ("Storage" → "Storage Domains" → click on "NFS_SD1" → "VM Import" tab → Select "VM1" to import → Press "Import" button). The "VM1" was imported with the correct configuration. 10. Increase the "VM1" memory and CPU to 4 GB and 4 CPU on Engine 2. 11. Put the "NFS_SD1" Storage Domain in maintenance mode on Engine 2 ("Storage" → "Storage Domains" → click on "NFS_SD1" → "Data Center" tab → select the "DC2" Data Center → Press the "Maintenance" button). 12. Detach the Storage Domain from Engine 2 ("Storage" → "Storage Domains" → click on "NFS_SD1" → "Data Center" tab → select the "DC2" Data Center → Press the "Detach" button). 13. Attach the "NFS_SD1" Storage Domain to "DC1" Data Center back to Engine 1 ("Compute" → "Data Centers" → click on "DC1" → "Attach Data" button → Choose "NFS_SD1"). At the end of the process, "DC1" Data Center is up and running. !!! The bug actually happens at this step - "unregistered_ovf_of_entities" DB table still contains wrong XML (contains 2 CPUs and 2 GB memory) !!! 14. Confirm that the OVF_STORE is updated with the new value ("Storage" → "Storage Domains" → select "NFS_SD1" → "..." menu → "Update OVFs"). 15. But both "unregistered_ovf_of_entities" and "vm_ovf_generations" DB tables still contain the old values. !!! "vm_ovf_generations" DB table is OK, but the "unregistered_ovf_of_entities" DB table should have a new XML, you can test that at the old environment it's 2 CPUs and 2048 MB, while at the fixed one 4 CPUs and 4096 MB !!! a. "unregistered_ovf_of_entities" DB table: ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c "select ovf_data from unregistered_ovf_of_entities where entity_guid = 'e397e809-1237-46fa-87de-fb669b1c9ec0';" | cut -c 2- | grep xml | xmllint --format - | egrep -B1 "Memory Size|Number of virtual CPU" <rasd:Caption>2 virtual cpu</rasd:Caption> <rasd:Description>Number of virtual CPU</rasd:Description> -- <rasd:Caption>2048 MB of memory</rasd:Caption> <rasd:Description>Memory Size</rasd:Description> b. "vm_ovf_generations" DB table: ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c "select ovf_data from vm_ovf_generations where vm_guid='e397e809-1237-46fa-87de-fb669b1c9ec0'" | cut -c 2- | grep xml | xmllint --format - | egrep -B1 "Memory Size|Number of virtual CPU" <rasd:Caption>2 virtual cpu</rasd:Caption> <rasd:Description>Number of virtual CPU</rasd:Description> -- <rasd:Caption>2048 MB of memory</rasd:Caption> <rasd:Description>Memory Size</rasd:Description> 16. Import "VM1" to the "NFS_SD1" Storage Domain on Engine 1 ("Storage" → "Storage Domains" → click on "NFS_SD1" → "VM Import" tab → Select "VM1" to import → Press "Import" button). !!! The VM is imported with an old configuration, the problem is a stale data at "unregistered_ovf_of_entities" DB table, see the unlucky step 13 !!! 17. Run "engine-psql.sh" from the CLI on Engine 1 (at the fixed version "mem_size_mb" should be 4096 MB): ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c "select vm_name, vm_guid, mem_size_mb, cpu_per_socket, min_allocated_mem, max_memory_size_mb from vm_static where vm_guid='e397e809-1237-46fa-87de-fb669b1c9ec0';" vm_name | vm_guid | mem_size_mb | cpu_per_socket | min_allocated_mem | max_memory_size_mb ---------+--------------------------------------+-------------+----------------+-------------------+-------------------- VM1 | e397e809-1237-46fa-87de-fb669b1c9ec0 | 2048 | 1 | 2048 | 8192 (1 row) (In reply to Pavel Bar from comment #3) > Steps to Reproduce: > ------------------ > 0. Environment (2 engines): > a. Engine 1 > Data Center "DC1", Cluster, Host, Storage Domain "NFS_SD1", 1 disk. > b. Engine 2 > Data Center "DC2", Cluster, Host. > > Note: at the following steps where VM is mentioned, do *exactly the same* > for VM template (can be tested in parallel, at the same flow). > > 1. Create a "VM1" VM on Engine 1 with 1 GB memory and 1 CPU. Click on the VM > and attach a disk to it. > > 2. Increase VM memory to 2 GB and CPU to 2. > > 3. Put the Storage Domain in maintenance mode ("Storage" → "Storage Domains" > → click on "NFS_SD1" → "Data Center" tab → select the "DC1" Data Center → > Press the "Maintenance" button). > > 4. Run "engine-psql.sh" from the CLI on Engine 1 (use the correct vm_guid > for VM / VM template): > pbar@engine1$ ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c > "select ovf_data from vm_ovf_generations where > vm_guid='e397e809-1237-46fa-87de-fb669b1c9ec0'" | cut -c 2- | grep xml | > xmllint --format - | egrep -B1 "Memory Size|Number of virtual CPU" > <rasd:Caption>2 virtual cpu</rasd:Caption> > <rasd:Description>Number of virtual CPU</rasd:Description> > -- > <rasd:Caption>2048 MB of memory</rasd:Caption> > <rasd:Description>Memory Size</rasd:Description> > > 5. Detach the Storage Domain ("Storage" → "Storage Domains" → click on > "NFS_SD1" → "Data Center" tab → select the "DC1" Data Center → Press the > "Detach" button). > > 6. Run "engine-psql.sh" from the CLI on Engine 1: > ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c "select > vm_guid,ovf_generation from vm_ovf_generations;" > vm_guid | ovf_generation > --------------------------------------+---------------- > e397e809-1237-46fa-87de-fb669b1c9ec0 | 5 > (1 row) > > 7. Import the "NFS_SD1" Storage Domain on Engine 2 ("Storage" → "Storage > Domains" → "Import Domain" button → fill "Name" and "Export Path" the same > as you used when initially adding "NFS_SD1" to Engine 1). > > 8. Attach the "NFS_SD1" Storage Domain to "DC2" Data Center on Engine 2 > ("Compute" → "Data Centers" → click on "DC2" → "Attach Data" button → Choose > "NFS_SD1"). > > 9. Import the "VM1" VM to the "NFS_SD1" Storage Domain on Engine 2 > ("Storage" → "Storage Domains" → click on "NFS_SD1" → "VM Import" tab → > Select "VM1" to import → Press "Import" button). The "VM1" was imported with > the correct configuration. > > 10. Increase the "VM1" memory and CPU to 4 GB and 4 CPU on Engine 2. > > 11. Put the "NFS_SD1" Storage Domain in maintenance mode on Engine 2 > ("Storage" → "Storage Domains" → click on "NFS_SD1" → "Data Center" tab → > select the "DC2" Data Center → Press the "Maintenance" button). > > 12. Detach the Storage Domain from Engine 2 ("Storage" → "Storage Domains" → > click on "NFS_SD1" → "Data Center" tab → select the "DC2" Data Center → > Press the "Detach" button). > > 13. Attach the "NFS_SD1" Storage Domain to "DC1" Data Center back to Engine > 1 ("Compute" → "Data Centers" → click on "DC1" → "Attach Data" button → > Choose "NFS_SD1"). At the end of the process, "DC1" Data Center is up and > running. > !!! The bug actually happens at this step - "unregistered_ovf_of_entities" > DB table still contains wrong XML (contains 2 CPUs and 2 GB memory) !!! > > 14. Confirm that the OVF_STORE is updated with the new value ("Storage" → > "Storage Domains" → select "NFS_SD1" → "..." menu → "Update OVFs"). > > 15. But both "unregistered_ovf_of_entities" and "vm_ovf_generations" DB > tables still contain the old values. > !!! "vm_ovf_generations" DB table is OK, but the > "unregistered_ovf_of_entities" DB table should have a new XML, you can test > that at the old environment it's 2 CPUs and 2048 MB, while at the fixed one > 4 CPUs and 4096 MB !!! > a. "unregistered_ovf_of_entities" DB table: > ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c "select ovf_data > from unregistered_ovf_of_entities where entity_guid = > 'e397e809-1237-46fa-87de-fb669b1c9ec0';" | cut -c 2- | grep xml | xmllint > --format - | egrep -B1 "Memory Size|Number of virtual CPU" > <rasd:Caption>2 virtual cpu</rasd:Caption> > <rasd:Description>Number of virtual CPU</rasd:Description> > -- > <rasd:Caption>2048 MB of memory</rasd:Caption> > <rasd:Description>Memory Size</rasd:Description> > > b. "vm_ovf_generations" DB table: > ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c "select ovf_data > from vm_ovf_generations where > vm_guid='e397e809-1237-46fa-87de-fb669b1c9ec0'" | cut -c 2- | grep xml | > xmllint --format - | egrep -B1 "Memory Size|Number of virtual CPU" > <rasd:Caption>2 virtual cpu</rasd:Caption> > <rasd:Description>Number of virtual CPU</rasd:Description> > -- > <rasd:Caption>2048 MB of memory</rasd:Caption> > <rasd:Description>Memory Size</rasd:Description> > > 16. Import "VM1" to the "NFS_SD1" Storage Domain on Engine 1 ("Storage" → > "Storage Domains" → click on "NFS_SD1" → "VM Import" tab → Select "VM1" to > import → Press "Import" button). > !!! The VM is imported with an old configuration, the problem is a stale > data at "unregistered_ovf_of_entities" DB table, see the unlucky step 13 !!! > > 17. Run "engine-psql.sh" from the CLI on Engine 1 (at the fixed version > "mem_size_mb" should be 4096 MB): > ~/dev/deploy/share/ovirt-engine/dbscripts/engine-psql.sh -c "select vm_name, > vm_guid, mem_size_mb, cpu_per_socket, min_allocated_mem, max_memory_size_mb > from vm_static where vm_guid='e397e809-1237-46fa-87de-fb669b1c9ec0';" > > vm_name | vm_guid | mem_size_mb | > cpu_per_socket | min_allocated_mem | max_memory_size_mb > ---------+--------------------------------------+-------------+-------------- > --+-------------------+-------------------- > VM1 | e397e809-1237-46fa-87de-fb669b1c9ec0 | 2048 | > 1 | 2048 | 8192 > (1 row) Reproduced on ovirt-engine-4.4.6.3-0.8.el8ev.noarch Verified with the above steps on ovirt-engine-4.4.6.5-447.gd80dda7.9.el8ev.noarch. Moving to 'Verified' Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: RHV Manager security update (ovirt-engine) [ovirt-4.4.6]), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:2179 Due to QE capacity, we are not going to cover this issue in our automation |