Tag: Windows

How to shrink a VMDK: Shrinking a virtual disk in VMware ESXi

First open up Disk Management in Computer Management in your guest Windows environment.

Right click the volume on the disk you want to shrink.

Windows will inform you the maximum amount it can shrink the disk by. Choose an amount that you wish to actually shrink it by and click Shrink.

shrinkF

Windows will start the shrinking process and it might take some time and appear to be hanging as Windows will actually be defragmenting the disk in order to consolidate the free space towards the end of the disk before resizing the volume.

Once it is done and you are satisfied that the volume on the disk is the size you want it then you need to shut down the VM.

SSH into the host and copy the VMDK file to make a backup of it, just the descriptor file not the flat file.

cp vmname.vmdk vmname-original.vmdk

Open up the VMDK file in a text editor and find the line that describes the size of the flat file. Similar to the following

# Extent description

RW 209715200 VMFS “vmname-flat.vmdk”

The number is the size of the virtual disk in terms of disk sectors, where each sector is 512 bytes. So a 100GB virtual disk is 209715200 sectors.

You will need to change this number to correspond to the new disk size where x = size in GB

vmdk_size = [x * (1024*1024*1024)] / 512

I have chosen to shrink my disk to 60gb, so my new Extent description now reads as follows:

# Extent description

RW 125829120 VMFS “vmname-flat.vmdk”

You now need to clone the drive to get it to the new size:

vmkfstools -i vmname.vmdk vmname-new.vmdk

The bit we are interested in is the newly created vmname-new-flat.vmdk file.

Rename the old flat file from vmname-flat.vmdk to vmname-flat-old.vmdk

and rename the vmname-new-flat.vmdk file to vmname-flat.vmdk

Start the VM up and it should show the new smaller disk. When you are satisfied that everything is working you can now delete the old unneeded files from your datastore.



Using Process Monitor for software error investigation

I’m not typically involved in the support for the software that the company that I work for produces but this morning I was asked to consult on a problem that was affecting the application support team here. Fortunately there are no reports that the client we produced this exact piece of software for is experiencing the same error.

I was asked to consult because the error appeared to be due a change in the IT infrastructure in some way as it was affecting multiple people and the code itself had not been changed by the developers. The error is in a software module that is supposed to produce a document from a set of data that is being currently viewed however it just throws up an error message. Because it was apparently working earlier this week, nothing has changed in our code and we had a Patch Tuesday this week could a Microsoft Windows update be the underlying cause of the error?

The first thing to do was to understand exactly what was going on and what processes were failing. The error message itself was useless and nothing was getting logged in the Windows event logs so what was needed was a tool to capture data on running processes.

Sysinternals Process Monitor is just the tool for the job and no SysAdmin worth his salt will have not had call to use it many times in their career. Process Monitor is a fantastic tool but can be a little intimidating at first as it generates a huge amount of data which seems like it would take hours to analyse a minute’s worth of captured events.

procmon130711

However there are a couple of simple little things to do to drastically cut down on the amount of data to sift through.

  1. Exclude processes that are probably not relevant to the error. Do this by right-clicking on a process in the window and selecting the appropriate option from the menu.
  2. Clear the display just prior to running the program or performing the task that causes the error you want to investigate and then stop the capture of events once the error has occurred.

So I excluded explorer.exe and then svchost.exe and spoolsv.exe. This cut the list down massively then I also excluded a couple of processes associated with the AVG antivirus and also Microsoft Word and Excel. Cleared the display, started the capture, forced the error to happen again and then stopped the capture.

It then just took under a minute to find the failing process from amongst the few hundred logged events. An ActiveX control that is referenced by the software in order to produce the document could not be found. I then ran the whole thing again on a different machine that had not yet been patched, a slight security risk but necessary in a software development environment in case there are ever conflicts with a new Windows update. The error occurred on this computer also so I was able to rule out a relation to Patch Tuesday.

At this point my job was done (at least for now). I had pinpointed the ActiveX control that was causing the error and had ruled out Windows Updates as a cause. The issue is now being investigated by the software developer that wrote the code.



Windows Blue is Microsoft’s future low-cost OS with yearly updates

http://www.theverge.com/2012/11/28/3693368/windows-blue-update-low-cost



First look at the Nokia Lumia 920 and 820

Microsoft’s Ben Rudolph gives us the first look of the Nokia phones that will be launched with Windows Phone 8.

All in all, I’m seriously impressed with the new Lumias, both inside and out. Design-wise, they’re a nice evolution of the iconic design that Nokia introduced in the Lumia 800 and Lumia 900 – solid, ergonomic, and comfortable. And inside, they’ve added technology like PureView and PureMotion HD+ that offer up real, tangible benefits like smoother, faster, more responsive navigation and professional grade photos. Combined with the power of Windows Phone 8, they’re really something special.



Windows 8 launching late October

Windows 8 launching late October, RTM ‘on track’ for August | The Verge http://www.theverge.com/2012/7/9/3146476/windows-8-will-rtm-august-release-late-october via @verge

Paul Thurrott recommends viewing the BUILD 2011 keynote given by Steven Sinofsky in which Windows 8 was finally unveiled to understand the roadmap of the development and release of what is the most significant OS from Microsoft since Windows 95.



Finished The VDI Delusion by J…

Finished The VDI Delusion by Jack Madden et al. and gave it 5 stars http://t.co/b9EOtHha #Kindle



What’s Plan B should Windows 8 fail?

Windows 8 Failure Could Set Off Tech Industry Chain Reaction

What’s plan b?

Plan b should be an Office Everywhere initiative