0
votes

Can we have a Static Internal IP address with VNet and Reserved IP address together at a time in a VM ?

I am getting the below error when we create a VM with reserved IP on a particular sub-net

New-AzureVM : BadRequest: The virtual network ID cannot be null or empty. At line:4 char:5 + New-AzureVM –ServiceName $service -ReservedIPName "NewReservedIP" -Location ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [New-AzureVM], CloudException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.PersistentVMs.NewAzureVMCommand

1
I'm not sure, but you may have more success with this question over at Server Fault - crthompson

1 Answers

-1
votes

I had created vnet which had a VM with ReservedIP address and Vm got its internal ip automatically.I used below command to create VM using existing vhd :

New-AzureVMConfig -Name "vmname" -InstanceSize "Standard_D2" –DiskName $Image |Add-AzureEndpoint -Name 'test' -Protocol tcp -PublicPort 80 -LocalPort 80 | Set-AzureSubnet -SubnetNames "SubnetName" | New-AzureVM -ServiceName "ServiceName" -ReservedIPName "ReservedIPName" -Location "location" -VNetName "networkname"

For adding static internal ip found an article you can refer to: Click here

Hope this might be helpful.