Skip to content

Conversation

@anazobec
Copy link
Collaborator

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.

@anazobec anazobec requested a review from justinc1 May 15, 2023 13:10
@anazobec anazobec self-assigned this May 15, 2023
Copy link
Collaborator

@justinc1 justinc1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just comments

Copy link
Collaborator

@justinc1 justinc1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x

justinc1 added 7 commits May 16, 2023 14:05
…k bus

Otherwise disk is attached, but VM is not bootable.

Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
The destination VM does not need snapshots.

Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
But having those VMs in running state is a good idea.
It makes things harder.

Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
Copy link
Collaborator

@justinc1 justinc1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty

@justinc1 justinc1 merged commit 03bc1aa into main May 16, 2023
@justinc1 justinc1 deleted the add-vm-shutdown-to-vm-snapshot-attach-disk branch May 16, 2023 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants