Skip to content

Commit b129361

Browse files
committed
2nd
1 parent e7cb0b5 commit b129361

File tree

1 file changed

+33
-38
lines changed

1 file changed

+33
-38
lines changed
Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,60 @@
11
---
22
title: Import virtual machines from another lab
3-
description: This article describes how to import virtual machines from another lab into the current lab in Azure DevTest Labs.
3+
description: Learn how to import virtual machines from one lab to another in Azure DevTest Labs.
44
ms.topic: how-to
5-
ms.date: 06/26/2020
5+
ms.date: 11/08/2021
66
---
77

8-
# Import virtual machines from another lab in Azure DevTest Labs
9-
This article provides information about how to import virtual machines from another lab into your lab.
8+
# Import virtual machines from one lab to another
9+
10+
This article discusses and describes how to import virtual machines (VMs) from one DevTest Labs lab to another lab.
1011

1112
## Scenarios
12-
Here are some scenarios where you need to import VMs from one lab into another lab:
13+
Here are some scenarios where you might need to import VMs from one lab into another lab:
14+
15+
- An individual is moving from one group to another and wants to take their developer desktop to the new team's lab.
16+
- The group has hit a [subscription-level quota](../azure-resource-manager/management/azure-subscription-service-limits.md) and wants to split up the teams into more than one Azure subscription.
17+
- The company is moving to Azure ExpressRoute or some other new networking topology, and the team wants to move the VMs to use the new infrastructure.
1318

14-
- An individual on the team is moving to another group within the enterprise and wants to take the developer desktop to the new team’s DevTest Labs.
15-
- The group has hit a [subscription-level quota](../azure-resource-manager/management/azure-subscription-service-limits.md) and wants to split up the teams into a few subscriptions
16-
- The company is moving to Express Route (or some other new networking topology) and the team wants to move the Virtual Machines to use this new infrastructure
19+
## Requirements and constraints
1720

18-
## Solution and constraints
19-
This feature enables you to import VMs in one lab (source) into another lab (destination). You can optionally give a new name for the destination VM in the process. The import process includes all the dependencies like disks, schedules, network settings, and so on.
21+
The import process imports the VMs from the source lab into the destination lab. You can optionally rename the VM in the process. The import process includes all dependencies like disks, schedules, and network settings.
2022

21-
The process does take some time and is impacted by the following factors:
23+
The process is a copy operation, not a move operation, and can take a long time. The import time depends on the following factors:
2224

23-
- Number/size of the disks that are attached to the source machine (since it’s a copy operation and not a move operation)
24-
- Distance to the destination (For example, East US region to Southeast Asia).
25+
- Number and size of the disks attached to the source machine
26+
- Distance between the source and destination regions
2527

26-
Once the process is complete, the source Virtual Machine remains shutdown and the new one is running in the destination lab.
28+
When the process finishes, the source VM is shut down, and the new VM is running in the destination lab.
2729

28-
There are two key constraints to be aware of when planning to import VMs from one lab in to another lab:
30+
There are several requirements and constraints for importing VMs from one lab to another lab:
2931

30-
- Virtual Machine imports across subscriptions and across regions are supported, but the subscriptions must be associated to the same Azure Active Directory tenant.
31-
- Virtual Machines must not be in a claimable state in the source lab.
32-
- You're the owner of the VM in the source lab and owner of the lab in the destination lab.
32+
- You can import VMs across subscriptions and across regions, but both subscriptions must be associated with the same Azure Active Directory tenant.
33+
- VMs can't be in a claimable state in the source lab.
34+
- You must be the owner of the VM in the source lab, and the owner of the destination lab.
3335
- Currently, this feature is supported only through Powershell and REST API.
3436

3537
## Use PowerShell
36-
Download ImportVirtualMachines.ps1 file from the [GitHub](https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/Scripts/ImportVirtualMachines). You can use the script to import a single VM or all VMs in the source lab into the destination lab.
3738

38-
### Use PowerShell to import a single VM
39-
Executing this powershell script requires identifying the source VM and the destination lab, and optionally supplying a new name to use for the destination machine:
39+
Download and run [ImportVirtualMachines.ps1](https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/Scripts/ImportVirtualMachines). You can use the script to import a single VM or all VMs from the source lab into the destination lab.
4040

41-
```powershell
42-
./ImportVirtualMachines.ps1 -SourceSubscriptionId "<ID of the subscription that contains the source lab>" `
43-
-SourceDevTestLabName "<Name of the source lab>" `
44-
-SourceVirtualMachineName "<Name of the VM to be imported from the source lab> " `
45-
-DestinationSubscriptionId "<ID of the subscription that contians the destination lab>" `
46-
-DestinationDevTestLabName "<Name of the destination lab>" `
47-
-DestinationVirtualMachineName "<Optional: specify a new name for the imported VM in the destination lab>"
48-
```
41+
### Use PowerShell to import a single VM or all lab VMs
4942

50-
### Use PowerShell to import all VMs in the source lab
51-
If the Source Virtual Machine isn’t specified, the script automatically imports all VMs in the DevTest Labs. For example:
43+
Executing this PowerShell script requires identifying the source VM and the destination lab, and optionally supplying a new name to use for the destination VM.
5244

5345
```powershell
54-
./ImportVirtualMachines.ps1 -SourceSubscriptionId "<ID of the subscription that contains the source lab>" `
55-
-SourceDevTestLabName "<Name of the source lab>" `
56-
-DestinationSubscriptionId "<ID of the subscription that contians the destination lab>" `
57-
-DestinationDevTestLabName "<Name of the destination lab>"
46+
./ImportVirtualMachines.ps1 -SourceSubscriptionId "<ID of the subscription that contains the source lab>"`
47+
-SourceDevTestLabName "<Name of the source lab>"`
48+
-SourceVirtualMachineName "<Name of the VM to import from the source lab>" `
49+
-DestinationSubscriptionId "<ID of the subscription that contains the destination lab>"`
50+
-DestinationDevTestLabName "<Name of the destination lab>"`
51+
-DestinationVirtualMachineName "<Optional: specify a new name for the imported VM in the destination lab>"
5852
```
53+
If you don't specify a the source VM, the script automatically imports all VMs in the source lab.
5954

6055
## Use HTTP REST to import a VM
61-
The REST call is simple. You give enough information to identify the source and destination resources. Remember that the operation takes place on the destination lab resource.
56+
57+
The REST call is simple. You provide the information to identify the source and destination resources. The operation takes place on the destination lab resource.
6258

6359
```REST
6460
POST https://management.azure.com/subscriptions/<DestinationSubscriptionID>/resourceGroups/<DestinationResourceGroup>/providers/Microsoft.DevTestLab/labs/<DestinationLab>/ImportVirtualMachine?api-version=2017-04-26-preview
@@ -69,7 +65,6 @@ POST https://management.azure.com/subscriptions/<DestinationSubscriptionID>/reso
6965
```
7066

7167
## Next steps
72-
See the following articles:
7368

7469
- [Set policies for a lab](devtest-lab-set-lab-policy.md)
75-
- [Frequently asked questions](devtest-lab-faq.yml)
70+
- [DevTest Labs frequently asked questions](devtest-lab-faq.yml)

0 commit comments

Comments
 (0)