Moving a VM from Existing Subnet to a New Subnet

QUESTION:

You have been asked to move a VM named Server01 to SubnetB from SubnetA in your Azure cloud service named mycloud. Complete the PowerShell commands below:

C:\ PS> $vm = ______________ "mycloud" -Name "Server01"

C:\ PS> _______________ "SubnetB" -VM $vm

C:\ PS> _______________ "mycloud" -Name "Server01" -VM $vm

Available Choices:

New-AzureVM | Get-AzureVMImage | Update-AzureVMImage | Set-AzureVNetConfig | Set-AzureSubnet | Get-AzureVM | Update-AzureVM

Show Me the Answer

The first command you use should be Get-AzureVM so you can populate the variable with your current VM configuration. You should then use the Set-AzureSubnet command to update the virtual machine's configuration to use SubnetB. Lastly, the Update-AzureVM command should be used to update the actual VM with the updated configuration.

Reference Material:

https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-move-vm-role-to-subnet

Click here for my PREMIUM practice questions.

[collapse]

Thomas Mitchell

Tom is a 20+ year veteran of the IT industry and carries numerous Microsoft certifications, including the MCSE: Cloud Platform and Infrastructure certification. A Subject Matter Expert in Active Directory and Microsoft Exchange, Tom also possesses expert-level knowledge in several other IT disciplines, including Azure, Storage, and O365/Exchange Online. You can find Tom at his website, on LinkedIn, or on Facebook. Need to reach him by phone? Call 484-334-2790.