OSIM - Partitioning a Disk Based on Percentage
search cancel

OSIM - Partitioning a Disk Based on Percentage

book

Article ID: 367587

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

In Client Automation documentation a method to partitioning a disk based on percentage in OSIM during WinPE boot is described :
 
 
But this method works for old WinPE boot image. This article describes similar solution for WINPE10x64

Environment

Client Automation 14.5

Resolution

Update the WinPE Image to Support VB Scripting

  1. Create a folder on the root of the C drive named WinPE. 
    C:\WinPE

  2. Open a cmd with Administrator privileges
    Execute the following command to mount the WinPE image in the new folder

    imagex /MOUNTRW "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim" 1 c:\WinPE

    Remarks : imagex.exe is in this directory C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM




  3. Run the following command to add the WinPE VB scripting package

    dism /image:c:\Winpe /add-package /packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\winpe-scripting.cab"




  4. Execute the following command to confirm that the packages have been installed to the WINPE image: 

    dism /image:c:\Winpe /get-packages



  5. Execute the following command to commit the changes made to the WINPE image:

    imagex /unmount c:\Winpe /commit



  6. The file C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim is updated



  7. If you have created the boot image, run the Boot Image Update wizard in the DSM explorer to update the WinPE boot image for use in OSIM. If you have not created the boot image, run the New Boot Image wizard. If you have created the boot image, run the Boot Image Update wizard in the DSM explorer to update the WinPE boot image for use in OSIM. If you have not created the boot image, run the New Boot Image wizard. 

Add Scripts and Supporting Files to the WinPE Image

After the update to the WinPE image to support VB scripting is complete, add the scripts and supporting files to the image.
Follow these steps:

  1. Download the 5 attached files : DiskPercent.vbs, Diskpart_template_legacy.txt, Diskpart_template_uefi.txt, Movecd.txt and DelandCreate.txt

    DiskPercent.vbs splits the disk 0 in 2 partitions (letter C and D) with a size of 50% each. If another repartition is needed, line 45 could be changed :

    Example for 60% on C and 40% on D :
    DISKUSE=60

  2. Copy these 5 files to the following location: 
    C:\Program Files (x86)\CA\DSM\osimips\os-template\updates\winpe10x64\amd64\ca-osim

  3. Update the OSIMRUN.CMD file, which is the script that is invoked when WinPE is booted. This script is located in the same folder as the copied files in step 2. 

    Update this part
    :UseWinPEPartition
    x:\amd64\ca-osim\sdmpcimg -m TFTP -t #MPCPATH#/camenu/%$WinPEPartition$%
    diskpart /s %$WinPEPartition$%
    if %ERRORLEVEL% NEQ 0 (
      diskpart /s x:\amd64\ca-osim\osimdisk_remove_letterC.txt
      diskpart /s %$WinPEPartition$%
    )
    by this part (2 lines put in comment and 1 added line) :
    :UseWinPEPartition
    REM x:\amd64\ca-osim\sdmpcimg -m TFTP -t #MPCPATH#/camenu/%$WinPEPartition$%
    REM diskpart /s %$WinPEPartition$%
    cscript.exe x:\amd64\ca-osim\DiskPercent.vbs %$WinPEPartition$%
    if %ERRORLEVEL% NEQ 0 (
      diskpart /s x:\amd64\ca-osim\osimdisk_remove_letterC.txt
      diskpart /s %$WinPEPartition$%
    )




  4. Save the file

  5. Create your WinPE boot image. If you have created a WinPE boot image and registered the image in CA Client Automation, run the Update Boot Image wizard in DSM Explorer to update with the customizations. 

  6. In OSIM job, select a WinPEPartition value :

    Use special partition file WIN11.wp1 for Legacy BIOS from CAMENU
    or
    Use special partition file WIN11.wp2 for UEFI from CAMENU



    Diskpart_template_legacy.txt template file is used for Legacy BIOS option
    Diskpart_template_uefi.txt template file is used for UEFI option

Attachments

DiskPercent.vbs get_app
DelandCreate.txt get_app
Movecd.txt get_app
Diskpart_template_uefi.txt get_app
Diskpart_template_legacy.txt get_app