Skip to content

370 - vm_clone produces VMs that are silently fragile to multi-disk attach#371

Open
domendobnikar wants to merge 3 commits into
mainfrom
370-vm_clone-produces-vms-that-are-silently-fragile-to-multi-disk-attach-reboot-no-bootdevices-vda-anchored-grub
Open

370 - vm_clone produces VMs that are silently fragile to multi-disk attach#371
domendobnikar wants to merge 3 commits into
mainfrom
370-vm_clone-produces-vms-that-are-silently-fragile-to-multi-disk-attach-reboot-no-bootdevices-vda-anchored-grub

Conversation

@domendobnikar

@domendobnikar domendobnikar commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Boot order is now set after cloning to avoid issues when attaching additional disk to VM afterwards.
Cloud init's user data default runcmd is also added if cloud init has been passed as parameter.

@domendobnikar domendobnikar self-assigned this Jun 3, 2026
@domendobnikar domendobnikar force-pushed the 370-vm_clone-produces-vms-that-are-silently-fragile-to-multi-disk-attach-reboot-no-bootdevices-vda-anchored-grub branch from 6dbb575 to 689fee5 Compare June 3, 2026 14:36
@domendobnikar domendobnikar requested a review from Copilot June 3, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_data for vm_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.

Comment thread plugins/modules/vm_clone.py
Comment thread plugins/modules/vm_clone.py Outdated
Comment thread plugins/module_utils/vm.py Outdated
@domendobnikar domendobnikar force-pushed the 370-vm_clone-produces-vms-that-are-silently-fragile-to-multi-disk-attach-reboot-no-bootdevices-vda-anchored-grub branch 11 times, most recently from acc3fdc to 67eda0b Compare June 4, 2026 14:32
@domendobnikar domendobnikar requested a review from justinc1 June 4, 2026 14:35
@domendobnikar domendobnikar force-pushed the 370-vm_clone-produces-vms-that-are-silently-fragile-to-multi-disk-attach-reboot-no-bootdevices-vda-anchored-grub branch 5 times, most recently from 26cb659 to 06d8f76 Compare June 5, 2026 13:19
    - cloud init's user data not has a default value
    - boot devices by default set as the primary Virtio disk
@domendobnikar domendobnikar force-pushed the 370-vm_clone-produces-vms-that-are-silently-fragile-to-multi-disk-attach-reboot-no-bootdevices-vda-anchored-grub branch 2 times, most recently from 34a4622 to fff6ef4 Compare June 5, 2026 16:12
@domendobnikar

Copy link
Copy Markdown
Collaborator Author

@domendobnikar domendobnikar force-pushed the 370-vm_clone-produces-vms-that-are-silently-fragile-to-multi-disk-attach-reboot-no-bootdevices-vda-anchored-grub branch from 2d57110 to f2fa4b5 Compare June 5, 2026 20:27
@domendobnikar domendobnikar force-pushed the 370-vm_clone-produces-vms-that-are-silently-fragile-to-multi-disk-attach-reboot-no-bootdevices-vda-anchored-grub branch from e4dcabc to 6f42ae3 Compare June 5, 2026 21:22
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.

vm_clone produces VMs that are silently fragile to multi-disk attach + reboot (no bootDevices, vda-anchored grub)

2 participants