Add generic-vm persistence
Sometime you may need a VM for something that you want to persist even if the lab is (re)deployed. It looks like a qcow2 snapshot is created and used to start the vm, but it is not saved to a location that is persistent. There is a /config folder that is even mounted to store persistence data, like a startup config for an NOS, but the original and snapshot disk are just saved to the / so when the container is deleted so is the data. Then when you deploy again your vm is wiped.
Yes, that is how it is today, indeed. Maybe having the disk image moved to the /clab-image directory with the bind mount with the src clab-<labName>/<nodeName>/image is a sound idea
That would actually be quite helpful, then instead of everyone having to build large containers with the image built in, you could provide smaller containers and just mount in the image. My example is I'm trying to setup a bunch of VMs with an application installed to test it's integration in a lab environment. It has to be a VM due to some low level hardware stuff it has to manage that is just problematic in a container.
A way to specify the source image would be nice too, some global variable or something, then you could snapshot the image into the node folder. I'm thinking a lab layout could be like
bgp-test.clab.yaml
fedora.qcow2
ubuntu.qcow2
test.clab
├── node1
│ └── image
├── node2
│ └── image
├── node3
│ └── image
└── rtr1
the topology could be
name: test
topology:
nodes:
node1:
kind: generic_vm
image: ubuntu.qcow2
node2:
kind: generic_vm
image: ubuntu.qcow2
node3:
kind: generic_vm
image: fedora.qcow2
rtr1:
kind: arista_ceos
image: registry.local/ceos:latest
links:
- endpoints: ["node1:eth0", "rtr1:eth0"]
- endpoints: ["node2:eth0", "rtr1:eth1"]
kind: generic_vm could pull in the generic_vm container, then create a qcow2 snapshot of the listed image for the node. That would save a lot of space and make it much easier to distribute labs with Generic VMs.