vmkfstools -i /vmfs/volumes/datastore1/somehost/somehost.vmdk /vmfs/volumes/datastore1/somehost/somehost-thin.vmdk -d 'thin' -a lsilogic
# adjust vmx and away you go.
Showing posts with label virtualization. Show all posts
Showing posts with label virtualization. Show all posts
Tuesday, May 18, 2010
Wednesday, October 7, 2009
resize a mounted lvm-managed disk in linux
I have found many overly-complex and incorrect and/or unnecessary instructions all over the web. So, I made this reference for me, but it may work well for you too. I typically use RHEL4/5 in my data center implementations, so these steps cover lvm managed disk space (which is decent for a simple LAMP stack).
I tend to do the following a lot in vmware products (workstation/esx/esxi).
First, check and note the size of your disks and partitions in your target vm.
Then, go into the settings of your vm (e.g. through the vi client) and either add another virtual hard disk or increase the size of the existing disk. In my case i simply extended the existing virtual disk from 8G to 16G.
Reboot.
Check to see that the size of /dev/sda has increased.
/* If you increased the size of your existing disk, its probably easiest to boot from the gparted-live disk and create a new primary partition in the newly free space, format ext3. */
wget http://downloads.sourceforge.net/project/gparted/gparted-live-stable/0.4.6-1/gparted-live-0.4.6-1.iso?use_mirror=softlayer
reboot
/* check for /dev/sda3, your new parition */
/* create the lvm pv reference */
/* extend the lvm vg reference */
/* note the free space for your upcoming `lvextend` command */
/* extend the lvm vg reference */
/* resize the volume group while its still mounted */
check the following
now, go on with your life.
I tend to do the following a lot in vmware products (workstation/esx/esxi).
First, check and note the size of your disks and partitions in your target vm.
[root@host]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
5.8G 665M 4.9G 12% /
/dev/sda1 99M 9.1M 85M 10% /boot
none 506M 0 506M 0% /dev/shm
[root@host]# sfdisk -s
/dev/sda: 8385898
/dev/sda1: 104391
/dev/sda2: 8281507
/dev/dm-0: 6160384
/dev/dm-1: 2031616
Then, go into the settings of your vm (e.g. through the vi client) and either add another virtual hard disk or increase the size of the existing disk. In my case i simply extended the existing virtual disk from 8G to 16G.
Reboot.
Check to see that the size of /dev/sda has increased.
[root@host]# sfdisk -s
/dev/sda: 16777216
/dev/sda1: 104391
/dev/sda2: 8281507
/dev/dm-0: 6160384
/dev/dm-1: 2031616
[root@host]# sfdisk -l
Disk /dev/sda: 2088 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 12 13- 104391 83 Linux
/dev/sda2 13 1043 1031 8281507+ 8e Linux LVM
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
/* If you increased the size of your existing disk, its probably easiest to boot from the gparted-live disk and create a new primary partition in the newly free space, format ext3. */
wget http://downloads.sourceforge.net/project/gparted/gparted-live-stable/0.4.6-1/gparted-live-0.4.6-1.iso?use_mirror=softlayer
reboot
/* check for /dev/sda3, your new parition */
[root@host]# sfdisk -s
/dev/sda: 16777216
/dev/sda1: 104391
/dev/sda2: 8281507
/dev/sda3: 8385930
/dev/dm-0: 6160384
/dev/dm-1: 2031616
/* create the lvm pv reference */
[root@host]# pvcreate /dev/sda3
/* extend the lvm vg reference */
[root@host]# vgextend VolGroup00 /dev/sda3
/* note the free space for your upcoming `lvextend` command */
[root@host]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 15.84 GB
PE Size 32.00 MB
Total PE 507
Alloc PE / Size 250 / 7.81 GB
Free PE / Size 257 / 8.03 GB
VG UUID L7woQB-ymCv-NeWL-i47M-b5Ua-fOHQ-hM0DXI
/* extend the lvm vg reference */
[root@host]# lvextend -L+8.03G /dev/VolGroup00/LogVol00
/* resize the volume group while its still mounted */
[root@host]# ext2online /dev/VolGroup00/LogVol00
check the following
[root@host]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
14G 668M 13G 6% /
/dev/sda1 99M 9.1M 85M 10% /boot
none 506M 0 506M 0% /dev/shm
[root@host]# sfdisk -l
Disk /dev/sda: 2088 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 12 13- 104391 83 Linux
/dev/sda2 13 1043 1031 8281507+ 8e Linux LVM
/dev/sda3 1044 2087 1044 8385930 83 Linux
/dev/sda4 0 - 0 0 0 Empty
now, go on with your life.
Tuesday, May 12, 2009
Howto Shrink a VM
First, run a script similar to the following, one for each significant mountpoint as defined in /etc/fstab
#!/bin/sh
cd /
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
cd /tmp
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
cd /home
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
cd /var
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
cd /usr
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
# Delete this script
rm -rf /usr/local/jboss/server/default/log/*
cd /root/tools
rm -rf shrink.sh
Then shutdown the vm and close vmware workstation.
Run the following command at the Windows Command Interpreter.
vmware-vdiskmanager -k <path to vmdk>
#!/bin/sh
cd /
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
cd /tmp
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
cd /home
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
cd /var
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
cd /usr
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
# Delete this script
rm -rf /usr/local/jboss/server/default/log/*
cd /root/tools
rm -rf shrink.sh
Then shutdown the vm and close vmware workstation.
Run the following command at the Windows Command Interpreter.
vmware-vdiskmanager -k <path to vmdk>
Wednesday, October 29, 2008
Exporting vm's from ESX to VMWare Server 2.0
Well, I hate to say it, but VMWare Server 2.0 is a little clunky. I don't get a lot of confidence using Internet Explorer to admin my vm's, but I can live with it. I also don't like how the vm admin service runs as a network service. It seems like it should be an optional install, in case IT policy allows remote administration of virtual environments. It just seems like its just one more thing to manage and watch for, an unnecessary increase in network attack surface with an application that may be very easily subverted.
What I can't live with is the mouse control, or lack of it, at the console of a windows OS running in VMWare Server 2.0...and it's running on a system with 4GB ram, a decent proc and win2k3 Std R2. Using the vm over RDP is reasonable and works well.
I was able to successfully import a ESX 3.5 image with Converter 3.0.3 to a VMWare Workstation 5.x compatiable image into VMWare Server 2.0. It didn't work with a VMWare Workstation 6.x compatiable image.
I wonder if VMWare has a security group that tries to crack its own apps?
What I can't live with is the mouse control, or lack of it, at the console of a windows OS running in VMWare Server 2.0...and it's running on a system with 4GB ram, a decent proc and win2k3 Std R2. Using the vm over RDP is reasonable and works well.
I was able to successfully import a ESX 3.5 image with Converter 3.0.3 to a VMWare Workstation 5.x compatiable image into VMWare Server 2.0. It didn't work with a VMWare Workstation 6.x compatiable image.
I wonder if VMWare has a security group that tries to crack its own apps?
Labels:
converter,
esx,
migration,
virtualization,
vmware
Sunday, August 12, 2007
My Favorite Citrix/Virtualization Websites
My Faves:
http://www.rtfm-ed.co.uk/
http://blog.scottlowe.org/
http://www.vmguru.com/
http://www.dabcc.com
http://virtrix.blogspot.com/
http://www.stefanschuller.com/
http://www.thin-world.com/
http://www.brianmadden.com
And a few others...
http://www.vmwarez.com/index.html
http://blogs.technet.com/virtualization/
http://x86virtualization.com/
http://www.rtfm-ed.co.uk/
http://blog.scottlowe.org/
http://www.vmguru.com/
http://www.dabcc.com
http://virtrix.blogspot.com/
http://www.stefanschuller.com/
http://www.thin-world.com/
http://www.brianmadden.com
And a few others...
http://www.vmwarez.com/index.html
http://blogs.technet.com/virtualization/
http://x86virtualization.com/
Subscribe to:
Posts (Atom)