Renaming with Windows 1607 Update

  1. 2 years ago

    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?

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

  2. clonedeploy

    14 Nov 2016 Administrator

    Does the deploy log give any clues?

  3. 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.

    Thanks.

  4. clonedeploy

    14 Nov 2016 Administrator

    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.

  5. 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.

    Thanks!

  6. 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.

  7. 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.

  8. clonedeploy

    16 Nov 2016 Administrator

    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 panther in search box
    You should come across some script that looks like this

    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
      fi
      
      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 
    	done
    	unix2dos /mnt/ntfs/Windows/Panther/unattend.xml
    	#Not sure if this elif is really needed

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

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

    It should now look like this

    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
      fi
      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

    Click update
    Deploy the machine again
    attach the log

  9. 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.

  10. 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.

  11. clonedeploy

    17 Nov 2016 Administrator

    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

  12. Here you go.

  13. clonedeploy

    17 Nov 2016 Administrator

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

  14. Ok, just a min.

  15. 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?

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

  17. clonedeploy

    17 Nov 2016 Administrator

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

    if [ -f "/mnt/ntfs/Windows/Panther/unattend.xml" ] || [ -f "/mnt/ntfs/Windows/panther/unattend.xml" ]; then
  18. Updated cd_push with changed if statements. Tested and working with 1607 and older.

  19. last year

    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.

  20. clonedeploy

    24 Feb 2017 Administrator

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

  21. Newer ›
 

or Sign Up to reply!