vm_manager: add import command for cluster mode#85
Open
dupremathieu wants to merge 1 commit intoseapath:mainfrom
Open
vm_manager: add import command for cluster mode#85dupremathieu wants to merge 1 commit intoseapath:mainfrom
dupremathieu wants to merge 1 commit intoseapath:mainfrom
Conversation
Add import_vm() to bring an existing libvirt VM under cluster management by retrieving its XML, stripping disk devices, and delegating to create() for Ceph/Pacemaker registration. Expose it via the import subcommand in vm_manager_cmd with support for --new-name, --disk-bus, --progress and all standard create/clone options. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Mathieu Dupré <mathieu.dupre@savoirfairelinux.com>
|
eroussy
requested changes
Mar 10, 2026
| if "disable" in args and args.disable: | ||
| args.enable = not args.disable | ||
| else: | ||
| args.enable = True |
Member
There was a problem hiding this comment.
Where do these arguments come from ? Where do the user configures the livemigration for the import command ?
| if source is not None: | ||
| disk_path = source.get("file") or source.get("dev") | ||
| if disk_path: | ||
| vm_options["image"] = disk_path |
Member
There was a problem hiding this comment.
Add a check here, to raise an exception if the VM has more than one disk.
It is possible to have more than one disk in standalone, but not in cluster for now.
Also be aware of this PR #84
| add_colocation, | ||
| remove_pacemaker_remote, | ||
| add_pacemaker_remote, | ||
| import_vm, |
Member
There was a problem hiding this comment.
This naming might be confusing, I think we can find a better one
- move_to_cluster ?
- add_to_cluster ?
- migrate_to_cluster ?
import_to_cluster can also work, but It is confusing with importing configuration files or creating a VM.
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.



Add import_vm() to bring an existing libvirt VM under cluster management by retrieving its XML, stripping disk devices, and delegating to create() for Ceph/Pacemaker registration. Expose it via the import subcommand in vm_manager_cmd with support for
--new-name,--disk-bus,--progressand all standard create/clone options.