Configuring and managing live VMware snapshot

VMware live snapshot preserves the state and data of a virtual machine at a specific point in time. It includes a virtual machine’s power state and the data includes all of the files that make up the virtual machine.

You can use live snapshot to easily restore a virtual machine to that specific point. For more information, see Understanding virtual machine snapshots in VMware ESXi and ESX.The VMware driver of IBM® Cloud Manager with OpenStack extends the Nova APIs to manage VMware live snapshot, including create, list, delete, and restore. The formats for the APIs are as follows:

Creating snapshots for an instance

Example

POST /v2/​{tenant_id}​/servers/​{server_id}​/action

JSON request:

{
    "os-createServerSnapshot":
    {
        "snapshot_name": "test_delete_snapshot2-45",
        "description": "test_delete_snapshot2",
        "metadata": { "memory": false, "quiesce": false }
    }
}

JSON response:
{
    "server_snapshot":
    {
        "server_id": server_id,
        "snapshot_name": snapshot_name,
        "snapshot_id": snapshot_id,
        "create_time": create_time,
        "description": description,
        "is_current_snapshot": True
        "metadata":
        {
            "vm_state": vm_state,
            "quiesced"': quiesced,
            "replaySupported", replaySupported
        }
    }
}

Listing snapshots for a server

Example

POST /v2/​{tenant_id}​/servers/​{server_id}​/action

JSON request:

{
    "os-listServerSnapshot": { }
}

JSON response:

{
    "server_snapshots":
    [
        {
            "instance_uuid": instance_id,
            "name": snapshot_name,
            "snapshot_id": snapshot_id,
            "create_time": create_time,
            "description": description,
            "is_current_snapshot": True
            "metadata":
            {
                "vm_state": vm_state,
                "quiesced"': quiesced,
                "replaySupported": replaySupported
            },
            "server_snapshots": []
      },
      {
          "instance_uuid": instance_id,
          "name": snapshot_name,
          "snapshot_id": snapshot_id,
          "create_time": create_time,
          "description": description,
          "is_current_snapshot": True
          "metadata": {
               "vm_state": vm_state,
               "quiesced"': quiesced,
                "replaySupported": replaySupported
          },
          "server_snapshots": []
       }
       ]
}

Deleting a snapshot for a server

Example

POST /v2/​{tenant_id}​/servers/​{server_id}​/action

JSON request body

{
    "os-deleteServerSnapshot":
        {
            "snapshot_id": "3"
        }
}

Restoring a snapshot for a server

Example

POST /v2/​{tenant_id}​/servers/​{server_id}​/action

JSON request body:

{ 
    "os-restoreServerSnapshot":
    { "snapshot_id": "1" }
}