Bug #322

XML-RPC API machine state

Added by Alexandre Joseph over 1 year ago. Updated about 1 month ago.

Status:Closed Start date:08/23/2010
Priority:Normal Due date:
Assignee:Javi Fontan % Done:

0%

Category:Client API & Library
Target version:-
Resolution:fixed Affected Version:OpenNebula 2.2
Story points-
Velocity based estimate-

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

Updated by Javi Fontan over 1 year 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.

Updated by Ruben S. Montero about 1 month ago

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

Now in the docs...

Also available in: Atom PDF