Description of problem: Customer upgrading from RHEV 3.6 to RHV 4.1 using FC storage. 1. detached storage domain from RHEV 3.6 configuration 2. imported storage domain to RHV 4.1 configuration and activated the domain 3. imported the virtual machines 37 out of 40 virtual machines imported properly 3 VMs failed to import with an Operation Canceled dialog that reads as follows ----------------- Error while executing action: <vm name>: . Cannot import VM. Storage Domain doesn't exist. ----------------- There appears to be literally nothing in the logs that informs about why the import failed. Version-Release number of selected component (if applicable): Red Hat Virtualization Manager Version: 4.1.6.2-0.1.el7 How reproducible: Unknown Steps to Reproduce: 1. 2. 3. Actual results: 3 of 40 VMs failed to import from the imported storage domain. Expected results: All VMs should import from the imported storage domain. Additional info:
What about the logs?
The customer has a system we can test with, win10test. Would anyone be able to provide the exact process for using the API for him to be able to perform the import in this way so that I can pass that along to him? For reference this is what was provided previously as an example: ~~~ POST /api/storagedomains/xxxxxxx-xxxx-xxxx-xxxxxx/vms/xxxxxxx-xxxx-xxxx-xxxxxx/register HTTP/1.1 Accept: application/xml Content-type: application/xml <action> <cluster id='bf5a9e9e-5b52-4b0d-aeba-4ee4493f1072'></cluster> <allow_partial_import>true</allow_partial_import> </action> That way, the user does not have to mess with the VM's OVF. ~~~
Customer attempted to use the script. Initially he got errors but found that he'd missed some line breaks in the script. After fixing this he mentioned the following: ~~~ The script is now running, but it doesn’t appear to be doing anything, and there is no output after it runs. Here is the curl that is sent curl --insecure --request POST --header "Accept: application/xml" --header "Content-Type: application/xml" --user "admin@intern:<password redacted>" --data "<action><cluster id=59efc2c5-028c-02f1-0195-000000000152></cluster><allow_partial_import>true</allow_partial_import></action>" localhost/ovirt-engine/api/storagedomains/5028de3a-605f-4f0f-9da2-0e76907a4449/vms/83c81a57-539f-4a6b-af49-4e1647abd4f1/register ~~~ followed by ~~~ Just to be sure the script was working, I did a straight curl from the command line. curl --insecure --request POST --header "Accept: application/xml" --header "Content-Type: application/xml" --user "admin@internal:REDACTED" --data "<action><cluster id=59efc2c5-028c-02f1-0195-000000000152></cluster><allow_partial_import>true</allow_partial_import></action>" 127.0.0.1/ovirt-engine/api/storagedomains/5028de3a-605f-4f0f-9da2-0e76907a4449/vms/83c81a57-539f-4a6b-af49-4e1647abd4f1/register There was no error, no output, and the VM was not imported. ~~~ Should the user be "admin" or the full "admin@internal"? And if admin@internal is correct then what might be the issue here?
A python script that was able to resolve the issues with importing VMs: ~~~ #!/usr/bin/python import ovirtsdk4 as sdk import ovirtsdk4.types as types def register_vm(vm): vm_service = vms_service.vm_service(vm.id) vm_service.register( cluster=types.Cluster( id='59efc2c5-028c-02f1-0195-000000000152', ), reassign_bad_macs=True, allow_partial_import=True ) connection = sdk.Connection( url='https://FQDN/ovirt-engine/api', username='admin@internal', password='REDACTED', insecure=True, ) storage_domains_service = connection.system_service().storage_domains_service() storage_domain_service = storage_domains_service.storage_domain_service('5028de3a-605f-4f0f-9da2-0e76907a4449') vms_service = storage_domain_service.vms_service() for vm in vms_service.list(unregistered=True): print vm.name register_vm(vm) # Close the connection to the server: connection.close() ~~~ The customer impact is over as the VMs have now been imported, however I'll leave the bug open for the sake of dealing with the OVF impact. Thanks all for the support this weekend!
I just reproduced this whole issue for RCA but I'm confused about what is going to be tracked on this specific BZ. I guess (sorry if I'm wrong) this current BZ is going to track adding allow_partial_import to the GUI, so I opened this other BZ here[1] to track the issue of the snapshot memory volumes not being moved to a target SD when the VMs disks were moved, couldn't find any other BZ along those lines. Feel free to close as dup in case this is going to be handled here, I'm just confused on what this BZ is for, sorry. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1509807
(In reply to Germano Veit Michel from comment #25) > I just reproduced this whole issue for RCA but I'm confused about what is > going to be tracked on this specific BZ. > > I guess (sorry if I'm wrong) this current BZ is going to track adding > allow_partial_import to the GUI Yaniv, I noticed you mentioned the GUI part of allow_partial_import in https://bugzilla.redhat.com/1380365#c11 Should we change this bug to an RFE? Which version should we target it?
Done. Germano, please document a KB with your script.
(In reply to Yaniv Lavi from comment #27) > Done. > Germano, please document a KB with your script. Done.
Eyal, is this covered by you recent work?
No, I added the functionality of partial_import in case there are disks that were attached to an unregistered VM and registered to the environment separately from the VM / template. No UI work was done in this patch.
Created attachment 1398565 [details] partial import screenshot
Verified with the following code: ------------------------------------------ ovirt-engine-4.2.2.2-0.1.el7.noarch vdsm-4.20.20-1.el7ev.x86_64 Verified with the following scenario: ------------------------------------------ 1. Create a VM with disks on storage domain A and storage domain B. 2. Deactivate and detach storage domain A. 5. Remove the VM from step 1 that remains in the data center (have only one disk on storage domain B) 3. Attach storage domain A back to the data center. 4. Try to register the VM from step 1 (have only one disk on storage domain A) - will fail 5. Try to register the VM from step 1 and mark the 'partial import' checkbox (have only one disk on storage domain A) - will succeed 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, 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/RHEA-2018:1488
BZ<2>Jira Resync