Azure ReservedIP Bad Request on old Windows VM isntance - azure

I am using Azure Powershell cmdlets to reserve the current IP of my running Windows VM instance. To test it, I created a new VM, ran it up, then ran New-AzureReservedIP with the -ServiceName tack so it knows reserve teh current IP. It worked a charm! I shut down the machine and it reallocaed the same IP address on startup.
Now if I do the exact same thing on an actual production Windows VM I get the below error. Could it be that this machine has been running for about 3 years and is not supported for some reason? Syntax is correct as my initial test and in the same location etc..
BadRequest : Cannot reserve the ip of deployment xxxxxxxx
Has anyone else had this problem?

If this cloud service is 3 years old it is quite possible that you are using an affinity-group VNET to host the VM. It is not possible to reserve an IP address from such a VNET. The following is documented:
Reserved IPs are only supported in regional VNets. It is not supported for VNets that are associated with affinity groups. For more information about associating a VNet with a region or an affinity group, see [About Regional VNets and Affinity Groups][2].

Related

Azure VM Nic With Loopback Address and No Connectivity

we have a vm which is in Azure but we're not able to connect to it. I checked the serial log under boot diagnostic and it has the following error:
======== Microsoft Azure VM Health Report - Start 2020-02-19T20:50:47.2786733Z ========
{"reportTime":"2020-02-19T20:47:44.9492172Z","networkAdapters":[{"name":"Loopback
Pseudo-Interface
1","status":"Up","macAddress":"","ipProperties":[{"protocolVersion":4,"address":"127.0.0.1","isDhcpEnabled":false},{"protocolVersion":6,"address":"::1","isDhcpEnabled":false}]}],"remoteAccess":null,"accounts":{"windows":{"adminAccountPasswordExpired":false,"adminAccountDisabled":false}},"services":[{"errorControl":"Normal","exitCode":0,"name":"TermService","processId":2708,"serviceType":"Share
Process","startMode":"Auto","startName":"NT
Authority\NetworkService","state":"Running","status":"OK"}
The key part I think is the "name":"Loopback Pseudo-Interface 1"It has no mac address as above and uses IP of 127.0.0.1, Has anyone come across this before and know how to get the NIC to be recognised. I've changed the NIC and changed IP, but cannot seem to resolve this.
By default, 127.0.0.1 is assigned to a loopback interface. It represents the localhost address. The captured health report is meanless and not enough to identify why you are not able to connect to that Azure VM.
First, you can verify if the VM status is running on the overview of the virtual machine portal. Then check if there is any port blocking in the NSG on the networking of VM, then try to RDP or SSH to that Azure VM. You can get more details on diagnose and solve problems under overview.
If you still could not connect to it. Try to resize or redeploy your Azure VM. If you have important data, please backup your OS and data disk before you redeploy it. You also could get more details on how to use boot diagnostics to troubleshoot virtual machines in Azure.
Hope this could help you.

Cannot migrate Azure VMs from Classic to ARM: RoleStateUnknown

I have successfully used this recipe in the past to migrate a virtual network including attached VMs: https://learn.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-cli-migration-classic-resource-manager
But today, and also when I tried last week, no matter the number of reboots, I get this error (Azure CLI):
> azure network vnet prepare-migration "<RG-NAME>"
info: Executing command network vnet prepare-migration
error: BadRequest : Migration is not allowed for HostedService
<CLOUD-SERVICE> because it has VM <VM-NAME> in State :
RoleStateUnknown. Migration is allowed only when the VM is in one of the
following states - Running, Stopped, Stopped Deallocated.
The VM is in fact running smoothly, and so says the Azure portal.
So any ideas how to get out of this mess?
Have you edited the NSG or local firewall of the VM? Please do not restrict the outbound traffic from the VM. It may break the VM Agent.
Also, please check if the VM Agent is running properly. If the VM Agent is not reachable, this issue may occur.
==============================================================================
Only issue is that I don't seem to be able to moved the Reserve IP to my new load balancer.
If we migrate the cloud service with a preserved public IP address, this public IP address will be migrated to ARM and be assigned to a load balancer automatically. (The load balancer is auto-created.) Then, you are able to re-assign this static public IP address to your load balancer.
Here is the screenshot of my lab:
Before the migration
After the migration
I can re-associate the IP with new load balancer after I delete the auto-created one.

Assign VNet IP address to Azure Cloud Service

I have an Azure Cloud Service, and a Azure Virtual Network with Subnet.
I can deploy the Cloud Service onto the Virtual Network by setting the appropriate configuration setting in the .cscfg.
What I'm struggling with though is bringing the role onto a specific IP address. My guess is that it's currently using DHCP to get an IP address.
I've tried using the following Powershell:
Get-AzureVM -ServiceName myrole | Set-AzureStaticVNetIP -IPAddress 127.16.0.4 | Update-AzureVM
But the IP address never changes:
<IpAddress>172.16.0.5</IpAddress>
Is there a restriction on doing this on cloud services?
Any help would be really appreciated.
Thanks,
Graeme
Network configuration schema for Cloud Service is documented here.
https://msdn.microsoft.com/library/azure/jj156091.aspx
As you'll see, you have the ability to specify a ReservedIP but not a static private IP.
My understanding is that Set-AzureStaticVNetIP works for Azure IaaS VM, not for Cloud Service VM.
Virtual machines whether there are IaaS or Paas provisioned in a VNET are always allocated the first available IP address in the subnet after the first 4 addresses which are reserved from .0 to .3.
So considering your request, I will define subnets that enable to target the right subnet IPs for my role instances, and if I need to precisely know which IP is used by which instance, read it in the "role start" method and use it to configure whatever solution you need for this IP to be be "static".
Hope this helps
Best regards
Stéphane

Install openstack on vm windows azure

I just installed Openstack on Windows azure virtual machine.
But basicly Openstack need fixed ip(ip address which used to communicate between vm and openstack) and float ip(which used to communicate vm and network outside or internet)
But on windows Azure, VM just gave one private ip and one public ip for my azure virtual machine which i've installed Openstack.
So that VM which i created using openstack can't get both of fixed ip and float ip.
How i can configure this on windows azure vm so that my vm which i created using openstack can get fixed and float ip?
Thanks
I believe you cannot get around IP limitations that your VM gets from Azure. However that being said, depending on what O/S you run, you have always options to introduce more IP-addresses at O/S level.
Now depending of the O/S you can bridge/tunnel those IP addresses to access that VM in a manner that those IPs are exposed to clients. VPN is one good example of such functionality - which you may use different tools (again specific details rely on the O/S).
This is the only solution that comes to my mind; I've faced (and dealt with) the Azure only-one-IP limitation on other scenarios...

How to force ip change on a Windows Azure Virtual machine?

I'd like to know how to force an IP change on a Windows Azure machine? Calling ipconfig -renew seems not to be working.
You'll get a new IP after you shutdown your machine.
E.g. click on shutdown in the portal and you should see this message:
If you continue, the IP addresses that were assigned to this virtual machine will be released. Are you sure you want to shut down virtual machine [name]?
First of all you really don't have any requirement to change IP address of any Windows Azure Virtual Machine. I will try explaining more on Windows Azure IP address details.
Windows Azure Machine(s) have a fixed IP address which is internal and Windows Azure Service have virtual IP address which is publicly faced. The internal IP address is specific to each virtual machine (Cloud Service Instance or Virtual Machine Instance) which is assigned when the VM Instance is configured and stay the same during the life of Virtual Machine instance.
With Windows Azure Cloud Service Instance (PaaS) you don't have any control over Virtual Machine IP address. However if you creating Windows Azure Virtual Machine (IaaS) you can use Windows Azure Virtual Network to put together all the virtual machines within a IP Address/Subnet group as described here. This may or may not be your requirement however this is one way in IaaS VM, you can put together a VM with your virtual network.
Delete the deployment or cloud service, wait about 10 minuets and re-create. This will assignee a new PUBLIC IP address to the new cloud service.
Powershell way
if you use Resource Manager:
Get-AzureRmVM | Stop-AzureRmVM -Force
Get-AzureRmVM | Start-AzureRmVM
or for classic VM:
Get-AzureVM | Stop-AzureVM -Force
Get-AzureVM | Start-AzureVM
Follow the instructions at https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-reserved-private-ip/
you need to restart the server

Resources