Here are a few Power Shell Scripts that are handy in speeding up things even further in terms of Provisioning, Starting up or Stopping a Virtual Machine.
How to Provision a Virtual Machine using our custom Image?
# The VM, Service, and Image Name's
$vmName = "myFirstVM"
$svcName = "myCloudService"
$imageName = "myImage"
$vmName = "myFirstVM"
$svcName = "myCloudService"
$imageName = "myImage"
# Setup the New Azure VM Configurations
$newVM = New-AzureVMConfig -Name $vmName -InstanceSize $instanceSize -ImageName $imageName
$newVM | Add-AzureEndpoint -Name 'Remote Desktop' -Protocol tcp -LocalPort 3389 -PublicPort 51000
$newVM | Add-AzureEndpoint -Name 'PowerShell' -Protocol tcp -LocalPort 5986 -PublicPort 5986
$newVM = New-AzureVMConfig -Name $vmName -InstanceSize $instanceSize -ImageName $imageName
$newVM | Add-AzureEndpoint -Name 'Remote Desktop' -Protocol tcp -LocalPort 3389 -PublicPort 51000
$newVM | Add-AzureEndpoint -Name 'PowerShell' -Protocol tcp -LocalPort 5986 -PublicPort 5986
# Create the new Azure Cloud Service
$checkNewAS = New-AzureService -ServiceName $svcName -Location $location -Label $svcName
$checkNewAS = New-AzureService -ServiceName $svcName -Location $location -Label $svcName
# Create the new Azure VM
$checkNewAVM = New-AzureVM -ServiceName $svcName -Location $location -VMs $newVM
How to Start Up a Virtual Machine?
$checkNewAVM = New-AzureVM -ServiceName $svcName -Location $location -VMs $newVM
How to Start Up a Virtual Machine?
$start = Start-AzureVM -Name $vmName -ServiceName $svcName
How to Stop a Virtual Machine?
$stop = Stop-AzureVM -Name $vmName -ServiceName $svcName
Important:
- Download and Install the Azure Power Shell SDK, for the above to workhttp://azure.microsoft.com/en-in/downloads/
- Add your Azure Account to Power Shell Via:$cred = Get-CredentialAdd-AzureAccount -Credential $cred
Load runner online training
ReplyDeleteMSBI online training
Mule ESB online training
Mulesoft online training
Load runner online training
ReplyDeleteMSBI online training
Mule ESB online training
Mulesoft online training