Created
February 24, 2015 07:01
-
-
Save astaykov/19332d01a7976b9c515f to your computer and use it in GitHub Desktop.
Move existing Azure VM to a Cloud Service with Reserved IP Address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$subName = "<your_subscription_name>" | |
$storageName = "<your_storage_account_name>" | |
$reservedIPname = "<pick_a_name_for_the_reserved_ip>" | |
$reservedIPlabel = "<pick_a_label_for_the_ip>" | |
$reservedIPlocation "<set_the_location>" # i.e. West Europe | |
$serviceName = "<cloud_service_name_of_the_deployed_vm>" | |
$vmName = "<namne_of_the_vm>" | |
$vnetSiteName = "<name_of_the_vnet_site>" # if the VM will be part of Virtual Network. | |
$pathToVMConfig "<enter local path where to save current vm configuration>" | |
Add-AzureAccount | |
Select-AzureSubscription $subName | |
Set-AzureSubscription -SubscriptionName $subName -CurrentStorageAccountName §storageName | |
New-AzureReservedIP –ReservedIPName $reservedIPname –Label $reservedIPlabel –Location $reservedIPlocation | |
Get-AzureReservedIP # just to confirm we have it | |
Export-AzureVM -ServiceName $serviceName -Name $vmName -Path $pathToVMConfig | |
Remove-AzureVM -ServiceName $serviceName -Name $vmName -Verbose | |
Import-AzureVM -Path $pathToVMConfig | New-AzureVM -VNetName $vnetSiteName -ServiceName $serviceName –ReservedIPName $reservedIPname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment