Automation

 View Only
  • 1.  Customization Spec Vs powershell scripts

    Posted Aug 24, 2020 04:58 PM

    Hi LucD​,

    I need to automate network setting on VMs.

    Am trying to decide which of the below two methods is best suited for

    Network Setting on VMs

    using VM Customization SpecPower shell scripts using  Invoke-Vm script
    Doesnt require VM passwordsRequires VM password
    better suited for fresh VM clone or VM from templates ?? On existing VM ??
    ....

    Based on your experience and awareness, could you help me with below qns

    Which of the two is widely used  ? Do you think there is a preferred approach for  network setting ?

    Is there any specific condition in which each of these approaches should be used ?

    Any merits and demerits for each approach other than password  ?

    Thanks,

    Arvind



  • 2.  RE: Customization Spec Vs powershell scripts

    Posted Aug 24, 2020 05:13 PM

    Which Guest OS are we talking about?



  • 3.  RE: Customization Spec Vs powershell scripts

    Posted Aug 24, 2020 05:18 PM

    That would be any of below flavors

    1. Linux [CentOS 6.x , 7.x  Rhel 6.x 7.x Ubuntu 16.04 , SUSE 12,15]
    2. Windows 7/8/10, Windows Server 2012_r2, Server 2016

    Regards,

    Arvind



  • 4.  RE: Customization Spec Vs powershell scripts

    Posted Aug 24, 2020 05:54 PM

    The major issue with Invoke-VMScript, besides the password, is that it does not support multi-line bash scripts currently.

    As an alternative, you could look at my Invoke-VMScriptPlus function.

    A drawback with OScustomizationSpec is that it does not cover all OS configuration features for Linux systems.

    As an alternative for that, you could use pre- and post-customization scripts.

    But then you are very close to using Invoke-VMScript(Plus) but without the password.

    What I usually do:

    - when the target Guest OS is Windows I use an OSCustomizationSpec

    - the network part might become tricky when a VM has multiple vNICs. Then I tend to use Invoke-VMScript to run the network config via netssh (or some similar command)

    - when the target Guest OS is Linux I a common deployment mechanism, like for example cloud-init.

    - For fine-tuning a Linux Guest OS I use my Invoke-VMScriptPlus function