You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(kubevirt): add run policy support to VM lifecycle management
Adds a new run_policy parameter to the vm_lifecycle tool that allows
users to control the VM's runStrategy when starting a virtual machine.
The parameter supports three policies:
- HighAvailability: VM runs continuously (sets runStrategy to Always)
- RestartOnFailure: VM restarts on failure (sets runStrategy to RerunOnFailure)
- Once: VM runs once and stops after completion (sets runStrategy to Once)
The run_policy parameter is optional and defaults to HighAvailability
to maintain backward compatibility with existing usage.
Changes include:
- Updated StartVM function to accept RunPolicy parameter
- Added 19 unit tests covering all run policy combinations
- Added 3 integration tests for vm_lifecycle tool
- Updated tool schema with enum values and documentation
- Auto-generated README.md updates
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Alexander Wels <awels@redhat.com>
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -509,9 +509,14 @@ In case multi-cluster support is enabled (default) and you have access to multip
509
509
-`workload` (`string`) - The workload for the VM. Accepts OS names (e.g., 'fedora' (default), 'ubuntu', 'centos', 'centos-stream', 'debian', 'rhel', 'opensuse', 'opensuse-tumbleweed', 'opensuse-leap') or full container disk image URLs
510
510
511
511
-**vm_lifecycle** - Manage VirtualMachine lifecycle: start, stop, or restart a VM
512
-
-`action` (`string`) **(required)** - The lifecycle action to perform: 'start' (changes runStrategy to Always), 'stop' (changes runStrategy to Halted), or 'restart' (stops then starts the VM)
512
+
-`action` (`string`) **(required)** - The lifecycle action to perform: 'start', 'stop', or 'restart'
513
513
-`name` (`string`) **(required)** - The name of the virtual machine
514
514
-`namespace` (`string`) **(required)** - The namespace of the virtual machine
515
+
-`run_policy` (`string`) - The run policy to use when starting a VM (only applies to 'start' action). Options:
516
+
- 'HighAvailability': VM runs continuously (sets runStrategy to Always)
517
+
- 'RestartOnFailure': VM restarts on failure (sets runStrategy to RerunOnFailure)
518
+
- 'Once': VM runs once and stops after completion (sets runStrategy to Once)
0 commit comments