VMware

This Question is Answered

7 Replies Last post: May 16, 2008 6:59 AM by wila  

VM Harddrive full, won't reboot posted: May 15, 2008 8:58 AM

Click to view khenry567's profile Enthusiast 75 posts since
Sep 1, 2006
Hey guys, need some of your advice. I have a vm that the users filled the harddrive up to capacity. I first noticed a problem with it when I saw that the CPU was maxed out. I rebooted it so that the vm would continue working since the users had to have it working, and everything seemed fine. I told them that I would have to have this machine so that I could increase the harddrive size. I rebooted it last night again so that it could be used and figured in the morning(today) that I would run Converter on it and it would be OK. Well, I rebooted it again this morning because I wanted it functioning normally, CPU wise, and I wanted to delete as many files as possible once again(We did that two days ago and got 666mbs of free space, which must have filled up). Anyways, it would not come back up. Saying something about API error. I decided to run Converter on it anyway and did so. I have another machine that seems to be working now with a harddrive that is twice the size of the old one but when I tried to defrag it worked to some degree but I still have about 32% of the files unable to be defragged. The machine seems OK but I am not happy.

My questions: Was there a better way to do this? (I still have the old vm and can do whatever to it, if I can get it to boot) Could I increase the vmdk file size on the original vm somehow, defrag it, and get a better result that way?

Anyone have some opinions?

Re: VM Harddrive full, won't reboot

1. May 15, 2008 9:23 AM in response to: khenry567
Click to view wila's profile Champion vExpert 3,428 posts since
Jun 27, 2006
Every error will at least touch some API so I would say that your error is too general to give useful info.

The 32% defragmentation really depends on NTFS features, I suspect there are a lot of small files on that drive?
Another variable is the defrag utility used.

Anyways, when you need to increase the drive, Converter isn't such a bad choice, unless it fails to work properly.
Normally I just clone a VM using this script New Script for moving vm to another storage and then use the clone to work on.
This way I can always go back, much like you in this case.

Then for extending a vDisk, I use the command line, as root:

vmkfstools -X 25G /vmfs/volumes/volume1/sizematters/smalldisk.vmdk

This will expand the vDisk smalldisk.vmdk from the VM "sizematters" if (and only if) the disk was smaller as 25Gb
That will increase the disk afterwards you will still have to resize the partition(s) in the disk to actually make more space.

See also this page for steps on that.
http://www.vmware-land.com/Resizing_Virtual_Disks.html

--
Wil

Re: VM Harddrive full, won't reboot

2. May 15, 2008 9:27 AM in response to: khenry567
Click to view Yattong's profile Master 603 posts since
May 25, 2007
A quicker way to resize the harddisk could be just to use the vmkfstools and diskpart.
A link to do so... http://vmware-land.com/Resizing_Virtual_Disks.html

Good Luck

Re: VM Harddrive full, won't reboot

5. May 16, 2008 12:41 AM in response to: khenry567
Click to view wila's profile Champion vExpert 3,428 posts since
Jun 27, 2006
There is no difference between a virtual drive and a physical drive in terms of defragmentation. Let me say that differently, the software doesn't know it is defragmenting a virtual drive. So for troubleshooting you should treat it as a physical drive.
The NTFS defragmentation algorithm needs free space on the disk in order to remove the fragments. The standard internal algo in windows is not optimal as in that you sometimes must give it more free space as you would expect. As an example I had a physical WinXP machine over here with similar issues as you and still it had gigabytes of free space. It wasn't until I moved some more large files off the box until it completely defragmented the drive.

Ghost has a few ways of copying a drive. You can tell ghost to copy bit for bit and make an exact clone. In that case you really are better off using vmkfstools as it gives you no extras then. However if you use Ghost's knowledge about the NTFS filesystem (I think this is the default, but I don't use ghost as much as I used to) then ghost will copy the files smart out of the original, so you end up with a defragmented volume after the clone.

--
Wil

Re: VM Harddrive full, won't reboot

7. May 16, 2008 7:00 AM in response to: khenry567
Click to view wila's profile Champion vExpert 3,428 posts since
Jun 27, 2006
What did you mean by vmkfstools doesn't give you any extras?

Erm, if I'm not mistaken then I was stating the opposite, ghost doesn't give you anything extras over vmkfstools when doing a bit for bit identical copy.
If you're going to clone a VM and want a copy that is exactly the same (not looking at the filesystems underneath), just use vmkfstools as it is much faster and easier to use from the command line.

Oh and thanks for those points!
--
Wil

VMware Beta Programs

Want to be Considered for Future Beta Programs?

Learn More

VMware Developer

Download SDKs, APIs, videos,
training, and more in the Developer community.

Learn More

Developer
Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld
Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

Only VMware ... Delivers Nexus 1000V

Ensure consistent, policy-based network capabilities to virtual machines across your data center.

Learn More

Communities