none
Successful Cloning Strategy - Zero Touch Installation RRS feed

  • General discussion

  • Well, I’m sharing here the results of my tests of WSS2.5 Final Release, for deploying a large number of computers, with zero touch installation.

    If you follow the handbook starting in page 54, “Installing Windows SteadyState on Multiple

    Computers”, it will just be fine until the part that we turn on Disk Protection. This needs special attention when cloning.

    I started the tests, acquiring the model image with WSS already enabled. That was a wrong approach because of the large cache file in disk, Cache.WDP and because of the extra info in the image consuming more space. In fact, that was the big mistake.

    The model image must be acquired with Disk Protection Disabled. After cloning the image through all of your computers, the key is to run remotely the batch file:

     

    WDP_ENABLE.CMD

    Code Snippet
    rem Windows Disk Protection Command-line Parameters
    rem
    rem Enable WDP
    "C:\Program Files\Windows SteadyState\SCTUI.exe" /EnableWDPAndReboot

     

     

    After that, if we want to manage the way WDP behaves, it can be done with the Disk Protection API, described in page 65 of the WSS handbook.

    I created/altered three scripts that I put on my client computers, through witch I manage remotely using remote execution:

     

    wdpStatus.vbs

    Code Snippet

     

    ' ********************************************************
    ' *** ------------------------------------------------------------------------------
    ' *** Filename:     wdpStatus.vbs
    ' *** ------------------------------------------------------------------------------
    ' *** Description:  Gives Status of Windows Disk Protection
    ' *** ------------------------------------------------------------------------------
    ' *** Version:      1.0
    ' *** Author: Daniel Reis
    ' *** Email:
    daniel@fe.up.pt       
    ' *** ------------------------------------------------------------------------------
    ' *** Date: 12/06/2008
    ' *** ------------------------------------------------------------------------------
    ' ********************************************************
    ' Windows Disk Protection Properties Description
    ' Current Status
     ' WDP_ACTIVE (0)
     ' WDP_PASSIVE (1) 
    'Current Mode
     ' WDP_MODE_DISCARD (0) - Remove All Changes at Restart
     'WDP_MODE_PERSIST (1) - Retain Changes Temporarily
     ' WDP_MODE_COMMIT (2) - Retain All Changes Permanently
    ' ********************************************************

    On Error Resume Next

    Const WDP_ACTIVE = 0

    'Return Values
    Const WDP_MODE_DISCARD = 0
    Const WDP_MODE_PERSIST = 1
    Const WDP_MODE_COMMIT = 2

    ' My Return Values
    Const WDP_DISABLED = 100
    const WDP_UNKNOWN = 99

    ' Identify the computer to manage
    Dim strComputer
    strComputer = "."  ' Local Camputer

    ' Initialize the return value
    wdpStatus = WDP_UNKNOWN

    '  Management Objects
    Const wbemFlagReturnImmediately = &h10
    Const wbemFlagForwardOnly = &h20
    Set objWbemServices = GetObject ("winmgmts:\\" & strComputer & "\root\wmi")
    Set setWdpObjects   = objWbemServices.ExecQuery("SELECT * FROM WDP_CONTROL", "WQL",wbemFlagReturnImmediately + wbemFlagForwardOnly)

    For Each objWdp In setWdpObjects 
     If objWdp.CurrentStatus = WDP_ACTIVE Then
      Wscript.Echo "CurrentMode:" & objWdp.CurrentMode
      wdpStatus =  objWdp.CurrentMode 
     End If 
    Next


    If Err.Number <> 0 Then
     ' Error Ocurred, Let's see if it's object required, meanig that the class doesn't exist
     If Err.Number = 424 Then
      ' WDP Is Disabled
      Wscript.echo "Windows Disk Protection is Disabled"
      wdpStatus = WDP_DISABLED
     Else
      'Another Error
      Wscript.echo "Error: " & Err.Description
      Wscript.echo "Return Status: " & WDP_UNKNOWN
      wdpStatus = WDP_UNKNOWN
     End If
    End If

     

      

    wdpOn.vbs 

    Code Snippet

    ' ***
    ' *** ------------------------------------------------------------------------------
    ' *** Filename:     wdpOn.vbs
    ' *** ------------------------------------------------------------------------------
    ' *** Description:  After Windows Disk Protection is Activated,
    ' ***                        updates its state to Discard Changes
    ' *** ------------------------------------------------------------------------------
    ' *** Version:      1.0
    ' *** Author: Daniel Reis
    ' *** Email:
    daniel@fe.up.pt       
    ' *** ------------------------------------------------------------------------------
    ' *** Date: 12/06/2008
    ' *** ------------------------------------------------------------------------------
    ' ***
    ' ********************************************************
    ' Windows Disk Protection Properties Description
    ' Current Status
     ' WDP_ACTIVE (0)
     ' WDP_PASSIVE (1) 
    'Current Mode
     ' WDP_MODE_DISCARD (0) - Remove All Changes at Restart
     'WDP_MODE_PERSIST (1) - Retain Changes Temporarily
     ' WDP_MODE_COMMIT (2) - Retain All Changes Permanently
    ' ********************************************************

    On Error Resume Next

    ' Identify the computer to manage
    Const strComputer= "."

    Const WDP_MODE_DISCARD = 0

    Const SUCCESS = 0
    Const FAILURE = 1


    set objWbemServices = GetObject ("winmgmts:\\" & strComputer & "\root\wmi")
    set setWdpObjects   = objWbemServices.ExecQuery ("SELECT * FROM WDP_Control")

    For Each objWdp In setWdpObjects
     objWdp.CurrentMode  = WDP_MODE_DISCARD
        objWdp.Put_  
    Next

    If Err.Number <> 0 Then
     Wscript.echo "FAILURE"
     Return FAILURE
    Else
     Wscript.echo "SUCCESS"
     Return SUCCESS
    End If

     

     


     

    wdpOff.vbs

     

    Code Snippet

    ' ***
    ' *** ------------------------------------------------------------------------------
    ' *** Filename:     wdpOff.vbs
    ' *** ------------------------------------------------------------------------------
    ' *** Description:  After Windows Disk Protection is Activated,
    ' ***                        updates its state to Commit Changes
    ' *** ------------------------------------------------------------------------------
    ' *** Version:      1.0
    ' *** Author: Daniel Reis
    ' *** Email:
    daniel@fe.up.pt       
    ' *** ------------------------------------------------------------------------------
    ' *** Date: 12/06/2008
    ' *** ------------------------------------------------------------------------------
    ' ********************************************************
    ' Windows Disk Protection Properties Description
    ' Current Status
     ' WDP_ACTIVE (0)
     ' WDP_PASSIVE (1) 
    'Current Mode
     ' WDP_MODE_DISCARD (0) - Remove All Changes at Restart
     'WDP_MODE_PERSIST (1) - Retain Changes Temporarily
     ' WDP_MODE_COMMIT (2) - Retain All Changes Permanently
    ' ********************************************************


    On Error Resume Next

    ' Identify the computer to manage
    Const strComputer= "."

    Const WDP_MODE_COMMIT = 2

    Const SUCCESS = 0
    Const FAILURE = 1


    set objWbemServices = GetObject ("winmgmts:\\" & strComputer & "\root\wmi")
    set setWdpObjects   = objWbemServices.ExecQuery ("SELECT * FROM WDP_Control")

    For Each objWdp In setWdpObjects
     objWdp.CurrentMode  = WDP_MODE_COMMIT
        objWdp.Put_ 
    Next

    If Err.Number <> 0 Then
     Wscript.echo "FAILURE"
     Return FAILURE
    Else
     Wscript.echo "SUCCESS"
     Return SUCCESS
    End If

     

     

     

    If I need to remove Disk Protection I use the following batch file:

     

    WDP_DISABLE.CMD 

    Code Snippet

    rem Windows Disk Protection Command-line Parameters
    rem
    rem Disable WDP

    "C:\Program Files\Windows SteadyState\SCTUI.exe" /DisableWDPAndReboot

     

     

     

    These tests were made in XP, next thing is to test it on Vista.

    If someone has questions or suggestions…

    Thursday, June 12, 2008 5:11 PM