Renaming with Windows 1607 Update

  • I'm trying to update my images to the new 1607 Windows update. I'm using exactly the same method as previously, however CloneDeploy is not finding my unattend.xml file to rename the computer when doing the restore. Is anyone else having this issue?

  • Does the deploy log give any clues?

  • I just looked through it. It can't find the xml file, but it is in the exact same place - I use a custom script to do the prepping, at it works on the older build of Win10, but not the 1607 build. Did sysprep change maybe?

    I attached the log file if you want to take a look at it. I'm fine with doing the rename by registry - just not sure where to start on that.


  • CloneDeploy looks for the sysprep answer file at C:\Windows\Panther\unattend.xml

    After you run sysprep Windows copies the unattend.xml to that location and then CloneDeploy modifies it. It is possible that something changed with build 1607.

    Is it possible for you to run sysprep on that machine and then connect the hd to another machine to see if the file exists at that location? It is also case sensitive. It can't be done after startup because Windows deletes the file after sysprep has run on the deployed machine.

  • Ok, that makes since. Maybe sysprep isn't copying it to that location. I was using the old location for Crucible c:\windows\system32\sysprep\unattend.xml

    I'll make some changes to my .bat file for prepping and see if that helps.


  • Ok, so I tried it again with my unattend.xml in the c:\windows\panther directory. Same outcome. I'm going to do what you recommended and see if the file is there before the first boot after a restore and get back to you.

  • Update:

    The file is there, but for some reason clone deploy can't modify it. I sure hope we can figure this out, I need to update my images to the new build of Windows.

    Thanks again.

  • We need to add some additional logging.
    WebUI->Global->Imaging Scripts->Edit Core Scripts
    Select cd_global_functions from the drop down
    Click in the script box
    Press ctrl+f
    enter [b]panther[/b] in search box
    You should come across some script that looks like this
    [code]local partition="$1"
    log " ** Processing Sysprep Tags On $partition ** " "display"
    sleep 5
    mkdir /mnt/ntfs &> /dev/null
    umount /mnt/ntfs
    ntfs-3g -o force,rw,remove_hiberfile $partition /mnt/ntfs &>/dev/null
    if [ "$?" != "0" ]; then
    log "Could Not Mount NTFS To Change Answer File"
    return 1

    if [ -f "/mnt/ntfs/Windows/Panther/unattend.xml" ]; then
    log " ...... Found Answer File At /Windows/Panther/unattend.xml, Updating Answer File" "display"
    for tag_id in $sysprep_tags; do
    sysprep_tag_json=$($curlAuth --data "tagId=$tag_id&imageEnvironment=lin" "${web}GetSysprepTag" $curlEnd)
    log "$sysprep_tag_json"
    eval echo -e $(parse_json "$sysprep_tag_json" .Contents) > /tmp/syspreptag
    cat /tmp/syspreptag >> $CLIENT_LOG
    perl -0777 -i -pe "s/($(parse_json "$sysprep_tag_json" .OpeningTag)).*($(parse_json "$sysprep_tag_json" .ClosingTag))/${1}$(cat /tmp/syspreptag)${2}/si" /mnt/ntfs/Windows/Panther/unattend.xml
    unix2dos /mnt/ntfs/Windows/Panther/unattend.xml
    #Not sure if this elif is really needed[/code]

    Add the following lines before [code]if [ -f "/mnt/ntfs/Windows/Panther/unattend.xml" ]; then[/code]

    [code]ls -lh /mnt/ntfs/Windows/Panther &>> $CLIENT_LOG
    head -n 5 /mnt/ntfs/Windows/Panther/unattend.xml &>> $CLIENT_LOG[/code]

    It should now look like this
    [code]local partition="$1"
    log " ** Processing Sysprep Tags On $partition ** " "display"
    sleep 5
    mkdir /mnt/ntfs &> /dev/null
    umount /mnt/ntfs
    ntfs-3g -o force,rw,remove_hiberfile $partition /mnt/ntfs &>/dev/null
    if [ "$?" != "0" ]; then
    log "Could Not Mount NTFS To Change Answer File"
    return 1
    ls -lh /mnt/ntfs/Windows/Panther &>> $CLIENT_LOG
    head -n 5 /mnt/ntfs/Windows/Panther/unattend.xml &>> $CLIENT_LOG

    if [ -f "/mnt/ntfs/Windows/Panther/unattend.xml" ]; then[/code]

    Click update
    Deploy the machine again
    attach the log

  • Ok - I'm migrating my VM to a new VCenter, as soon as that has completed I'll redeploy and then upload the log.

    Thank you.

  • It doesn't seem like there is anything else in the log after the update of the scripts. But I've attached the file anyway.

  • No it's not there. Are you sure the script updated? Can you attach your script, it is located in your clonedeploy web directory\private\clientscripts\cd_global_functions

  • Here you go.

  • Sorry my fault, forgot there are two locations for the sysprep file. You also need to edit cd_push. It should be similar.

  • Ok, just a min.

  • Apparently in 1607 the Panther directory is all lowercase. I changed Panther to panther in cd_push and it works now.

    Can we add some more elif statements to look in both locations?

  • You can see it can't find Windows/Panther with the added commands you had me put into cd_push

  • We can just change the if statement to this. I'll add in the next patch also

    [code]if [ -f "/mnt/ntfs/Windows/Panther/unattend.xml" ] || [ -f "/mnt/ntfs/Windows/panther/unattend.xml" ]; then[/code]

  • Updated cd_push with changed if statements. Tested and working with 1607 and older.

  • FYI..

    This file was NOT updated in the 1.2.1 update. I had to re-modify the cd_push to fix the issue again. Please include this fix in future updates and patches.

    Thank you.

  • It's not in cd_push? It looks like it is, line 757.