Automation

 View Only
  • 1.  Wait Task and Onwards

    Posted Jun 08, 2017 06:00 PM

    Here is what Im trying to accomplish:

    1.) Create VM - Done

    2.) Power on VM - Done

    3.)The VM is sysprepped so it boots to the Windows EULA screen. I need manual intervention here to next through the EULA and set Admin password. (unless you know of an automated way to do this)

         - Have the script wait

    4.) Once on the windows desktop, I need the following:

    - Update Tools

    - Set 4 different NIC names and manual IP addresses

    - Set some NIC settings

    - Rename machine

    -Set Licensing

    What Im confused about is the order of things to be scripted.

    Since Im starting in the EULA screen and need manual intervention I would need the Wait-Task after VM power on.

    Then, in order to do anything on the VM, wont I need to rename it and give the "mgmt" NIC an IP to manipulate anything in it using Invoke-Script? Or can I do this without connectivity?

    Im trying to use a ping test with the Wait-Task to wait until a ping is completed and then move forward with other automation but very confused how to run through these steps logically.

    Any help would be appreciated

    Thank you



  • 2.  RE: Wait Task and Onwards

    Posted Jun 08, 2017 06:28 PM

    Not sure why you have to wait for the EULA screen, that is normally automated through the OSCustomizationSpec (which is applied through a sysprep).

    You can use events to monitor the completion of OSCustomizationSpec application.

    See for example Vitali's classic post named Waiting for OS customization to complete

    There is more advanced example in PowerCLI Script – Deploy VMs and Configure the Guest OS

    And there are numerous other examples of this concept to be found on several blogs, Google is your friend :smileygrin:



  • 3.  RE: Wait Task and Onwards

    Posted Jun 08, 2017 06:31 PM

    Isnt OSCustomSpec only available through vCenter?

    Im using standalone hosts to accomplish this.



  • 4.  RE: Wait Task and Onwards

    Posted Jun 08, 2017 06:41 PM

    OMG, you poor soul :smileycry:
    Yes, OSCustomization is only available through vCenter.

    But you can still use part of the solution.

    3) You can use a sysprep.inf that automates the EULA (OemSkipEula = Yes) and Administrator password (AdminPassword = '"xyz").

    You will now have to find another way to determine that the sysprep is completed.

    4) You can run Guest OS customisation scripts through the Invoke-VMScript cmdlet, but first you will need to have the VMware Tools installed and running before that works.

    I have used the [GuiRunOnce] section in sysprep.inf to install VMware Tools at the first (auto-)logon.



  • 5.  RE: Wait Task and Onwards

    Posted Jun 08, 2017 06:48 PM

    Yeah I know, what Im trying to accomplish doesnt use vCenter so it complicates things a bit.

    Ill look ito what you mention and see if I can get this going.

    Thank you



  • 6.  RE: Wait Task and Onwards

    Posted Jun 08, 2017 07:05 PM

    Sure, feel free to ask if you get stuck.