Ask Your Question
0

How do I filter VM snapshots list in Glance

asked 2018-09-14 09:35:45 -0500

raj4cloud gravatar image

I want to list all image snapshots ( NOT VOLUME SNAPSHOTS ) of my VM. the Images/Glance V2 API does not seem to show a way to distinguish an IMAGE vs SNAPSHOT of another VM. So, I create snapshot, and i want to use the snapshot to rebuild the VM, how do i list all my snapshots for a given VM using API?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-09-19 02:58:21 -0500

eblock gravatar image

There is a distinction between image and snapshot, you should experience this in Horizon, switching from "Image" to "Snapshot" in the "Launch Instance" dialog shows different choices.

If you like the CLI, you can see the "image_type = snapshot" in the properties if you run openstack image show <IMAGE>. That's also how you can filter your output to only list snapshots:

control:~ # openstack image list --property image_type=snapshot

Other options are to name your snapshots so that you recognize them as a snapshot from a specific VM. And there's also a "Tags" field you could use for destinction:

control:~ # openstack image set --tag snapshot-of-VM1 <IMAGE>
control:~ # openstack image list --long -c ID -c Name -c Tags --sort tags:desc
+--------------------------------------+-------------------+-----------------+
| ID                                   | Name              | Tags            |
+--------------------------------------+-------------------+-----------------+
| eac5d615-73a4-4002-9faf-38d068bc56e5 | Image1            | snapshot-of-VM1 |
| dce2fbc6-54e9-4814-8e09-35a8084560af | Image2            |                 |
[...]

Hope this helps!

edit flag offensive delete link more

Comments

eblock gravatar imageeblock ( 2018-09-19 02:59:17 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-09-14 09:35:45 -0500

Seen: 17 times

Last updated: Sep 19