Learning the Basics of Citrix Provisioning Services and XenApp 5 for Windows Server 2003 Part 3 of 3
Prepare the Master Image for Updating
In Part 2, you learned how to:
- Create a master image,
- Create a vDisk in PVS for the master image,
- Install Target Device software,
- Use XenAppPrep,
- Download XenConvert,
- Optimize a master image,
- Use XenConvert, and
- Test streaming a new image.
In this Part 3, you will learn how to:
- Update a Master Image,
- Prepare for updating a new Master Image, and
- Test streaming an updated Master Image.
On the PVS server, copy the Rev 1 .PVP and .VHD files to Rev 2 for the future updates. Please ignore any .LOK files. Open a command prompt and change to the PVS Store folder. If you have used the file names I have used, type in the following commands (shown in Figure 117):
copy "XenApp 5 x64 (Rev 1).pvp" "XenApp 5 x64 (Rev 2).pvp" copy "XenApp 5 x64 (Rev 1).vhd" "XenApp 5 x64 (Rev 2).vhd"
Note: Your file sizes may differ from what is shown.
The advantage to copying the Master Image vDisk now is that there is an exact copy of the master immediately available for updating. If you wait until a later time to make the copy, the vDisk could be in use. That would delay being able to do maintenance or install updates.
Note: There are numerous ways to manage vDisks. Use a method that incorporates your standard naming, storage and maintenance policies and procedures. The example shown in Figure 93 is just that, an example. Daniel Feller of Citrix, wrote an article Provisioning Services for XenApp Best Practices 7 — Image Management (http://blogs.citrix.com/2009/05/01/provisioning-services-for-xenapp-best-practices-7-image-management/) that covers some ideas to consider.
The PVS Store folder should now look like what is shown in Figure 118.
Update the Master Image
In the PVS Console, right-click vDisk Pool and click Add Existing vDisk…. (Figure 119).
Click Search, the Rev 2 vDisk is added to the dialog box, click Add, click OK on the One vDisk added popup and click Close (Figure 120).
Note: if you have a Highly Available multi-server PVS environment you also want to uncheck Enable load balancing for these vDisks — especially when using local vDisk stores.
The vDisk is added to the vDisk Pool (Figure 121).
Right-click the Rev 2 vDisk and select File Properties (Figure 122).
Click the Options tab and verify that Active Directory machine account password management is selected (Figure 123).
If you are using Microsoft KMS or MAK licensing management, click the Microsoft Volume Licensing tab and verify your license management type is selected (Figure 124).
Click the Mode tab, if necessary change the Access Mode to Private Image and click OK (Figure 125).
Right-click Device Collections and click Create Device Collection….(Figure 126).
Enter a Name and Description and click OK (Figure 127).
Right-click the new Device Collection and click Create Device… (Figure 128).
Enter a Name, a Description, verify Boot from is set to vDisk and enter a MAC address (Figure 129).
Click the vDisks tab and click the Add button for vDisks for this device (Figure 130).
Select the Rev 2 vDisk, click OK and click OK (Figure 131).
Right-click the new device, click Active Directory and click Create Machine Account…(Figure 132).
Select the correct Domain, Organization unit and click Create Account (Figure 133).
After the Machine Account is successfully created, click Close (Figure 134).
The new machine account appears in Active Directory Users and Computers (Figure 135).
Create a DHCP reservation for the Maintenance VM or Server (Figure 136).
Verify the Maintenance VM or Server is set to boot from Network (Figure 137). Screen shot is from XenServer 5.6 SP2.
Boot the maintenance server. The server receives the streamed Private Mode vDisk and automatically adds itself to the XenApp farm (Figure 138).
After a manual refresh, you can see the server in the Provisioning Services console (Figure 139 and Figure 140).
Double-clicking the PVS Virtual Disk systray icon shows the Maintenance Server is using the Rev 2 vDisk and is in Private Image mode (Figure 141).
Close the Virtual Disk Status dialog by clicking on “X” in the upper right corner. Now the maintenance server can be updated. In my test I installed Adobe Reader and Adobe Flash.
Figure 142 shows my Add or Remove Programs before updating the Master Image.
Figure 143 shows my Add or Remove Programs after updating the Master Image.
The maintenance server needs to be prepared to be placed back into standard image mode.
For 64-bit Server 2003, launch a command prompt and navigate to C:\Program Files (x86)\Citrix\XenAppPrep.
For 32-bit Server 2003, launch a command prompt and navigate to C:\Program Files\Citrix\XenAppPrep.
Execute the command XenAppPrep /PVS and DO NOT REBOOT (Figure 144).
If there are errors, go to http://support.citrix.com and resolve the errors.
Run the PVS Device Optimizer (Figure 145).
Verify ALL boxes are selected and click OK (Figure 146).
Before proceeding with shutting down the maintenance server, the server needs a few more optimizations (Figure 147). Back in the command prompt from Figure 144:
- Flush the local DNS Resolver Cache: ipconfig /flushdns.
- Run chkdsk on all partitions on the Master Image server (If there are any errors found, run chkdsk /f /r)
- Use a Sysinternals utility to zero out empty vDisk areas and reduce storage (http://technet.microsoft.com/en-us/sysinternals/bb897443) : sDelete –c c: (Note: sDelete can take a very long time to run depending on the size and number of partitions. sDelete needs to be run on all partitions on the Master Image server.)
- Update from fellow CTP Andrew Wood 5-Jun-2014: Just a note that as of v1.61 of sdelete (the latest) the -c and -z options changed round. It used to be that -c zerod out and -z “cleaned”. Now -z is “zero out” and “-c” is clean. The impact is that to optimise your image for virtualization (zero out file so they can deduplicated/compressed better when at rest) -z is the option you want rather than -c (which will not zero out but change data).
From the Sysinternals Website:
SDelete is a command line utility that takes a number of options. In any given use, it allows you to delete one or more files and/or directories, or to cleanse the free space on a logical disk. SDelete accepts wild card characters as part of the directory or file specifier.
Usage: sdelete [-p passes] [-s] [-q] <file or directory> …
sdelete [-p passes] [-z|-c] [drive letter] …
-a Remove Read-Only attribute. -c Clean free space. -p passes Specifies number of overwrite passes (default is 1). -q Don’t print errors (Quiet). -s or -r Recurse subdirectories. -z Zero free space (good for virtual disk optimization).
Shut down the maintenance server.