coping from local to drbd using dd

vitor costa

Renowned Member
Oct 28, 2009
142
2
83
I haved a server with some VMs kvm.
Now i add another server and mount a cluster with drbd.
Now i need transfer the vms from local to shared drbd.
Transfer some small vms using vzdump and qmrestore - all is ok.
To large vms i want using dd command. I create a logical volume and run:

dd if=vm-102-disk-1.raw of=/dev/drbdvg/vm-102-disk-1

Then i adapt 102.conf and the vm go up. Almost no problems...

The only strange thing is web interface no show the size of vm disk in drbd storage.

qm list show:

VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID
102 winxp-ts running 2048 0.00 760
104 srv2008 running 6144 100.00 10828
105 srvsql stopped 2048 100.00 0



Whats missing ?


qmlist
 
I solved the problem.

vm.conf is ok - if wrong the vm will not load. Its not the case.

The problem is the way i create the logical volume. Using Webmin to do it no work. I create a new vm inside drbd using pve web interface and look in /etc/lvm/backup. There are a file showing the creating command. Then delete and recreate the volume with the same comand (to vm 102) and all work. The wemin creation put some more parameters em lvcreate command...

Tanks a lot.
 
Sorry, you may wonder if you could make a small
step by step how you create a new vm with DD


From already thank you very much.

These steps follow and I'm not result

I have the machine vm106, whose size is 28 GB, store in /var/liv/vz/images/vm-106-disk-1.raw

1) With the web interface I create a full kvm vm525 machine with the same size 26 GB

And then
2) dd if = vm-106-disk-1.Raw of = / dev/drbdvg/vm-525-disk-1

Is that correct or am I missing something?
 
Last edited by a moderator:
Sorry, you may wonder if you could make a small
step by step how you create a new vm with DD


From already thank you very much.

These steps follow and I'm not result

I have the machine vm106, whose size is 28 GB, store in /var/liv/vz/images/vm-106-disk-1.raw

1) With the web interface I create a full kvm vm525 machine with the same size 26 GB

And then
2) dd if = vm-106-disk-1.Raw of = / dev/drbdvg/vm-525-disk-1

Is that correct or am I missing something?
Hi,
i hope it's only typo:
26 GB are not the same size like 28GB!
input-filename don't match!
Output-filename has spaces inside!

Perhaps you must correct the bootdevice.

Udo
 
Sorry if I made the drive with 28 GB
But the result is unbootable.
Fails to find / boot
boot console stays
(Initramfs)