Create VM snapshot through NOVA API

Asked by Valeriy Belavin

I didn't find this opportunity, so far, so I ask. Is it planned to make instance snapshoting available through NOVA API?

At the moment we use OpenStack as a testing platform in a software development company, sometimes it is convenient to make a snapshot of running instance, prior to testing. We do it through 'virsh snapshot-create', but it isn't convenient, because one need to perform the following actions:

1) euca-describe-instances | grep VM_IP_ADDRESS -> to get EC2 instance ID
2) sudo virsh list -> to get libvirt instance ID
3) sudo virsh snapshot-create ...

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Lorin Hochstein (lorinh) said :
#1

In diablo, you can do this with create_image, which is how Horizon creates snapshots. With the python novaclient code, it looks like:

client.servers.create_image(instance_id, name)

where "name" is an arbitrary name you give the snapshot

Using the nova command-line client, it would be:

nova image-create [instance-id] [name]

Revision history for this message
Lorin Hochstein (lorinh) said :
#2
Revision history for this message
Valeriy Belavin (vvbelavin) said :
#3

Yes, I know. But this creates a new image, based on the running instance. I was talking about snapshoting instance. With 'virt snapshot-create' I can do several snapshots of the running instance and revert instance to the previous state with 'virsh snapshot-revert'.

Revision history for this message
Lorin Hochstein (lorinh) said :
#4

I believe the image-create command also creates a snapshot as a side-effect of creating a new image.

Can you help with this problem?

Provide an answer of your own, or ask Valeriy Belavin for more information if necessary.

To post a message you must log in.