Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow performing a linked-clone from a template without requiring snapshots #1158

Merged
merged 4 commits into from
Aug 14, 2020

Conversation

arizvisa
Copy link
Contributor

@arizvisa arizvisa commented Aug 6, 2020

Description

This PR allows performing a linked clone from a template by using the "moveAllDiskBackingAndAllowSharing" option. When performing a clone, the source virtual machine is checked if it's marked as a template. If so, then it sets the option and proceeds with the clone. If it is not marked as a template, then it will proceed with the original logic which validates that a snapshot exists.

The documentation was updated to remove reference to the snapshot constraint.

Acceptance tests

There were no tests for the cloning functionality, and so I wasn't sure how to proceed here.

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch? (If so, please include the test log in a gist)

References

This closes issue #1156.

… if its a template to ignore the snapshot requirements.
… the snapshot limitation when cloning a template.
…checked for snapshots regardless of the machine being a template.
@ghost ghost added size/s Relative Sizing: Small documentation Type: Documentation labels Aug 7, 2020
@arizvisa
Copy link
Contributor Author

arizvisa commented Aug 7, 2020

Added another commit to handle a case in ValidateVirtualMachineClone where I wasn't validating the machine being a template before it called validateCloneSnapshots. This wasn't caught before because I was initially using commit 7e3c4f38186fd7a4299658def6d9d9ac9dde0d8an (first one in my PR) in which I patched a way to break out of validateCloneSnapshots upon identification of the template flag.

Now, instead of tampering with the logic of validateCloneSnapshots, machines are checked for the template marking before it actually being called. This might help with the implementation of the solution to issue #831 where this function can instead be rewritten to validate a particular snapshot identifier and use that one.

Copy link
Contributor

@bill-rich bill-rich left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this case. I'm going to be adding more power state management for VMs in the near future, so templates managed by the provider will become more useful shortly. This is a really good step toward that.

@bill-rich bill-rich merged commit 99aae4e into hashicorp:master Aug 14, 2020
@ghost
Copy link

ghost commented Sep 14, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Type: Documentation size/s Relative Sizing: Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants