Hi everyone, Yuvraj Attarde here and today I ‘d like to pass along a trip on how to easily assign an IP address using PowerShell during deployments in System Center 2012 Virtual Machine Manager. Let’s say for example that you have the requirement to assign an IP address specified as a PowerShell parameter during VM deployment. You could use the cmdlets Grant-SCIpaddress and Set-SCIPAddress to assign the IP address from the IP Pool to the VM, the only problem is that the IP address doesn’t automatically get activated on the VM. A better alternative is to assign the IP address using the Get-SCVirtualNetworkAdapterConfiguration and Set-SCVirtualNetworkAdapterConfiguration cmdlets and I have an example of this below:
NOTE: Replace the VMtemplate and Testvm3 with the appropriate template and VM names respectively.
You can find more information on Set-SCVirtualNetworkAdapterConfiguration here: http://technet.microsoft.com/en-us/library/hh801707.aspx
Yuvraj Attarde | Senior Support Escalation Engineer | Microsoft CTS Management and Security Division
Get the latest System Center news on Facebook and Twitter:
System Center All Up: http://blogs.technet.com/b/systemcenter/ System Center – Configuration Manager Support Team blog: http://blogs.technet.com/configurationmgr/ System Center – Data Protection Manager Team blog: http://blogs.technet.com/dpm/ System Center – Orchestrator Support Team blog: http://blogs.technet.com/b/orchestrator/ System Center – Operations Manager Team blog: http://blogs.technet.com/momteam/ System Center – Service Manager Team blog: http://blogs.technet.com/b/servicemanager System Center – Virtual Machine Manager Team blog: http://blogs.technet.com/scvmm
Windows Intune: http://blogs.technet.com/b/windowsintune/ WSUS Support Team blog: http://blogs.technet.com/sus/ The AD RMS blog: http://blogs.technet.com/b/rmssupp/
The Forefront Endpoint Protection blog : http://blogs.technet.com/b/clientsecurity/ The Forefront Identity Manager blog : http://blogs.msdn.com/b/ms-identity-support/ The Forefront TMG blog: http://blogs.technet.com/b/isablog/ The Forefront UAG blog: http://blogs.technet.com/b/edgeaccessblog/
This is fantastic, however I would love to know how to change the IP during a p2v. I'm assigning one from our ip pool, it's shown on the VM profile, yet the OS isn't changed.
Using your example I get the following error from New-SCVirtualMachine.
Is it possible to assign a static IP during VM template deployment without using an IP pool?
New-SCVirtualMachine : A static IPv4 address or IPv4 address pool is specified
for a virtual network adapter that was configured for a dynamic IPv4 address.
(Error ID: 10737)
Do not specify an IPv4 address or IPv4 address pool using
Set-SCVirtualNetworkAdapterConfiguration, or configure the virtual network
adapter for a static IPv4 address.