SlideShare una empresa de Scribd logo
1 de 5
Descargar para leer sin conexión
Step-by-Step: Live Migrate Multiple
(Clustered) VMs in One Line of PowerShell Revisited
KeithMayer[1]
24 Feb 2014 9:03 PM
A while back, I wrote an article showing how to Live Migrate Your VMs in One Line of
Powershell[2] between non-clustered Windows Server 2012 Hyper-V hosts using
Shared Nothing Live Migration. Since then, I’ve been asked a few times for how this
type of parallel Live Migration would be performed for highly available virtual machines
between Hyper-V hosts within a cluster.
In this article, we’ll walk through the steps of doing exactly that … via Windows
PowerShell on Windows Server 2012 or 2012 R2[3] or our FREE Hyper-V Server 2012
R2[4] bare-metal, enterprise-grade hypervisor in a clustered configuration.

Wait! Do I need PowerShell to Live Migrate multiple VMs within a
Cluster?
Well, actually … No. You could certainly use the Failover Cluster Manager GUI tool
to select multiple highly available virtual machines, right-click and select Move | Live
Migration …
[5]
[6]

Failover Cluster Manager – Performing Multi-VM Live Migration
But, you may wish to script this process for other reasons … perhaps to efficiently drain
all VM’s from a host as part of a maintenance script that will be performing other tasks.

Can I use the same PowerShell cmdlets for Live Migrating within a
Cluster?
Well, actually … No again. When VMs are made highly available resources within a
cluster, they’re managed as cluster group resources instead of being standalone VM
resources. As a result, we have a different set of Cluster-aware PowerShell cmdlets[7]
that we use when managing these cluster groups. To perform a scripted multi-VM Live
Migration, we’ll be leveraging three of these cmdlets:

Now, let’s see that one line of PowerShell!
Before getting to the point of actually performing the multi-VM Live Migration in a
single PowerShell command line, we first need to setup a few variables to handle the
"what" and "where" of moving these VMs.
First, let’s specify the name of the cluster with which we’ll be working. We’ll store it in
a $clusterName variable.
$clusterName = read-host -Prompt "Cluster name"
Next, we’ll need to select the cluster node to which we’ll be Live Migrating the VMs.
Lets use the Get-ClusterNode and Out-GridView cmdlets together to prompt for the
cluster node and store the value in a $targetClusterNode variable.
$targetClusterN ode =
Get-ClusterN ode -Cluster $clusterN ame |
Out-GridView -Title "Select Target Cluster N ode" `
-OutputMode Single

[8]

And then, we’ll need to create a list of all the VMs currently running in the cluster.
We can use the Get-ClusterGroup cmdlet to retrieve this list. Below, we have an
example where we are combining this cmdlet with a Where-Object cmdlet to return
only the virtual machine cluster groups that are running on any node except the
selected target cluster node. After all, it really doesn’t make any sense to Live Migrate a
VM to the same node on which it’s currently running!
$haVMs =
Get-ClusterGroup -Cluster $clusterN ame |
Where-Object {($_.GroupType -eq "VirtualMachine") `
-and ($_.OwnerN ode -ne $targetClusterN ode.N ame)}
We’ve stored the resulting list of VMs in a $haVMs variable.

Ready to Live Migrate!
OK … Now we have all of our variables defined for the cluster, the target cluster node
and the list of VMs from which to choose. Here’s our single line of PowerShell to do
the magic …
$haVMs |
Out-GridView -Title "Select VMs to Move" –PassThru |
Move-ClusterVirtualMachineRole -MigrationType Live `
-N ode $targetClusterN ode.N ame -Wait 0

[9]

Proceed with care: Keep in mind that your target cluster node will need to have
sufficient available resources to run the VM's that you select for Live Migration. Of
course, it's best to initially test tasks like this in your lab environment first.
Here’s what is happening in this single PowerShell command line:
We’re passing the list of VMs stored in the $haVMs variable to the Out-GridView
cmdlet.
Out-GridView prompts for which VMs to Live Migrate and then passes the selected
VMs down the PowerShell object pipeline to the MoveClusterVirtualMachineRole cmdlet.
This cmdlet initiates the Live Migration for each selected VM, and because it’s using
a
–Wait 0 parameter, it initiates each Live Migration one-after-another without
waiting for the prior task to finish.
As a result, all of the selected VMs will Live Migrate in parallel, up to the maximum
number of concurrent Live Migrations that you’ve configured on these cluster nodes.
The VMs selected beyond this maximum will simply queue up and wait their turn.
Unlike some competing hypervisors, Hyper-V doesn't impose an artificial hard-coded
limit on the number of VMs that can be Live Migrated concurrently. Instead, it's up to
you to set the maximum to a sensible value based on your hardware and network
capacity.

Do you have your own PowerShell automation ideas for Hyper-V?
Feel free to share your ideas in the Comments section below.
See you in the Clouds!
- Keith
1. http://blogs.technet.com/KeithMayer/ProfileUrlRedirect.ashx
2. http://blogs.technet.com/b/keithmayer/archive/2012/10/04/31days_2d00_winserv_2d00_livemigration.aspx
3. http://aka.ms/dlws2012rtm
4. http://aka.ms/hv2012gs
5. http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-componentsweblogfiles/00-00-00-94-09-metablogapi/image_5F00_444C2053.png
6. http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-componentsweblogfiles/00-00-00-94-09-metablogapi/image_5F00_444C2053.png
7. http://technet.microsoft.com/en-us/library/ee461009.aspx
8. http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-componentsweblogfiles/00-00-00-94-09-metablogapi/image_5F00_0418978A.png
9. http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-componentsweblogfiles/00-00-00-94-09-metablogapi/image_5F00_0ED87F90.png

Más contenido relacionado

Más de Vision Concepts Infrastructure Services Solution

Más de Vision Concepts Infrastructure Services Solution (20)

Palo Alto Networks VM-Series firewall now available on NetScaler SDX Platform
Palo Alto Networks VM-Series firewall now available on NetScaler SDX PlatformPalo Alto Networks VM-Series firewall now available on NetScaler SDX Platform
Palo Alto Networks VM-Series firewall now available on NetScaler SDX Platform
 
Citrix Application Lifecycle Management
Citrix Application Lifecycle ManagementCitrix Application Lifecycle Management
Citrix Application Lifecycle Management
 
Using Windows Azure as a SharePoint Disaster Recovery Environment
Using Windows Azure as a SharePoint Disaster Recovery EnvironmentUsing Windows Azure as a SharePoint Disaster Recovery Environment
Using Windows Azure as a SharePoint Disaster Recovery Environment
 
Delivery-on-Demand Company Raises $16 Million, Questions About Safety and Out...
Delivery-on-Demand Company Raises $16 Million, Questions About Safety and Out...Delivery-on-Demand Company Raises $16 Million, Questions About Safety and Out...
Delivery-on-Demand Company Raises $16 Million, Questions About Safety and Out...
 
Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
Could Google end sweatshop labor?
Could Google end sweatshop labor?Could Google end sweatshop labor?
Could Google end sweatshop labor?
 
How to Change the IT Architect Hiring Practice
How to Change the IT Architect Hiring PracticeHow to Change the IT Architect Hiring Practice
How to Change the IT Architect Hiring Practice
 
NetApp To Offer Integrated Storage Array And Virtualization Software
NetApp To Offer Integrated Storage Array And Virtualization SoftwareNetApp To Offer Integrated Storage Array And Virtualization Software
NetApp To Offer Integrated Storage Array And Virtualization Software
 
Big Data - Security Concerns
Big Data - Security ConcernsBig Data - Security Concerns
Big Data - Security Concerns
 
Apple adding hundreds of new engineers and operations staff in China to speed...
Apple adding hundreds of new engineers and operations staff in China to speed...Apple adding hundreds of new engineers and operations staff in China to speed...
Apple adding hundreds of new engineers and operations staff in China to speed...
 
Data Analytics and the Ubiquitous Internet of Things
Data Analytics and the Ubiquitous Internet of ThingsData Analytics and the Ubiquitous Internet of Things
Data Analytics and the Ubiquitous Internet of Things
 
Citrix UniPrint NetGain Case Study
Citrix UniPrint NetGain Case StudyCitrix UniPrint NetGain Case Study
Citrix UniPrint NetGain Case Study
 
Uniprint Infinity Citrix Printing Solution
Uniprint Infinity Citrix Printing SolutionUniprint Infinity Citrix Printing Solution
Uniprint Infinity Citrix Printing Solution
 
The CIO Pocket MBA
The CIO Pocket MBAThe CIO Pocket MBA
The CIO Pocket MBA
 
Citrix Top 10 Trends
Citrix Top 10 Trends Citrix Top 10 Trends
Citrix Top 10 Trends
 
Citrix and Samsung Deliver Android Enterprise Security on Latest Samsung Gala...
Citrix and Samsung Deliver Android Enterprise Security on Latest Samsung Gala...Citrix and Samsung Deliver Android Enterprise Security on Latest Samsung Gala...
Citrix and Samsung Deliver Android Enterprise Security on Latest Samsung Gala...
 
Learn KVM and Receive Exclusive Invitation to Linux Foundation Collaboration ...
Learn KVM and Receive Exclusive Invitation to Linux Foundation Collaboration ...Learn KVM and Receive Exclusive Invitation to Linux Foundation Collaboration ...
Learn KVM and Receive Exclusive Invitation to Linux Foundation Collaboration ...
 
Using Concurrent Multipath Transmission for Transport Virtualization
Using Concurrent Multipath Transmission for Transport VirtualizationUsing Concurrent Multipath Transmission for Transport Virtualization
Using Concurrent Multipath Transmission for Transport Virtualization
 
GuideIT - Virtual Economies of Scale
GuideIT - Virtual Economies of Scale GuideIT - Virtual Economies of Scale
GuideIT - Virtual Economies of Scale
 
Build Your 2008R2 2-Node Cluster
Build Your 2008R2 2-Node ClusterBuild Your 2008R2 2-Node Cluster
Build Your 2008R2 2-Node Cluster
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Live Migrate Multiple (Clustered) VMs in One Line of PowerShell - Revisited

  • 1. Step-by-Step: Live Migrate Multiple (Clustered) VMs in One Line of PowerShell Revisited KeithMayer[1] 24 Feb 2014 9:03 PM A while back, I wrote an article showing how to Live Migrate Your VMs in One Line of Powershell[2] between non-clustered Windows Server 2012 Hyper-V hosts using Shared Nothing Live Migration. Since then, I’ve been asked a few times for how this type of parallel Live Migration would be performed for highly available virtual machines between Hyper-V hosts within a cluster. In this article, we’ll walk through the steps of doing exactly that … via Windows PowerShell on Windows Server 2012 or 2012 R2[3] or our FREE Hyper-V Server 2012 R2[4] bare-metal, enterprise-grade hypervisor in a clustered configuration. Wait! Do I need PowerShell to Live Migrate multiple VMs within a Cluster? Well, actually … No. You could certainly use the Failover Cluster Manager GUI tool to select multiple highly available virtual machines, right-click and select Move | Live Migration … [5]
  • 2. [6] Failover Cluster Manager – Performing Multi-VM Live Migration But, you may wish to script this process for other reasons … perhaps to efficiently drain all VM’s from a host as part of a maintenance script that will be performing other tasks. Can I use the same PowerShell cmdlets for Live Migrating within a Cluster? Well, actually … No again. When VMs are made highly available resources within a cluster, they’re managed as cluster group resources instead of being standalone VM resources. As a result, we have a different set of Cluster-aware PowerShell cmdlets[7] that we use when managing these cluster groups. To perform a scripted multi-VM Live Migration, we’ll be leveraging three of these cmdlets: Now, let’s see that one line of PowerShell! Before getting to the point of actually performing the multi-VM Live Migration in a single PowerShell command line, we first need to setup a few variables to handle the "what" and "where" of moving these VMs. First, let’s specify the name of the cluster with which we’ll be working. We’ll store it in a $clusterName variable.
  • 3. $clusterName = read-host -Prompt "Cluster name" Next, we’ll need to select the cluster node to which we’ll be Live Migrating the VMs. Lets use the Get-ClusterNode and Out-GridView cmdlets together to prompt for the cluster node and store the value in a $targetClusterNode variable. $targetClusterN ode = Get-ClusterN ode -Cluster $clusterN ame | Out-GridView -Title "Select Target Cluster N ode" ` -OutputMode Single [8] And then, we’ll need to create a list of all the VMs currently running in the cluster. We can use the Get-ClusterGroup cmdlet to retrieve this list. Below, we have an example where we are combining this cmdlet with a Where-Object cmdlet to return only the virtual machine cluster groups that are running on any node except the selected target cluster node. After all, it really doesn’t make any sense to Live Migrate a VM to the same node on which it’s currently running! $haVMs = Get-ClusterGroup -Cluster $clusterN ame | Where-Object {($_.GroupType -eq "VirtualMachine") ` -and ($_.OwnerN ode -ne $targetClusterN ode.N ame)} We’ve stored the resulting list of VMs in a $haVMs variable. Ready to Live Migrate!
  • 4. OK … Now we have all of our variables defined for the cluster, the target cluster node and the list of VMs from which to choose. Here’s our single line of PowerShell to do the magic … $haVMs | Out-GridView -Title "Select VMs to Move" –PassThru | Move-ClusterVirtualMachineRole -MigrationType Live ` -N ode $targetClusterN ode.N ame -Wait 0 [9] Proceed with care: Keep in mind that your target cluster node will need to have sufficient available resources to run the VM's that you select for Live Migration. Of course, it's best to initially test tasks like this in your lab environment first. Here’s what is happening in this single PowerShell command line: We’re passing the list of VMs stored in the $haVMs variable to the Out-GridView cmdlet. Out-GridView prompts for which VMs to Live Migrate and then passes the selected VMs down the PowerShell object pipeline to the MoveClusterVirtualMachineRole cmdlet. This cmdlet initiates the Live Migration for each selected VM, and because it’s using a –Wait 0 parameter, it initiates each Live Migration one-after-another without waiting for the prior task to finish. As a result, all of the selected VMs will Live Migrate in parallel, up to the maximum number of concurrent Live Migrations that you’ve configured on these cluster nodes. The VMs selected beyond this maximum will simply queue up and wait their turn. Unlike some competing hypervisors, Hyper-V doesn't impose an artificial hard-coded limit on the number of VMs that can be Live Migrated concurrently. Instead, it's up to
  • 5. you to set the maximum to a sensible value based on your hardware and network capacity. Do you have your own PowerShell automation ideas for Hyper-V? Feel free to share your ideas in the Comments section below. See you in the Clouds! - Keith 1. http://blogs.technet.com/KeithMayer/ProfileUrlRedirect.ashx 2. http://blogs.technet.com/b/keithmayer/archive/2012/10/04/31days_2d00_winserv_2d00_livemigration.aspx 3. http://aka.ms/dlws2012rtm 4. http://aka.ms/hv2012gs 5. http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-componentsweblogfiles/00-00-00-94-09-metablogapi/image_5F00_444C2053.png 6. http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-componentsweblogfiles/00-00-00-94-09-metablogapi/image_5F00_444C2053.png 7. http://technet.microsoft.com/en-us/library/ee461009.aspx 8. http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-componentsweblogfiles/00-00-00-94-09-metablogapi/image_5F00_0418978A.png 9. http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-componentsweblogfiles/00-00-00-94-09-metablogapi/image_5F00_0ED87F90.png