Help with migration to ProxMox 2.2

johjoh

Member
Feb 4, 2011
43
0
6
Hello,
I have 2 node cluster setup configured and working for replicating with DRBD and LVM.
My question, for speed up my job, it's about migration of phisical server.
I need to resize the hard disk of the server, and I'm searching a solution for shrink disk after conversion.

I explain what I want to do:
- I'm migrating 3 Windows Server 2003, with clonezilla I clone directly from phisical hard disk to virtual hard disk
- after I startup the virtual machine and resize the partitions to the desired dimension leaving free space unformatted
- now my question, if I shutdown the virtual machine exist a command that shrink LVM based RAW disk? Does it loose data on my partition?

Thank you
 
Hello,
I have 2 node cluster setup configured and working for replicating with DRBD and LVM.
My question, for speed up my job, it's about migration of phisical server.
I need to resize the hard disk of the server, and I'm searching a solution for shrink disk after conversion.

I explain what I want to do:
- I'm migrating 3 Windows Server 2003, with clonezilla I clone directly from phisical hard disk to virtual hard disk
- after I startup the virtual machine and resize the partitions to the desired dimension leaving free space unformatted
- now my question, if I shutdown the virtual machine exist a command that shrink LVM based RAW disk? Does it loose data on my partition?

Thank you
Hi , it should be ok if you resize the partition and keep free space after the partition before doing the lvm resize.
 
Ok, but what is the command?
I must use a sort of "qemu-img resize" or "lvresize"? What is the sintax?

Thank you
 
Thank you udo.
So if I undestand, suppose I have an hard disk of 80 GB:
- in the first case "lvresize -L60G " the hard disk will be 60 GB after resize?
- in the second case "
lvresize -L-60G" the hard disk will be 20 GB after resize?

Is this command dangerous? Does it delete data or it check the empty space inside the virtual hard disk?

Thank you
You have saved a lot of time in my job of conversion :rolleyes:
 
Thank you udo.
So if I undestand, suppose I have an hard disk of 80 GB:
- in the first case "lvresize -L60G " the hard disk will be 60 GB after resize?
- in the second case "
lvresize -L-60G" the hard disk will be 20 GB after resize?

Right!
Is this command dangerous? Does it delete data or it check the empty space inside the virtual hard disk?
It's very dangerous - it's trunk the lv without carry about the content - you must also change the partition-table of the VM-disk after that.

You should do this only with an valid backup!

Udo
 
Any other idea for quickly convert P2V without use of 3 step fsarchive for shrink?
 
why don´t you shrink the disk before migration? e.g. by using gparted. use a live distribution like http://partedmagic.com
 
Another little question, I used the second ethernet gigabit port for DRBD in Primary/Primary mode, do you suggest a crossover cable between the server or a switch gigabit?
I'm thinking if one of the two ethernet gigabit port will break what appen? Heartbeat it's not installed so any service monitor the ethernet port.
What low cost 10 Gigabit ethernet card ProxMox 2.2 support? I want to increase performance of DRBD, actually write at 110 M/sec

Thank you
 
Another little question, I used the second ethernet gigabit port for DRBD in Primary/Primary mode, do you suggest a crossover cable between the server or a switch gigabit?
Hi,
depends on your switch - normaly is crossover faster (less latencies). And with crossover you can deactivate encryption - also a little performance impact.
I'm thinking if one of the two ethernet gigabit port will break what appen? Heartbeat it's not installed so any service monitor the ethernet port.
What low cost 10 Gigabit ethernet card ProxMox 2.2 support? I want to increase performance of DRBD, actually write at 110 M/sec

Thank you
If you only need a faster DRBD-Connection (and cheap) go for two infiniband-nics (10GB-Nics are cheap on ebay) plus an cable and you speed up the DRBD (esp. the latency is much better).

Udo
 
Thank you udo.
How I can deactivate encryption, it's sufficient to erase the line into /etc/drbd.d/r0.res?
I'm thinking to convert DRBD from primary/primary to active/passive how I nedd to modify the configuration files?
Based on your experiences, I have two HP ProLiant DL360 G5 with two HP Smart Array P400 (512 MB + battery) and Gigabit NIC are HP NC373i, how would you tune up the configuration file of DRBD?

This are mine /etc/drbd.d/ro.res
Code:
resource r0 {        protocol C;
        startup {
                wfc-timeout  15;
                degr-wfc-timeout 60;
                become-primary-on both;
                }
        net {
                max-buffers 8000;
                max-epoch-size 8000;
                sndbuf-size 512k;
                cram-hmac-alg sha1;
                shared-secret "******";
                allow-two-primaries;
                after-sb-0pri discard-zero-changes;
                after-sb-1pri discard-secondary;
                after-sb-2pri disconnect;
                }
        syncer {
                rate 150M;
                }
        on emu1 {
                device /dev/drbd0;
                disk /dev/cciss/c0d1p1;
                address 192.168.50.1:7788;
                meta-disk internal;
                }
        on emu2 {
                device /dev/drbd0;
                disk /dev/cciss/c0d1p1;
                address 192.168.50.2:7788;
                meta-disk internal;
                }
}

And this are mine /etc/drbd.d/global_common.conf
Code:
global {	usage-count no;
	# minor-count dialog-refresh disable-ip-verification
}


common {
	protocol C;


	handlers {
		pri-on-incon-degr "/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
		pri-lost-after-sb "/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
		local-io-error "/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f";
		# fence-peer "/usr/lib/drbd/crm-fence-peer.sh";
		split-brain "/usr/lib/drbd/notify-split-brain.sh email@domain.ext";
		out-of-sync "/usr/lib/drbd/notify-out-of-sync.sh email@domain.ext";
		# before-resync-target "/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k";
		# after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;
	}


	startup {
		# wfc-timeout degr-wfc-timeout outdated-wfc-timeout wait-after-sb;
	}


	disk {
		# on-io-error fencing use-bmbv no-disk-barrier no-disk-flushes
		# no-disk-drain no-md-flushes max-bio-bvecs   
	}


	net {
		# sndâ€buf-size rcvbuf-size timeout connect-int ping-int ping-timeout max-buffers
		# max-epoch-size ko-count allow-two-primaries cram-hmac-alg shared-secret
		# after-sb-0pri after-sb-1pri after-sb-2pri data-integrity-alg no-tcp-cork
	}


	syncer {
		# rate after al-extents use-rle cpu-mask verify-alg csums-alg
	}
}


Thank you very much :D !
 
Please do not post against the subject. If you have DRBD questions, open a new thread. A basic rule, one question per thread.

Otherwise others cannot follow.
 
Thank you udo.
So if I undestand, suppose I have an hard disk of 80 GB:
- in the first case "lvresize -L60G " the hard disk will be 60 GB after resize?
- in the second case "
lvresize -L-60G" the hard disk will be 20 GB after resize?

Is this command dangerous? Does it delete data or it check the empty space inside the virtual hard disk?

To be sure not to cut the end of the last partition I usually go the following way:
1. Resize all of partitions and move then at the beginning.
2. Make sure there are no large whitespaces between partitions (couple of Megabytes is okay).
3. Resize LVM partition to summary size of on partitions (for example 10,10 and 20 -> 40) plus 1-2Gb, so, I run lvresize -L 42G.
4. Extend the last partition to the whitespace (10 -> 12).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!