My goal is to store a configuration file on a disk and then copy that disk to VMs that are being deployed.
The source VM has a disk in this state with the config file on it:
I am able to copy using the following process:
This works, but it seems suboptimal to make four API calls to move a disk from one VM to another VM. Is there a better way?
I would like there to be one single API call and not need a second storage named "config" to have this all work. An ideal starting state would be:
With the following being the ideal process for copying the disk:
The end state for the source VM would be:
The end state for the destination VM would be:
In all of the above, the source {src} VM ID is 100 and the destination {dst} VM ID is 200.
The source VM has a disk in this state with the config file on it:
virtio1 = config:vm-100-disk-0,backup=0,size=1GI am able to copy using the following process:
Code:
POST /api2/json/nodes/{node}/qemu/{src}/move_disk
disk = virtio1
storage = local-zfs
PUT /api2/json/nodes/{node}/qemu/{src}/config
delete = virtio1
POST /api2/json/nodes/{node}/qemu/{src}/move_disk
disk = unused1
target-disk = ide3
target-vmid = {dest}
PUT /api2/json/nodes/{node}/qemu/{src}/config
virtio1 = config:vm-100-disk-0,backup=0
This works, but it seems suboptimal to make four API calls to move a disk from one VM to another VM. Is there a better way?
I would like there to be one single API call and not need a second storage named "config" to have this all work. An ideal starting state would be:
virtio1 = local-zfs:100/vm-100-disk-1.qcow2,backup=0,size=1GWith the following being the ideal process for copying the disk:
Code:
POST /api2/json/nodes/{node}/qemu/{src}/move_disk
disk = virtio1
target-disk = ide3
target-vmid = {dest}
delete = 0
The end state for the source VM would be:
virtio1 = local-zfs:100/vm-100-disk-1.qcow2,backup=0,size=1GThe end state for the destination VM would be:
ide3 = local-zfs:200/vm-200-disk-1.raw,size=1GIn all of the above, the source {src} VM ID is 100 and the destination {dst} VM ID is 200.
Last edited: