Thursday 11 June 2015

Reserved Ip creation and Assigning it to the Virtual machine on Azure for ubuntu



Reserved Ip creation methods
Powershell
REST API’s
In this post we will see about powershell method,

Is it possible to assign a reserved ip address to an existing VM or Cloud service?
No! At this moment you can’t. You have to redeploy your virtual machine in order to use a reserved ip

Capturing an Image:

create the image in Azure by clicking capture. Click vm ->Dashboard->Capture.

Note down the image name.  EG. ubuntutestimage-20150604-6704545

Create the Reserved Ip as follows:
New-AzureReservedIP “MyReservedIP” –Label “demoreservedip” –Location “West US”
To check the existing reserved ips
Get-AzureReservedIP


Deleting the current deployment:
Best way to wipe everything at once is to delete the cloud service. Navigate to Cloud Services, select the CS associated with the specified VM and hit “Delete the cloud service and all it’s deployments”. This will delete the VM, disks and everything associated with it. Don’t worry, our Image won’t be touched. 

Redeploying the Virtual Machine:
Now we are going to pipe a few commands all at once. First we create the VM config passing the captured image as parameter, add the original endpoints (you must add at least one, you can add more later through the portal if you want) and finally create the VM with New-AzureVM command with -ReservedIPName parameter.


New-AzureVMConfig -Name "ubuntutest" -InstanceSize "Basic_A0" –ImageName "ubuntutestimage-20150611-670899" | New-AzureVM -ServiceName "ubuntutestimage" –ReservedIPName " demoreservedip " -Location "West US”
OperationDescription OperationId OperationStatus
-----New-AzureVM 2e8c084b-0077-8551-9734-d1f2f3c3c1d2 Succeeded








2 comments:

  1. I followed the procedure to create a linux vm with reserved ip. However, now I can't login in this vm using putty. What's the username and password for it ?

    ReplyDelete
  2. It's depends on what you have mentioned while creating the vm. Default username is azureuser . You can refer this link it could be useful for you

    http://stackoverflow.com/questions/13553621/determine-which-user-created-an-azure-ubuntu-linux-server-with-quick-create

    ReplyDelete