pants Posted March 25, 2007 Share Posted March 25, 2007 (edited) Hello,I've been working with BDD2007 and WDS for a few weeks now and i have a couple of questions regarding the task sequencer.First: How can i use my own diskpart script or change the one supplied by MS? My scripting skills are sorely lacking and i find that the scripts are not really descriptive in explaining how to modify them.I want to import my own diskpart script because i need 3 partition for our server, if i put in my own CMD script the tasksequencer will hang post-install because it can't find stuff. I have searched google for the ZTIdiskpart script and the consensus is to let BDD do the formatting or else the post-install scripts will hang.When the task sequencer is running it will use the %scriptroot% variable, is this a network drive corresponding to the scripts Directory in the distribution share? ( it uses Q:\ AFAIK )How does the control directory work when creating builds and is it possible to put my build specific scripts in here instead of the scripts directory?I am sorry if i sound like a noob but i haven't found a diagram explaining how everything works together. I dont't find the BDD process very transparant and have trouble understanding what's called when and from where.I found it easier to just drop to a command line and do all the stuff from there instead of using the wizards. ( map drive, capture image, Diskpart and format the disk )However the computername prompting is very nice and i have some scripts that need to run post-install so the task-sequencer is very handy only i don't grok it yet.Kind regards,Pants Edited March 25, 2007 by pants Link to comment Share on other sites More sharing options...
pants Posted March 29, 2007 Author Share Posted March 29, 2007 After some trial and error i found some answers.%scriptroot% represents the z:\scripts folder which is a network drive mapped to \\servername\distribution$\scriptsWhat i did is, i copied the ZTIdiskpart script and screwed around in it till it formatted the 3 drives, if anybody is intrested i'll post my additions to it.I also mutilated the LTIapply script to apply my 3 images to the partitions, this also works now.Now my deployment goed as follows:Winpe boots upEnter credentialsEnter servernamePick imageUsing the task sequencer i:Partition and format 3 drivesApply the images to the drives.RebootUse Sysprep.inf for the minisetup.After the first reboot task sequencer:Configures the servicesDeletes the pagefile on the C drive.Creates a pagefile on the p: drive.Reboots again:After this it says that setup completed with no errors.It's still a little rough around the edges but this way i can deploy a fully installed citrix server in about 20 to 30 minutes. Not bad If anybody has some good ideas about improving this, please let me know.Regards,Pants Link to comment Share on other sites More sharing options...
pants Posted June 8, 2007 Author Share Posted June 8, 2007 (edited) Hello all,I had some requests for my script, i will post it here so it's findable for others who might also be intrested.ZTI_Diskpart:I renamed the ZTI Diskpart to a descriptive name. Let's say ZTIDiskaprt_Citrix.wsf. This will become the diskpart script that will only be used for Citrix servers.I made a new diskpart file with all the diskpart commands:select disk 0cleancreate partition primary align=16065 SIZE=20000assign letter=cactivecreate partition extendedcreate partition logical size=42000assign letter=dcreate partition logical size=5500assign letter=pexitThe primary align section works around some errors i had when formatting disks from WindowsPE. The subsequent deployments would not boot to setup and report that no operating system was found. Creating a 16MB offset fixes this. ???? Next up is the ZTIDiskpart script itself.First change the diskpart file it uses:sDiskPartFile = oUtility.ScriptDir & "\Citrix_disks.txt"You will find this piece of code at the top of the script.Next is the formatting: '//---------------------------------------------------------------------------- '// Format the disk '//---------------------------------------------------------------------------- oLogging.CreateEntry "About to run quick format: C:.", LogTypeInfo iRetVal = oShell.Run("FORMAT C: /FS:NTFS /V:Win2K3_System_Root /Q /Y", 0, true) If iRetVal <> Success then oLogging.CreateEntry "ERROR - Quick format returned a non-zero return code, rc = " & iRetVal, LogTypeError ZTIProcess = iRetVal EXIT FUNCTION Else oLogging.CreateEntry "Format completed successfully.", LogTypeInfo End if oLogging.CreateEntry "About to run quick format: D:.", LogTypeInfo iRetVal = oShell.Run("FORMAT D: /FS:NTFS /V:Data_Storage /Q /Y", 0, true) If iRetVal <> Success then oLogging.CreateEntry "ERROR - Quick format returned a non-zero return code, rc = " & iRetVal, LogTypeError ZTIProcess = iRetVal EXIT FUNCTION Else oLogging.CreateEntry "Format completed successfully.", LogTypeInfo End if oLogging.CreateEntry "About to run quick format: P:.", LogTypeInfo iRetVal = oShell.Run("FORMAT p: /FS:FAT32 /V:PAGEFILE /Q /Y", 0, true) If iRetVal <> Success then oLogging.CreateEntry "ERROR - Quick format returned a non-zero return code, rc = " & iRetVal, LogTypeError ZTIProcess = iRetVal EXIT FUNCTION Else oLogging.CreateEntry "Format completed successfully.", LogTypeInfo End ifI just copied the first line three times and put in the values i wanted, this seems to work fine.Copy the script to the Scripts directory in the Distribution$ share.Now you can modify the build to use %scriptroot%\ZTIDiskpart_Citrix.wsf this will instruct the tasksequencer to use the modified script.This should format your harddisk with three partitions, the right filesystem and sizes. My biggest fear was breaking the tasksequencer because it comes in very handy for multiple changes to a deployment. This way i can still use it and have my own formatting and image applied.I said it wasn't pretty but it works. Regards,Pants Edited June 8, 2007 by pants Link to comment Share on other sites More sharing options...
djseppie Posted April 25, 2008 Share Posted April 25, 2008 Why don't you use WDS for creating partitons?? It's really easy and no hard coding solutions are necessary. This is my script for creating a c-partition of 40GB NTFS and a d-partition filling the rest of the space:<?xml version="1.0" ?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="windowsPE"> <component name="Microsoft-Windows-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86"> <WindowsDeploymentServices> <Login> <WillShowUI>OnError</WillShowUI> <Credentials> <Username>ris.user</Username> <Domain>your.domain</Domain> <Password>rispassword</Password> </Credentials> </Login> <ImageSelection> <WillShowUI>OnError</WillShowUI> <InstallImage> <ImageName>XpSP2NL</ImageName> <ImageGroup>Workstation</ImageGroup> <Filename>XpSP2NL.wim</Filename> </InstallImage> <InstallTo> <DiskID>0</DiskID> <PartitionID>1</PartitionID> </InstallTo> </ImageSelection> </WindowsDeploymentServices>` <DiskConfiguration> <WillShowUI>OnError</WillShowUI> <Disk> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> <CreatePartitions> <CreatePartition> <Order>1</Order> <Type>Primary</Type> <Size>40000</Size> </CreatePartition> <CreatePartition> <Order>2</Order> <Type>Primary</Type> <Extend>true</Extend> </CreatePartition> </CreatePartitions> <ModifyPartitions> <ModifyPartition> <Order>1</Order> <PartitionID>1</PartitionID> <Letter>C</Letter> <Label>SYSTEM</Label> <Format>NTFS</Format> <Active>true</Active> <Extend>false</Extend> </ModifyPartition> <ModifyPartition> <Order>2</Order> <PartitionID>2</PartitionID> <Letter>D</Letter> <Label>DATA</Label> <Format>NTFS</Format> <Extend>false</Extend> </ModifyPartition> </ModifyPartitions> </Disk> </DiskConfiguration> </component> <component name="Microsoft-Windows-International-Core-WinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86"> </component> </settings></unattend> I hope this will help! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now