Expanding disk partitions when deploying using ADS and VSMT


At last nights Virtual Server 2005 Technet evening in Edinburgh, I was asked whether it was possible when migrating a system using VSMT if the hard disk could be expanded when deploying the image. Since arriving back home, I’ve now had a chance to try this out and can confirm the answer is yes. As an aside, I also discovered why the deploy step too quite so long, it was because I hadn’t updated the virtual machine additions on the ADS controller – the whole deploy step takes no more than 3 minutes when I updated it. Oops. For the disk size change, here’s what you do….

Two files which vmscript generated need updating. First, you need to update the <servername>_createvm.cmd script to ensure that a larger hard disk is created when the blank virtual machine is created on the Virtual Server host. I wanted to add another 100MB to my disk. Look for the lines similar to below with the “-VirtualDiskSize” parameter. Originally, it was 544 (both in the comment and in the actual executing line), and I’ve updated them to 644.

echo Create disk:0 with size:644MB
%VSMT_SRV_APP% -remoteVs:%VS_NAME% -CreateVirtualDisk -VirtualDiskPath:%VM_DISK_PATH%\JJHNT4SVR_disk_1.vhd –VirtualDiskSize:644 %VSMT_DEBUG_FLAGS% -nologo

You also need to change the <server>_internalstate.xml file in a couple of locations which I’ve highlighted below. Again, adding 100MB changed in this case from 544 to 644 for the first instance, and 512 to 612 for the second instance.

<bootini>[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT=”Windows NT Server Version 4.00″
multi(0)disk(0)rdisk(0)partition(1)\WINNT=”Windows NT Server Version 4.00 [VGA mode]” /basevideo /sos
<description>Image from device:JJHNT4SVR source hard drive[0] ide[1:0] partition:1 for logical drive:C:</description>

If all goes well, once you boot up and run disk administrator (if this is NT4), you will see a bigger disk for which the OS partition can be expanded into using whatever your normal choice of tool would be.

What I haven’t had a chance to try is whether if you change these files before the image capture, the partition will be expanded for you once you boot up the new server. That’ll have to be for another day to find out though.

Comments (0)