Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: API

VM_IMPORT_FAILED

 

 

Xen api RSS feed   Index | Next | Previous | View Threaded


ka at eta

Jan 23, 2012, 8:49 AM

Post #1 of 3 (350 views)
Permalink
VM_IMPORT_FAILED

Hello.

I use ZFS-based NFS storage for xen.

I am trying to get safe backup throuhg Xen API with following algorithm:
Before create ZFS snapshot I create XEN VM snapshot, export VM metadata
and do ZFS snapshot.

After this I delete snapshot and its VDI.

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).

xensource.log attached.

Any idea?

--
Many thanks in advance.
Attachments: vm_revert.log (27.2 KB)


ka at eta

Jan 23, 2012, 9:38 AM

Post #2 of 3 (331 views)
Permalink
Re: VM_IMPORT_FAILED addition [In reply to]

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?

>
>
>
> _______________________________________________
> xen-api mailing list
> xen-api [at] lists
> http://lists.xensource.com/mailman/listinfo/xen-api


ka at eta

Jan 23, 2012, 11:50 AM

Post #3 of 3 (328 views)
Permalink
Re: VM_IMPORT_FAILED addition [In reply to]

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 :)

Xen api RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.