Topics

Deals

How to Start and Stop Azure VM - Resource Group and Classic

VM - Resource Group, Non classic

How to start

# startAzureRmVM is command to start Azure VM (non-classic, Resource Group based)
# Example below to start a VM of name testmachine in resource group testgroup

start-AzureRmVM -ResourceGroupName "testgroup" -Name "testmachine"
#
#Before you use start-AzureRmVM, you must have used LoginAzureRmAccount
#Before you use start-AzureVM use Add-AzureAccount followed by set-AzureSubscription

How to stop

# stop-AzureRmVM is command to stop Azure VM (non-classic, Resource Group based)
# Example below to stop a VM of name testmachine in resource group testgroup

stop-AzureRmVM -ResourceGroupName "testgroup" -Name "testmachine"

It will display a message...

Virtual machine stopping operation
This cmdlet will stop the specified virtual machine. Do you want to continue?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):

If you do not want to be prompted for message , use toe -force option
stop-AzureRmVM -ResourceGroupName "testgroup" -Name "testmachine" -force

Classic VM

How to start classic VM

# start-AzureVM is command to start Classic Azure VM
# Example below to start a VM of name testmachine in resource group testgroup

start-AzureVM -servicename "testservice" -Name "testmachine"
#
#Before you use start-AzureVM use Add-AzureAccount # Also use select-AzureSubscription to ensure write subscription is selected. # Select-AzureSubscription is different from set-AzureSubscription # check with Get-AzureSubscription -current to check that right subscription is in use

How to stop classic VM

# start-AzureVM is command to start Classic Azure VM
# Example below to start a VM of name testmachine in resource group testgroup

start-AzureVM -servicename "testservice" -Name "testmachine"
#
#Before you use start-AzureVM use Add-AzureAccount # Also use select-AzureSubscription to ensure write subscription is selected. # Select-AzureSubscription is different from set-AzureSubscription # check with Get-AzureSubscription -current to check that right subscription is in use



Like us on facebook


Facebook comments

Articles in