powercli create a virtual machine function --- Study

This paste test scenarios are described below:
the virtual machines have been provisioned out, the virtual machine configuration, the virtual machine to see whether the configuration according to the requirements specified by the spec boot set-vm -OSCustomizationSpec.

ps: can not use virtual machine custom configuration files in a virtual machine powered on.


Test Summary:
After a virtual machine provisioning out the application OSCustomizationSpec in the off state, to take effect after the boot.


Process Description:

  1. Use of existing virtual machine custom configuration files derive a new temporary profile
    PowerCLI C:\> $OSCusSpec = Get-OSCustomizationSpec -name "Windows OA NEW SID JOIN DOMAIN" | New-OSCustomizationSpec -nam
    e "oaCustSpec" -Type NonPersistent

    powercli create a virtual machine function --- Study

  2. By Set-OSCustomizationNicMapping command to configure the IP address and other information in OSCustomizationSpec
    PowerCLI C:\> $OSCusSpec | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress '10.29.35.220' -SubnetMask '255.255.255.0' -DefaultGateway '10.29.35.1' -Dns '10.0.0.97'

      

  3. By applying custom set-vm Specification
    PowerCLI C:\> get-vm -Name vmoscus | set-vm -OSCustomizationSpec $OSCusSpec

Guess you like

Origin blog.51cto.com/sampsondotqiu/2473559