15
Page 1 Clone, Windows with single NIC Clones a Windows virtual machine, performs guest operating system customization and configures one virtual network card. Sysprep tools must be available on vCenter Server system. 1. Versions Version Date User Comment 0.2.1 Nov 6, 2013 Internal Imported from content from package Current version:0.2.1 2. Inputs Name Type Description folder* VC:VmFolder Virtual machine folder name* string New virtual machine name vm* VC:VirtualMachine Virtual machine to clone powerOn* boolean Specifies whether or not to power on the new virtual machine template* boolean Specifies whether or not to mark the new virtual machine as a template datastore* VC:Datastore Datastore in which to store the virtual machine. If not specified, the current datastore is used host VC:HostSystem (Optional) Host on which to create the virtual machine pool VC:ResourcePool (Optional) Resource pool in which to create the virtual machine doSysprep boolean Run the Sysprep operations and wait for the task to complete. Not used if the virtual machine is marked as template Clone, Windows with single NIC vCO Workflow Documentation - Dec 1, 2013

Clone, Windows With Single NIC

Embed Size (px)

DESCRIPTION

Vmware orchestrator

Citation preview

Page 1: Clone, Windows With Single NIC

Page 1

Clone, Windows with single NICClones a Windows virtual machine, performs guest operating systemcustomization and configures one virtual network card. Sysprep tools must be available on vCenter Server system. 1. Versions

Version Date User Comment

0.2.1 Nov 6, 2013 Internal Imported from content from package

Current version:0.2.1 2. Inputs

Name Type Description

folder* VC:VmFolder Virtual machine folder

name* string New virtual machine name

vm* VC:VirtualMachine Virtual machine to clone

powerOn* boolean Specifies whether or not to poweron the new virtual machine

template* boolean Specifies whether or not to markthe new virtual machine as atemplate

datastore* VC:Datastore Datastore in which to store thevirtual machine. If not specified,the current datastore is used

host VC:HostSystem (Optional) Host on which to createthe virtual machine

pool VC:ResourcePool (Optional) Resource pool in whichto create the virtual machine

doSysprep boolean Run the Sysprep operations and waitfor the task to complete. Not usedif the virtual machine is marked astemplate

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 2: Clone, Windows With Single NIC

Page 2

Name Type Description

clientName* string Name or prefix name of the Windowsclient

productId* string Microsoft Sysprep requires that avalid serial number be included inthe answer file when mini-setupruns. This serial number is ignoredif the original guest operatingsystem was installed using avolume-licensed CD

joinDomain string (Optional) The domain that thevirtual machine should join. Ifthis value is supplied, thendomainAdmin and domainAdminPasswordmust also be supplied, and theworkgroup name must be empty

joinWorkgroup string (Optional) The workgroup that thevirtual machine should join. Ifthis value is supplied, then thedomain name and authenticationfields must be empty

domainAdmin* string (Optional) This is the domain useraccount used for authentication ifthe virtual machine is joining adomain. The user does not need tobe a domain administrator, but theaccount must have the privilegesrequired to add computers to thedomain

domainAdminPassword* string The password string. It isencrypted if the associatedplainText flag is false

licenseMode* VC:CustomizationLicenseDataMode

Server licensing mode

licenseUsers* number This key is valid only if AutoMode= PerServer

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 3: Clone, Windows With Single NIC

Page 3

Name Type Description

newAdminPassword* string The password string. It isencrypted if the associatedplainText flag is false

inTimezone* Enums:MSTimeZone Timezone for the newly createdvirtual machine

network VC:Network Network on which to attach thevirtual network interface

dnsServerList Array/string (Optional) List of DNS servers fora virtual network adapter with astatic IP address

dnsDomain string (Optional) DNS domain suffix suchas vmware.com

dhcp* boolean Use a DHCP server to configure thevirtual network adapter

gateway Array/string (Optional) List of gateways, inorder of preference

ipAddress string Fixed valid IP address

macAddress string (Optional) The MAC address of anetwork adapter being customized.If it is not included, thecustomization process maps thesettings from the virtual machine'snetwork adapters, in PCI slot order

netBIOS VC:CustomizationNetBIOSMode

(Optional) NetBIOS setting forWindows

primaryWINS string (Optional) The IP address of theprimary WINS server. This propertyis ignored for Linux guestoperating systems

secondaryWINS string (Optional) The IP address of thesecondary WINS server. Thisproperty is ignored for Linux guestoperating systems

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 4: Clone, Windows With Single NIC

Page 4

Name Type Description

subnetMask string (Optional) Subnet mask for thisvirtual network adapter

orgName* string Organization name

fullName* string User's full name

*Parameter is mandatory 3. Outputs

Name Type Description

newVM VC:VirtualMachine The newly created virtual machine

4. Attributes

Name Type Description

task VC:Task Task to await

progress boolean Log progress while waiting for thetask to complete

pollRate number Polling rate for the task state, inseconds

spec Any Specifies how to clone the virtualmachine(VimVirtualMachineCloneSpec)

location Any Specifies the location of resourcesthe cloned virtual machine will beusing (VirtualMachineRelocateSpec)

customization Any Optional guest operating systemcustomization specification(CustomizationSpec)

globalIPSettings Any Global IP settings constitute theIP settings that are not specificto a particular virtual networkadapter(VimCustomizationGlobalIPSettings)

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 5: Clone, Windows With Single NIC

Page 5

Name Type Description

identity Any Network identity and settings,similar to Microsoft's Syspreptool. This is a Sysprep, LinuxPrep,or SysprepText object(VimCustomizationIdentitySettings)

nicSettingMaps Array/Any (Optional) IP settings that arespecific to a particular virtualnetwork adapter (an array ofVimCustomizationAdapterMapping)

options Any Optional operations(VimCustomizationOptions:LinuxOptions or WinOptions)

autoLogon boolean Flag to determine whether or notthe machine automatically logs onas Administrator

timeZone number The time zone for the new virtualmachine. Numbers correspond to timezones listed in sysprepdocumentation

adapterMapping Any Data object type to associate avirtual network adapter with its IPsettings

startVm boolean Specifies whether to start thecloned virtual machine. Depends onthe values set for 'template','doSysprep' and 'powerOn'attributes

tempNewVm VC:VirtualMachine The newly created virtual machine

pollingRate number Polling rate for the task state, inseconds

timeout number Timeout period to elapse beforethrowing a timeout exception, inminutes

sourceVirtualEthernetCard

Any The VirtualEthernetCard thetemplate defines

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 6: Clone, Windows With Single NIC

Page 6

Name Type Description

virtualEthernetCard Any The VirtualEthernetCard instancethe virtual machine uses

config Any (Optional) Specification of changesto the virtual hardware(VirtualMachineConfigSpec)

deviceChange Array/Any (Optional) Set of virtual devicesbeing modified by the configurationoperation (an array ofVirtualDeviceConfigSpec)

addNumberToName boolean Append a number to the client nameto ensure the name is unique

nicPosition number Specifies which network card touse. If no valid value, the firstnetwork card is used

targetDatastore VC:Datastore Datastore in which to store thevirtual machine

templateAttr boolean Specifies whether or not to markthe new virtual machine as atemplate

5. Parameter presentation

Parameter Description Parameter Info

vm Virtual machine toclone

Mandatory input: true

name Name of the newvirtual machine

Mandatory input: true

template Mark the newvirtual machine asa template

Mandatory input: true

powerOn Power on the newvirtual machine

Mandatory input: true

pool Resource pool

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 7: Clone, Windows With Single NIC

Page 7

Parameter Description Parameter Info

host Host

folder Virtual machinefolder

Mandatory input: true

datastore Datastore in whichto store thevirtual machine. Ifnot specified, thecurrent datastoreis used

Mandatory input: false

fullName User's full name Mandatory input: true

orgName Organization name Mandatory input: true

doSysprep Run the Sysprepoperations and waitfor the task tocomplete. Not usedif the virtualmachine is markedas template

Default value: !#template

clientName Name or prefix nameof the Windowsclient

Mandatory input: true

newAdminPassword New localadministratorpassword

Mandatory input: true

inTimezone Timezone for thenewly createdvirtual machine

Mandatory input: true

productId Windows key(ignored iftemplate key isVLK)

Mandatory input: false

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 8: Clone, Windows With Single NIC

Page 8

Parameter Description Parameter Info

licenseMode Server licensingmode

Mandatory input: true Default value:dunes://service.dunes.ch/CustomSDKObject?id='perSeat'&dunesName='VC:CustomizationLicenseDataMode'

licenseUsers Number of licenses(only if Licensemode = PerServer)

Mandatory input: true Default value: 5.0

joinDomain Domain name to join

joinWorkgroup Workgroup name tojoin

domainAdmin Domain user accountused forauthentication ifthe virtual machineis joining a domain

Mandatory input: #joinDomain !=null && #joinDomain != ""

domainAdminPassword Password string toaccess the domain

Mandatory input: #joinDomain !=null && #joinDomain != ""

macAddress The MAC address ofa network adapterbeing customized

network Network on which toattach the virtualnetwork interface

Default value:GetAction("com.vmware.library.vc.vm.network","getNetworkForGivenNic").call( #vm , 1.0)

dhcp Use a DHCP serverto configure thevirtual networkadapter

Mandatory input: true

ipAddress Fixed valid IPaddress

subnetMask Subnet mask forthis virtualnetwork adapter

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 9: Clone, Windows With Single NIC

Page 9

Parameter Description Parameter Info

gateway List of gateways,in order ofpreference

dnsDomain DNS domain suffixsuch as vmware.com

dnsServerList List of DNS serversfor a virtualnetwork adapterwith a static IPaddress

netBIOS NetBIOS setting forWindows

primaryWINS The IP address ofthe primary WINSserver

secondaryWINS The IP address ofthe secondary WINSserver

6. Workflow schema

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 10: Clone, Windows With Single NIC

Page 10

7. Workflow items

Name Type Next item Description

checkVMwareInput

WorkflowItemTask Set startvm?

vim3WaitTaskEnd

WorkflowItemTask Set ouput vm Wait a VIM 3 Task to end.When task ended, return the

cloneVM WorkflowItemTask vim3WaitTaskEnd

getCloneSpec WorkflowItemTask cloneVM

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 11: Clone, Windows With Single NIC

Page 11

Name Type Next item Description

Get WindowsCustomization (Sysprep)

WorkflowItemLink Get 1 NicSetting Map

getRelocateSpec

WorkflowItemTask getNicByNumber

getCustomizationSpec

WorkflowItemTask getRelocateSpec

getCustomizationGlobalIPSettings

WorkflowItemTask Get WindowsCustomization (Sysprep)

Get 1 NicSetting Map

WorkflowItemLink Nic -> Nic[]

Nic -> Nic[] WorkflowItemTask getCustomizationSpec

Get Timezonein Number

WorkflowItemTask getCustomizationGlobalIPSettings

Set startvm?

WorkflowItemTask Get Timezonein Number

Template? WorkflowItemGenericCondition

Mark asTemplate

Set ouput vm WorkflowItemTask Template?

WorkflowItemEnd

Do sysprep? WorkflowItemGenericCondition

vim3WaitDnsNameInTools

WorkflowItemEnd

Power on? WorkflowItemGenericCondition

WorkflowItemEnd

WorkflowItemEnd

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 12: Clone, Windows With Single NIC

Page 12

Name Type Next item Description

Get aVirtualEthernetCard tochange thenetwork

WorkflowItemLink Get Device[]

Nic found? WorkflowItemGenericCondition

Networkdefined

Get Device[] WorkflowItemTask getConfigSpecSimple

getConfigSpecSimple

WorkflowItemTask getCloneSpec The ConfigSpec data object typeencapsulates configurationsettings when creating orreconfiguring a virtual machine.To support incremental changes,these properties are alloptional.Basic Version

vim3WaitDnsNameInTools

WorkflowItemTask Power on? Wait for a given name in the DNSguest informations (VMwaretools). Exception:- Timeout: When timeout isreached

getNicByNumber

WorkflowItemTask Nic found? Return a Network card device(VimVirtualE1000,VimVirtualVmxnet,VimVirtualPCNet32). The networkposition let you choose if youwant to get the 1st, 2nd... 5thnetwork card.

Shutdownguest OS andwait

WorkflowItemLink Shutdown guest OS and wait.

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 13: Clone, Windows With Single NIC

Page 13

Name Type Next item Description

Networkdefined

WorkflowItemGenericCondition

Get aVirtualEthernetCard tochange thenetwork

Setdatastore ifnull

WorkflowItemTask checkVMwareInput

Mark asTemplate

WorkflowItemLink Mark an existing VM as atemplate, preventing it to start

8. Source code for the used actions 8.1. checkVMwareInput //Auto generated script, cannot be modified !

System.getModule("com.vmware.library.vc.vm.spec").checkVMwareInput(vm,folder,datastore,hos

t,pool) ;

8.2. vim3WaitTaskEnd //Auto generated script, cannot be modified !

actionResult =

System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task,progress,pollRate) ;

8.3. cloneVM //Auto generated script, cannot be modified !

actionResult = System.getModule("com.vmware.library.vc.vm").cloneVM(vm,folder,name,spec) ;

8.4. getCloneSpec //Auto generated script, cannot be modified !

actionResult =

System.getModule("com.vmware.library.vc.vm.spec").getCloneSpec(config,customization,locati

on,powerOn,template) ;

8.5. getRelocateSpec

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 14: Clone, Windows With Single NIC

Page 14

//Auto generated script, cannot be modified !

actionResult =

System.getModule("com.vmware.library.vc.vm.spec").getRelocateSpec(datastore,disk,host,pool

,transform) ;

8.6. getCustomizationSpec //Auto generated script, cannot be modified !

actionResult =

System.getModule("com.vmware.library.vc.vm.spec").getCustomizationSpec(globalIPSettings,id

entity,nicSettingMap,options) ;

8.7. getCustomizationGlobalIPSettings //Auto generated script, cannot be modified !

actionResult =

System.getModule("com.vmware.library.vc.vm.spec").getCustomizationGlobalIPSettings(dnsServ

erList,dnsSuffixList) ;

8.8. Nic -> Nic[] nicSettingMaps = new Array(adapterMapping);

8.9. Get Timezone in Number timeZone = inTimezone.id;

8.10. Set start vm? if (template) {

startVm = false;

}

else if (doSysprep) {

startVm = true;

}

else {

startVm = powerOn;

}

8.11. Set ouput vm

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013

Page 15: Clone, Windows With Single NIC

Page 15

newVM = tempNewVm;

8.12. Get Device[] var deviceChange = new Array();

var change = new VcVirtualDeviceConfigSpec();

change.device = virtualEthernetCard;

change.operation = VcVirtualDeviceConfigSpecOperation.edit;

deviceChange.push(change);

8.13. getConfigSpecSimple //Auto generated script, cannot be modified !

actionResult =

System.getModule("com.vmware.library.vc.vm.spec").getConfigSpecSimple(deviceChange,files,f

lags,memoryMB,name,numCPUs) ;

8.14. vim3WaitDnsNameInTools //Auto generated script, cannot be modified !

System.getModule("com.vmware.library.vc.vm.tools").vim3WaitDnsNameInTools(vm,pollingRate,d

nsNameToWait,timeout,addNumberToName) ;

8.15. getNicByNumber //Auto generated script, cannot be modified !

actionResult =

System.getModule("com.vmware.library.vc.vm.network").getNicByNumber(vm,nicPosition) ;

8.16. Set datastore if null if (datastore != null) {

targetDatastore = datastore;

}

else {

targetDatastore = vm.datastore[0];

}

Clone, Windows with single NIC

vCO Workflow Documentation - Dec 1, 2013