Solved

VMWARE is there any way we can remove the non utlized disk space?

Posted on 2010-08-16
9
1,037 Views
Last Modified: 2012-05-10
Hi,

VMWARE is there any way we can remove the non utilized disk space?
Say i have 1 blade with 5 vm's running windows 2003.

If i have all 5 vms with 100Gb as D drive and found all 5 each 50 Gb not utilized can i get that space out without any data loss and utilize it for say 5 more vm's?

regards
sharath

0
Comment
Question by:bsharath
9 Comments
 
LVL 5

Expert Comment

by:Steve M
ID: 33447362
There is a way, however we'd need to know what version of vmware host you are using please.

thanks,
-Steve
0
 
LVL 7

Expert Comment

by:broeckske
ID: 33447387
A far as I know there is no automated task for this, I believe you will need to create a new vmkd with a smaller size and copy the data to the new disk and delete the old one.

I have found a blogpost on how to do this from the commandline on the vmware server, but if you are uncomfortable with that I would add a third smaller disk to your guest add a bootable iso cd image with a clone program like ghost and clone the contents of the disk and disconnect the second big vmdk image from your guest. If everything works ok then you can delete the 100GB vmdk

http://usefulglyphs.wordpress.com/2010/02/17/how-to-shrinkexpand-a-vmdk-in-esx-3-5/
0
 
LVL 11

Author Comment

by:bsharath
ID: 33447389
We have Vmware 3.0 & 3.5 & 4.0
0
 
LVL 5

Accepted Solution

by:
Steve M earned 100 total points
ID: 33447664
Are you able to migrate a vm's storage to another datastore?
or
Are you able to migrate one of the vm's to another esx server?

If either of these options are possible, then perform the following steps:
In vSphere, it is as simple as right click machine, click migrate, select storage . . and select 'thin provision' - it will convert thick t thin as part of the migration for you.  if you are migrating storage then that's all you need to do, if you are migrating to another server, then once you are finished you would need to migrate back to the original server obviously.

i know this is not reducing the "configured disk size" as you had asked, but as a thin disk the actual utilization is close to the "space used" on your vm's storage, not the configured size, therefore you should effectively make available all that space on the physical disk for other machines.

There is a catch in this case however, vmware 3.0 I do not believe has the ability to use thin disks, 3.5 must be at update 5 I think to use thin disks, so your only options for the steps above are on those 2 esx server versions only.

Let me know if that will work for you, if not there is one other way that I know of to reduce the disk size, it's a bit risky though and definitely not a supported method by vmware.

Cheers,
-Steve
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 28

Assisted Solution

by:bgoering
bgoering earned 100 total points
ID: 33448127
What isk-ck says about using the gui to migrate is correct provided you have vCenter server 4.x at your disposal. ESX 3.5 (any release) I believe will support thin format - I know for sure I used it on 3.5 U2.

If you don't have vCenter server, or if you don't have another datastore to migrate to, you can use the vmkfstools command to copy your existing disk into a thin format. The process would go something like this:

1. Power down the VM
2. If there are any snapshots remove them, you can't do the following if there are snapshots
3. In edit settings remove the D Disk from the vm. Do NOT delete from disk!
4. Open a ssh session to the host and cd /vmfs/volumes/datastorename/vmname
5. copy the disk: vmkfstools -i -d thin /vmfs/volumes/datastorename/diskname.vmdk /vmfs/volumes/datastorename/diskname-thin.vmdk
6. Add the new diskname-thin.vmdk back to your vm in edit setting/add hard disk
7. Test
8. delete your original 100 GB disk files, may be a base.vmdk and one or more base-flat.vmdk files associated.

Good Luck
0
 
LVL 3

Assisted Solution

by:samdart
samdart earned 100 total points
ID: 33448325
You can do it by following the steps

Have access to another Windows VM which can run Partition Magic or another Disk management tool OR you can use GPARTED on a temporary VM with the above mentioned disks attached to it. (You would have to shut down the VM that is using the disk)

 * Create a new blank disk with 50GB space
 * Add the 50GB and the 100GB disks to the temporary VM
 * Shrink the 100GB partition to 50GB
 * Copy the 50GB Partition to the 50GB Disk
 * Move the 50GB disk to the original VM Folder using VMWare datastore browser
 * Unlink the 100GB disk and link the 50GB disk to the original VM
 * start the VM and make sure everything is okay before deleting the 100GB file
0
 
LVL 5

Expert Comment

by:Steve M
ID: 33448497
Ya, what samdart posted above is what was the riskier solution I was going to suggest next if Migration isn't a viable option for you. Good work guys.

Sharath; let us know which way you choose to do this and how it works out for you.

Cheers,
-Steve
0
 
LVL 3

Assisted Solution

by:canadianit
canadianit earned 100 total points
ID: 33451005
The easy way I'd done in the past is to run vmware converter, and convert your existing VM's to another VM but give it less space.
0
 
LVL 5

Assisted Solution

by:chkdsk01
chkdsk01 earned 100 total points
ID: 33464504
CanadianIT hit the nail on the head.  You should run each VM through VM converter and you can change the size of the disk and even change the provisioning from thick to thin if you prefer.

Although, if it's just a D: drive, I would probably suggest samdart's idea of using diskpart.  It would be a lot quicker.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Teach the user how to edit .vmx files to add advanced configuration options Open vSphere Web Client: Edit Settings for a VM: Choose VM Options -> Advanced: Add Configuration Parameters:
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now