Jump to: navigation, search

Difference between revisions of "VMPowerOnOff"

 
m (Text replace - "__NOTOC__" to "")
 
Line 1: Line 1:
__NOTOC__
+
 
 
* '''Launchpad Entry''': https://blueprints.launchpad.net/nova/+spec/power-on-off-vm
 
* '''Launchpad Entry''': https://blueprints.launchpad.net/nova/+spec/power-on-off-vm
 
* '''Created''': 23 Aug 2012
 
* '''Created''': 23 Aug 2012

Latest revision as of 23:30, 17 February 2013

Summary

Add the ability in Nova to:

  1. power off a VM without destroying the instance
  2. power on a powered-off VM on an availability_zone of choice

Release Note

Added following features:

  1. Power off a VM without destroying the instance
  2. Power on a VM powered off earlier with the same settings some time later on an availability_zone of choice
  3. Added a new power_state POWER_OFF for the purpose

Rationale

It is not possible to power off a VM and power on later with the same network settings.

User stories

User wants to use an existing VM later with the current settings.

Design

  1. The VmPowerOnOffController will have extensions to:
    1. power off a VM
    2. power on the VM on a give availability_zone

Implementation

Code Changes

Add VmPowerOnOffController to support the following API:

1. Power off VM:

    URI: v2/<tenant_id>/servers/<server_id>/action
    Request Body: JSON
            {
                "vm-poweroff": {}
             }

    Normal Response Code: 202
    Error Response Code(s): Bad Request (400), Not Found(404)
    
    Response: JSON
            {
                <To be Added>
            }

    Response: XML
            <?xml version="1.0" encoding="UTF-8"?>
                <To be Added>


2. Power on VM:

    URI: v2/<tenant_id>/servers/<server_id>/action
    Request body: JSON
        {
            "vm-poweron": {
                "availability_zone": <availability_zone>
            }
        }

    Request body: XML
        <?xml version="1.0" encoding="UTF-8"?>
                    <To be Added>

    Normal Response Code: 202
    Error Response Code(s): Bad Request (400), Not Found(404)
    
    Response: JSON
        {
                <To be Added>
        }

    Response: XML
        <?xml version="1.0" encoding="UTF-8"?>

                <To be Added>


Possible exceptions required to be handled:

  1. VM is not in POWER_OFF state.
  2. VM does not exist.
  3. Insufficient permissions: The API should return a 'Bad Request (400)' response with an appropriate error message.

Migration

No database or core API changes.

Test/Demo Plan

Tests being added

BoF agenda and discussion