Re: Where are disk config files located in 2.0? (want to use cloned LV outside of PM.
OK, so here's the scenario. The whole double-copy thing to clone a VM is WAY too much moving of bits. In VMware it's super simple - copy the VMDK/VMX etc to a new directory in the datastore and 'add to inventory' the VM (this is the most basic of cloning - linked clones in VMware are another topic). I'm trying to find a 'copy once' method in Proxmox. Here's what I'm trying to do:
I have a running VM. Here's the vmid.conf:
ostype: win7
memory: 512
sockets: 1
net0: e1000=82:0D:B2:70:00:0B,bridge=vmbr0
name: vm1
bootdisk: ide0
cores: 1
virtio0: test_store:vm-101-disk-1
ide2: cdrom,media=cdrom
I shut it down and take a snapshot via lvcreate. I then power the VM back up.
I could try to do this with running directly from the snapshot, but I want an independent disk from the snapshot 'gold image'. So now I create an LV the same geometry (well, because it's an LV, the same size) as vm1 above.
Original LV from running system:
--- Logical volume ---
LV Name /dev/test/vm-101-disk-1
VG Name test
LV UUID CgK8Eu-Iwov-V0rQ-YBk1-uGKr-defn-a5sMFn
LV Write Access read/write
LV Status available
# open 0
LV Size 32.00 GiB
Current LE 8192
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
New LV:
--- Logical volume ---
LV Name /dev/test/vm-102-disk-1
VG Name test
LV UUID RjAYrp-F3uU-s3y1-WFKS-lLLg-fIPg-sBAuB9
LV Write Access read/write
LV Status available
# open 0
LV Size 32.00 GiB
Current LE 8192
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4
I use "dd" to copy data from the LV snapshot to the new LV, eg:
dd if=/dev/test/vm-101-disk-1-snapshot1 of=/dev/test/vm-102-disk-1
This copies all 32G, even though it's not all in use (not the most efficient, I know. I'm just testing a process). Again, I feel I could use the snapshot and not choose to copy off the data, but I want the snapshot as a base to create multiple clones from.
Now I have a new LV with the same data and geometry as the running VM's LV.
So, I create a new VM in Proxmox - here's the vmid.conf for vm2:
ostype: win7
memory: 512
sockets: 1
net0: e1000=82:0D:B2:70:00:0C,bridge=vmbr0
name: vm2
bootdisk: ide0
cores: 1
I then hand-edit the vmid.conf file for vm2 to attach to the cloned disk:
ostype: win7
memory: 512
sockets: 1
net0: e1000=82:0D:B2:70:00:0C,bridge=vmbr0
name: vm2
bootdisk: ide0
cores: 1
virtio: test_store:vm-102-disk-1
However, Proxmox doesn't see this disk in the config, and an attempt to power it up fails with 'no boot disk'.
What is missing - somewhere the fact that the disk "vm-102-disk-1" is a valid Proxmox-assignable disk is not being registered. How to I do that? Is there another configuration file? Where does the system acknowledge that this LVM disk is valid for use in Proxmox and causes it to appear in the inventory of disks in the 'storage' pulldown? It should be possible to 'connect' an existing disk somehow....