Provision openstack vm from a button

#1

Hi,

I am trying to revert an openstack snapshot by getting the image id of the snapshot and then create a new vm in the same service from that image id. I can get the image id but i do not know how to try the create vm from the button. Any guidance on how to do this even just deploying from a button in general would be greatly appreciated.

#2

Although I have no idea, why you would want to deploy a VM from a snapshot, instead of cloning the VM and revert to the snapshot on the clone

You can start a provision Request from anywhere in automate using $evm.execute(:create_provision_request, ...)
https://pemcg.gitbooks.io/mastering-automation-in-cloudforms-4-2-and-manage/content/evm_and_the_workspace/chapter.html

#3

@buc Thanks for the reply. I am new to manage IQ and am still trying to figure things out. If there is a better/proven method to revert an openstack snapshot i would definitely use it. Can you point me to the documentation or outline the process of how to revert the snapshot to the clone?

#4

You should be able to get a list im Snapshots from the VM object with vm.snapshots and do a snap.revert_to
http://manageiq.org/docs/reference/latest/doc-Methods_Available_for_Automation/miq/#snapshot-snapshot

I haven’t actually tested it though