Cannot import VM. Selected display type is not supported by the operating system.

Solution Verified - Updated -

Environment

  • Red Hat Virtualization (RHV-M) 4.3

Issue

  • Unable to import a VM from the imported storage domain.
    Error reported when trying to import of the test1 VM.
Operation Canceled
Error while executing action:

test1:

    Cannot import VM. Selected display type is not supported by the operating system.

Resolution

  • The DefaultDisplayType in the VM ovf_store will need to be corrected.

1. From the engine database, identify the storage domain ovf_disk_id information.

# /usr/share/ovirt-engine/dbscripts/engine-psql.sh -c "SELECT sd.storage_name, ovf.ovf_disk_id FROM storage_domains_ovf_info AS ovf inner JOIN storage_domains AS sd ON sd.id = ovf.storage_domain_id WHERE storage_name = 'old_sd_from_4.2';"

    storage_name     |             ovf_disk_id              
---------------------+--------------------------------------
 old_sd_from_4.2     | ca89dfbd-dc00-4aaf-8051-70ee2c3ba196
 old_sd_from_4.2     | f4ff9ed4-9163-4b48-a3e4-8520a4fa0c96
(2 rows)

2. From the SPM host, find the disk LVM volume information.

# lvm lvs -o +tags |egrep "ca89dfbd-dc00-4aaf-8051-70ee2c3ba196|f4ff9ed4-9163-4b48-a3e4-8520a4fa0c96"

  06159027-01b6-48c4-a9ee-6773df4f4a7a 132dd116-7554-4590-b753-a0a5ecd269b2 -wi------- 128.00m    IU_f4ff9ed4-9163-4b48-a3e4-8520a4fa0c96,MD_5,PU_00000000-0000-0000-0000-000000000000 
  3697bda5-ce9a-414c-a36d-9359c2385c16 132dd116-7554-4590-b753-a0a5ecd269b2 -wi------- 128.00m    IU_ca89dfbd-dc00-4aaf-8051-70ee2c3ba196,MD_6,PU_00000000-0000-0000-0000-000000000000 

3. On the SPM host, create a working directory and change to the directory.

# mkdir /tmp/ovf_temp
# cd /tmp/ovf_temp

4. Capture and extract the ovf_store from the two disks.

# lvchange -a y /dev/132dd116-7554-4590-b753-a0a5ecd269b2/06159027-01b6-48c4-a9ee-6773df4f4a7a
# lvchange -a y /dev/132dd116-7554-4590-b753-a0a5ecd269b2/3697bda5-ce9a-414c-a36d-9359c2385c16

# dd if=/dev/132dd116-7554-4590-b753-a0a5ecd269b2/06159027-01b6-48c4-a9ee-6773df4f4a7a bs=1M count=128 of=/tmp/ovf_temp/06159027_ovf
# dd if=/dev/132dd116-7554-4590-b753-a0a5ecd269b2/3697bda5-ce9a-414c-a36d-9359c2385c16 bs=1M count=128 of=/tmp/ovf_temp/3697bda5_ovf

# mkdir /tmp/ovf_temp/06159027
# mkdir /tmp/ovf_temp/3697bda5

# tar -xvf /tmp/ovf_temp/06159027_ovf -C /tmp/ovf_temp/06159027
# tar -xvf /tmp/ovf_temp/3697bda5_ovf -C /tmp/ovf_temp/3697bda5

5. Both disks has the ovf_store having DefaultDisplayType is 0.

# ls -ltr /tmp/ovf_temp/06159027
-rw-r--r--. 1 root root    72 Sep  4 13:45 metadata.json
-rw-r--r--. 1 root root   138 Sep  4 13:45 info.json
-rw-r--r--. 1 root root  6955 Sep  4 13:45 e676c763-aa02-47db-8530-66ed3ca571de.ovf

# ls -ltr /tmp/ovf_temp/3697bda5

-rw-r--r--. 1 root root   138 Sep  4 13:45 info.json
-rw-r--r--. 1 root root    72 Sep  4 13:45 metadata.json
-rw-r--r--. 1 root root  6955 Sep  4 13:45 e676c763-aa02-47db-8530-66ed3ca571de.ovf

# sed 's/></\n/g' /tmp/ovf_temp/06159027/e676c763-aa02-47db-8530-66ed3ca571de.ovf |grep Display
DefaultDisplayType>0</DefaultDisplayType 

# sed 's/></\n/g' /tmp/ovf_temp/3697bda5/e676c763-aa02-47db-8530-66ed3ca571de.ovf |grep Display
DefaultDisplayType>0</DefaultDisplayType

6. Change the DefaultDisplayType to 1 in one of the ovf file.

# sed -i 's|<DefaultDisplayType>0</DefaultDisplayType>|<DefaultDisplayType>1</DefaultDisplayType>|' /tmp/ovf_temp/06159027/e676c763-aa02-47db-8530-66ed3ca571de.ovf

7. Verify the setting.

# sed 's/></\n/g' /tmp/ovf_temp/06159027/e676c763-aa02-47db-8530-66ed3ca571de.ovf |grep Display
DefaultDisplayType>1</DefaultDisplayType

8. Create a new tar archieve.

# cd /tmp/ovf_temp/06159027
# tar -cvf new_ovf.tar *.ovf info.json 

9. Write it back to the each of disks.

dd if=new_ovf.tar of=/dev/132dd116-7554-4590-b753-a0a5ecd269b2/06159027-01b6-48c4-a9ee-6773df4f4a7a bs=1M

dd if=new_ovf.tar of=/dev/132dd116-7554-4590-b753-a0a5ecd269b2/3697bda5-ce9a-414c-a36d-9359c2385c16 bs=1M

10. Put the old_sd_from_4.2 storage domain into Maintenace

11. De-attach and Attach the storage domain.

12. After the storage domain is active, import the VM back.

Root Cause

  • Cirrus graphics support was removed from RHV-M 4.3 per BZ 1656007.

Diagnostic Steps

  • Failure reported in the /var/log/ovirt-engine/engine.log file.
    The VM ID is e676c763-aa02-47db-8530-66ed3ca571de
2020-09-07 13:18:53,600-07 INFO  [org.ovirt.engine.core.bll.exportimport.ImportVmFromConfigurationCommand] (default task-67) [716ba417-c2a8-4ce8-818b-8478287be9d3] Lock Acquired to object 'EngineLock:{exclusiveLocks='[test1=VM_NAME, e676c763-aa02-47db-8530-66ed3ca571de=VM]', sharedLocks='[e676c763-aa02-47db-8530-66ed3ca571de=REMOTE_VM]'}'

2020-09-07 13:18:53,630-07 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (default task-67) [716ba417-c2a8-4ce8-818b-8478287be9d3] START, GetImageInfoVDSCommand( GetImageInfoVDSCommandParameters:{storagePoolId='5a85dd39-0046-03e0-0383-000000000324', ignoreFailoverLimit='false', storageDomainId='132dd116-7554-4590-b753-a0a5ecd269b2', imageGroupId='6402cc48-e8e1-4ab0-bde5-eaa41171f7de', imageId='73b766b9-8590-4e6f-afae-0b7132e2630d'}), log id: 66ed8b0a

2020-09-07 13:18:53,631-07 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVolumeInfoVDSCommand] (default task-67) [716ba417-c2a8-4ce8-818b-8478287be9d3] START, GetVolumeInfoVDSCommand(HostName = rhevh.example.com, GetVolumeInfoVDSCommandParameters:{hostId='878c17db-b9b3-4bb7-8569-f6249159e74d', storagePoolId='5a85dd39-0046-03e0-0383-000000000324', storageDomainId='132dd116-7554-4590-b753-a0a5ecd269b2', imageGroupId='6402cc48-e8e1-4ab0-bde5-eaa41171f7de', imageId='73b766b9-8590-4e6f-afae-0b7132e2630d'}), log id: 3daeffe0

2020-09-07 13:18:53,863-07 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVolumeInfoVDSCommand] (default task-67) [716ba417-c2a8-4ce8-818b-8478287be9d3] FINISH, GetVolumeInfoVDSCommand, return: org.ovirt.engine.core.common.businessentities.storage.DiskImage@1cf49dd, log id: 3daeffe0

2020-09-07 13:18:53,863-07 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (default task-67) [716ba417-c2a8-4ce8-818b-8478287be9d3] FINISH, GetImageInfoVDSCommand, return: org.ovirt.engine.core.common.businessentities.storage.DiskImage@1cf49dd, log id: 66ed8b0a

2020-09-07 13:18:53,905-07 WARN  [org.ovirt.engine.core.bll.exportimport.ImportVmFromConfigurationCommand] (default task-67) [] Validation of action 'ImportVmFromConfiguration' failed for user admin@internal-authz. Reasons: VAR__ACTION__IMPORT,VAR__TYPE__VM,ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments