ScaleComputing / HyperCoreAnsibleCollection

Official Ansible collection for Scale Computing SC//HyperCore (HC3) v1 API
GNU General Public License v3.0
12 stars 8 forks source link

Add shutdown destination VM functionallity before attaching a disk from a source snapshot. #233

Closed anazobec closed 1 year ago

anazobec commented 1 year ago

This PR makes sure that the VM we are trying to attach a snapshot disk to shuts down before attaching; tasks fail if we are trying to attach to a running VM.

How it works (steps):

  1. if the destination VM is running, shut it down (first normally, and if that fails, then forcibly) - this step is skipped if the VM is already shut down.
  2. attach the desired snapshot disk
  3. restart the destination VM.