
ka at eta
Jan 23, 2012, 11:50 AM
Post #3 of 3
(246 views)
Permalink
|
23.01.2012 21:38, ka ?????: > 23.01.2012 20:49, ka ?????: >> But when I try to revert VM, I have strange behavior of VM.revert >> operation. >> >> I rollback my ZFS storage, unregister VM, import VM metadata, rescan >> SR and try to call VM.revert function. Its return VM_REVERT_FAILED >> message. >> >> *The strangeness of the fact that when I ignore VM_REVERT_FAILED >> exception and try to repeat VM.revert call - it works fine.* >> I mean that second call of VM.revert works without error (There is no >> pause between them). >> > I looked at sources: > https://github.com/xen-org/xen-api/blob/master/ocaml/xapi/xapi_vm_snapshot.ml > It's look like line 420 update_vifs_and_vbds ~__context ~snapshot ~vm; > through error. > I look at the let update_vifs_and_vbds (281). > Seems, it line 295 through exception List.iter (safe_destroy_vbd > ~__context ~rpc ~session_id) vm_VBDs; > > I try to make this call from my script (I mean destroy API function > call for all VM's VBDs) and got same error as in log: > > VBD 'd92b50bf-16b4-de2f-b8c8-454157f51904' still attached to > '29f39b05-72b5-9512-3207-5c400aec4bcf' > OPERATION_NOT_ALLOWED > > The only line executed after this exception is 430: > Xapi_vm_lifecycle.force_state_reset ~__context ~self:vm ~value:`Halted; > I check imported VM status. It is 'halted' and I cannot to call > VM.hard_shutdown. > Can I invoke Xapi_vm_lifecycle.force_state_reset as in 430 throuhg API? > Resolved. Seems, This is because I take snapshot and export metadata of VM in Running state. As I expected, reset of power_state is needed. I added VM.power_state_reset call after import_metadata. All ok now. Thanks to all :)
|