rancher / old-vm

(OBSOLETE) Package and Run Virtual Machines as Docker Containers
Apache License 2.0
646 stars 133 forks source link

add 2 vm properties to allow storage persistence #116

Closed jdoucerain closed 5 years ago

jdoucerain commented 5 years ago

in the VM spec image_pvc: name of an existing pvc to persist changes done on the first virtual drive (mounted on /image) volumes_pvc: name of an existing pvc to persist changes done on additional virtual drives (mounted on /volumes)

Signed-off-by: jdoucerain jerome.doucerain@bell.ca

jdoucerain commented 5 years ago

here is a sample manifest for a vm having persistent storage for both the image and additional volumes

apiVersion: vm.rancher.io/v1alpha1 kind: VirtualMachine metadata: annotations: name: testvm2 spec: action: start cpus: 2 hosted_novnc: true image: rancher/vm-rancheros:0.3.0 image_pvc: image image_vmtools: "" kvm_extra_args: "" memory_mb: 4096 node_name: "" public_keys:

when deleting the VM and re-creating it, forcing it to be run on another node, I can get what was written to the virtual disk before deleting the VM

jdoucerain commented 5 years ago

variables names have changed

LLParse commented 5 years ago

LGTM, thanks