Bug #322

XML-RPC API machine state

Added by Alexandre Joseph almost 11 years ago. Updated over 9 years ago.

Status:ClosedStart date:08/23/2010
Priority:NormalDue date:
Assignee:Javi Fontan% Done:

0%

Category:Client API & Library
Target version:-
Resolution:fixed Pull request:
Affected Versions:OpenNebula 2.2

Description

When using OpenNebula XML-RPC API to retrieve informations on a VM a number is returned corresponding to
a state of the machine.
The matching between numbers and human readable states (running, boot, etc...) don't seems to be described in the documentation of the API for the moment.

History

#1 Updated by Javi Fontan almost 11 years ago

  • Assignee changed from Tino Vázquez to Javi Fontan

Virtual machines have two states "STATE" and "LCM_STATE". Here is what the values for this states mean:

    /**
     *  Global Virtual Machine state
     */
    enum VmState
    {
        INIT      = 0,
        PENDING   = 1,
        HOLD      = 2,
        ACTIVE    = 3,
        STOPPED   = 4,
        SUSPENDED = 5,
        DONE      = 6,
        FAILED    = 7
    };

    /**
     *  Virtual Machine state associated to the Life-cycle Manager
     */
    enum LcmState
    {
        LCM_INIT       = 0,
        PROLOG         = 1,
        BOOT           = 2,
        RUNNING        = 3,
        MIGRATE        = 4,
        SAVE_STOP      = 5,
        SAVE_SUSPEND   = 6,
        SAVE_MIGRATE   = 7,
        PROLOG_MIGRATE = 8,
        PROLOG_RESUME  = 9,
        EPILOG_STOP    = 10,
        EPILOG         = 11,
        SHUTDOWN       = 12,
        CANCEL         = 13,
        FAILURE        = 14,
        DELETE         = 15,
        UNKNOWN        = 16
    };

Basically you have to check the state, if it is 3 (ACTIVE) then you have to check the LCM_STATE for the substate inside ACTIVE, that way you can will know if it is running, migrating, etc.

I will leave this ticket open until we add this information to the documentation.

#2 Updated by Ruben S. Montero over 9 years ago

  • Status changed from New to Closed
  • Resolution set to fixed
  • Affected Versions OpenNebula 2.2 added

Now in the docs...

Also available in: Atom PDF