I want to create the new VM so that it has fix DIP from my subnet and virtual network and associated cloud service should have reserved iP.
tried following script
Import-AzurePublishSettingsFile -PublishSettingsFile my.publishsettings Set-AzureSubscription -SubscriptionName "ICM-Genpact US" -SubscriptionId "548****..." -CurrentStorageAccountName "iconunigenstorage" Select-AzureSubscription -SubscriptionName "ICM-Genpact US" $ImageName = (Get-AzureVMImage | Where { $_.ImageFamily -eq "Windows Server 2012 R2 Datacenter" } | sort PublishedDate -Descending | Select-Object -First 1).ImageName $ReservedIP = Get-AzureReservedIP -ReservedIPName "GenpactUnigenVM" New-AzureVMConfig -Name "iconunigen" -InstanceSize "Small" -ImageName $ImageName | Add-AzureProvisioningConfig -Windows -AdminUsername icertisadmin -Password Password#123 | Set-AzureSubnet -SubnetNames "UnigenVMLayer" | Set-AzureStaticVNetIP -IPAddress 192.168.2.44 | New-AzureVM -ServiceName "iconunigen" –ReservedIPName $ReservedIP -Location "genpactdallasnw"
but failing with errors
New-AzureVM : BadRequest: The location constraint is not valid At line:6 char:3+ New-AzureVM -ServiceName "iconunigen" –ReservedIPName $ReservedIP -Location "g ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : CloseError: (:) [New-AzureVM], CloudException+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.PersistentVMs.NewAzureVMCommand New-AzureVM : BadRequest: The Reserved IP Microsoft.WindowsAzure.Commands.ServiceManagement.Model.ReservedIPContext does not exist. At line:6 char:3+ New-AzureVM -ServiceName "iconunigen" –ReservedIPName $ReservedIP -Location "g ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : CloseError: (:) [New-AzureVM], CloudException+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.PersistentVMs.NewAzureVMCommand
Thanks,
Subodh