370 - vm_clone produces VMs that are silently fragile to multi-disk attach#371
Open
domendobnikar wants to merge 3 commits into
Conversation
6dbb575 to
689fee5
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to address Issue-370 where VMs created via vm_clone can become fragile when additional disks are attached, by ensuring a boot device order is set after cloning. It also introduces a helper for identifying a “primary” disk and modifies the module’s cloud-init defaults.
Changes:
- After a successful clone, fetch the cloned VM and attempt to set its boot device order.
- Add
VM.get_primary_disk()helper to select a primary disk. - Set a default
cloud_init.user_dataforvm_clone.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| plugins/modules/vm_clone.py | Adds post-clone boot order setting logic; changes cloud-init argument defaults. |
| plugins/module_utils/vm.py | Fixes a disk comment typo and adds a helper to select a “primary” disk. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
acc3fdc to
67eda0b
Compare
26cb659 to
06d8f76
Compare
- cloud init's user data not has a default value
- boot devices by default set as the primary Virtio disk
34a4622 to
fff6ef4
Compare
Collaborator
Author
2d57110 to
f2fa4b5
Compare
e4dcabc to
6f42ae3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Boot order is now set after cloning to avoid issues when attaching additional disk to VM afterwards.
Cloud init's user datadefaultruncmdis also added ifcloud inithas been passed as parameter.