API don't allow some operations but Sunstone yes

Hello,
we use XML API for some operations with the cluster (6.4.0). I noticed that two operations are allowed in Sunstone, but with XML API not.

  • [one.vm.recover] Cannot delete-recreate a powered off VM. Resume it first - I can to it via Sunstone
  • [one.vm.attachnic] Could not add a new NIC to VM 2723, wrong state SHUTDOWN.

Do you have any solutions for that problem? I need to perform the above operations via API. Why it’s not allowed via API but via Sunstone yes?

Best Regards,
Rafał Dziwiński

Sunstone issues XMLRPC API Calls under the hood. You can’t be able to issue calls with Sunstone and not directly. The errors you are getting are related to unexpected VM states when issuing those calls. You’d get those regardless of Sunstone, CLI or API directly.

The VM in POWEROFF means it reached an end state and is no longer transitioning. You use the delete-recreate option for VMs stuck in transient states, like SHUTDOWN.

In this case the VM is on SHUTDOWN and needs to reach POWEROFF before being able to have NICs attached

Thank’s for your answer. We will check it again.