mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-03-26 19:03:16 +00:00
feat(kubevirt_vm): Add support for RunStrategy
This change adds support for setting the RunStrategy of a VM. Depending on the value set the wait condition for the VM is adjusted. For the values Always, RerunOnFailure or Once the wait condition will wait for the VM to run and be ready. For the value Halted the wait condition will wait for the VM to not exist. For the value Manual the wait condition is not set. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
42
examples/play-create-run-strategy.yml
Normal file
42
examples/play-create-run-strategy.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
- name: Playbook creating a virtual machine with multus network
|
||||
hosts: localhost
|
||||
tasks:
|
||||
- name: Create VM
|
||||
kubevirt.core.kubevirt_vm:
|
||||
state: present
|
||||
name: testvm
|
||||
namespace: default
|
||||
labels:
|
||||
app: test
|
||||
instancetype:
|
||||
name: u1.medium
|
||||
preference:
|
||||
name: fedora
|
||||
run_strategy: Manual
|
||||
spec:
|
||||
domain:
|
||||
devices:
|
||||
interfaces:
|
||||
- name: default
|
||||
masquerade: {}
|
||||
- name: bridge-network
|
||||
bridge: {}
|
||||
networks:
|
||||
- name: default
|
||||
pod: {}
|
||||
- name: bridge-network
|
||||
multus:
|
||||
networkName: kindexgw
|
||||
volumes:
|
||||
- containerDisk:
|
||||
image: quay.io/containerdisks/fedora:latest
|
||||
name: containerdisk
|
||||
- cloudInitNoCloud:
|
||||
userData: |-
|
||||
#cloud-config
|
||||
# The default username is: fedora
|
||||
ssh_authorized_keys:
|
||||
- ssh-ed25519 AAAA...
|
||||
name: cloudinit
|
||||
wait: true
|
||||
Reference in New Issue
Block a user