SlideShare uma empresa Scribd logo
1 de 18
Managing Microsoft Hyper-V with PowerShell Ravikanth Chaganti
About Me Lead Engineer at Dell Windows PowerShell MVP Author of Free eBook: Layman’s guide to PowerShell 2.0 remoting Free eBook: WMI Query Language via PowerShell (coming soon) Co-author on Quest’s SharePoint 2010 & PowerShell cheat sheet Blog at http://www.ravichaganti.com/blog
Agenda PowerShell 2.0 features Integrated Scripting Environment PowerShell remoting PowerShell for Hyper-V Hyper-V WMI – Overview Virtual Machine Management Virtual Network Management Virtual Storage Management Hyper-V PowerShell Module Q & A
PowerShell 2.0 Features Advanced Functions Integrated Scripting Environment Remoting Background jobs Eventing Better error handling & debugging support Several new cmdlets
Integrated Scripting Environment (ISE) Output Pane Script Pane Command Pane
PowerShell Remoting Enables Universal Code Execution Model Whatever runs locally should run anywhere Uses Windows Remote Management Supports several remoting methods Invoke-Command Interactive remoting Implicit remoting
PowerShell for Hyper-V No built-in cmdlets Rich set of WMI interfaces under rootirtualization namespace 108 classes prefixed with Msvm_ Complex to script PowerShell module for Hyper-V Developed by James O’neill http://pshyperv.codeplex.com System Center Virtual Machine Manager cmdlets
Hyper-V WMI - Overview Get enabled when Hyper-V role is installed Present in rootirtualization namespace 108 classes Excluding the CIM and system classes Can be categorized in to: BIOS Input Integration Component Memory / Processor / Networking / Storage / Serial / Video Devices Virtual System & Virtual System Management Profile Registration & Resource Management
Hyper-V WMI: Virtual Machine Management Msvm_VirtualSystemManagementService class is used Create, Delete, and Manage VMs DefineVirtualSystem DestroyVirtualSystem ModifyVirtualSystem ModifyVirtualSystemResources RemoveVirtualSystemResources Import, Export, and snapshot VMs ImportVirtualSystemEx ExportVirtualSystemEx CreateVirtualSystemSnapshot RemoveVirtualSystemSnapshot
Hyper-V WMI: Virtual Network Management  Msvm_VirtualSwitchManagementService class is used Create, Delete, and Manage virtual network components CreateSwitch CreateSwitchPort DeleteSwitch DeleteSwitchPort ConnectSwitchPort DisconnectSwitchPort
Hyper-V WMI: Virtual Storage Management Msvm_ImageManagementService class is used Create, Mount, and Dismount virtual media CreateFixedVirtualHardDisk CreateDynamicVirtualHardDisk CreateDifferencingVirtualHardDisk Mount Unmount ValidateVirtualHardDisk
Hyper-V PowerShell Module Scripting WMI interfaces is Quite complex Quite verbose Hyper-V PowerShell Module Developed by James O’neill Can be download from http://pshyperv.codeplex.com Import-Module –Name hyperv Get-Command –Module hyperv Contains 122 cmdlets
Hyper-V PowerShell Module: Virtual Machine Get-VM New-VM Remove-VM Move-VM Export-VM Import-VM Many more…. Get-Command -noun VM*
Get-VMSwitch New-VMExternalSwitch New-VMInternalSwitch New-VMPrivateSwitch Remove-VMSwitch Many More.. Get-Command –Noun VM*Switch Get-Command -Noun VMNIC* Hyper-V PowerShell Module: Virtual Network
Hyper-V PowerShell Module: Virtual Storage Compress-VHD Convert-VHD Dismount-VHD Expand-VHD Get-VHD Merge-VHD Mount-VHD New-VHD Test-VHD Add-VMDrive Remove-VMDrive
Hyper-V PowerShell Module: VM Resources Add-VMNIC Add-VMDisk Set-VMCPUCount Set-VMMemory Set-VM Many More..
References Hyper-V WMI interfaces: http://msdn.microsoft.com/en-us/library/cc136986(v=VS.85).aspx PowerShell Module for Hyper-V: http://pshyperv.codeplex.com Getting Started with PowerShell: http://technet.microsoft.com/en-us/scriptcenter/dd742419
Q & A

Mais conteúdo relacionado

Mais procurados

Mais procurados (12)

Presentation at VMware Workstation Instalation
Presentation at VMware Workstation InstalationPresentation at VMware Workstation Instalation
Presentation at VMware Workstation Instalation
 
Prepping software for w7 deployment
Prepping software for w7 deploymentPrepping software for w7 deployment
Prepping software for w7 deployment
 
WooCommerce WP-CLI Basics
WooCommerce WP-CLI BasicsWooCommerce WP-CLI Basics
WooCommerce WP-CLI Basics
 
SAINT Virtual Machine Setup Instructions
SAINT Virtual Machine Setup InstructionsSAINT Virtual Machine Setup Instructions
SAINT Virtual Machine Setup Instructions
 
Managing Windows Vista With Windows Power Shell
Managing Windows Vista With Windows Power ShellManaging Windows Vista With Windows Power Shell
Managing Windows Vista With Windows Power Shell
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)
 
Microsoft App-V 5.1 and Flexera AdminStudio Webinar
Microsoft App-V 5.1 and Flexera AdminStudio WebinarMicrosoft App-V 5.1 and Flexera AdminStudio Webinar
Microsoft App-V 5.1 and Flexera AdminStudio Webinar
 
Lotus Notes Plugin Installation For Dummies
Lotus Notes Plugin Installation For DummiesLotus Notes Plugin Installation For Dummies
Lotus Notes Plugin Installation For Dummies
 
Top ESXi command line v2.0
Top ESXi command line v2.0Top ESXi command line v2.0
Top ESXi command line v2.0
 
How To Install Windows 11
How To Install Windows 11How To Install Windows 11
How To Install Windows 11
 
Windows Server Core
Windows Server CoreWindows Server Core
Windows Server Core
 
Upgradingtodominov10bestpractices1549485091676
Upgradingtodominov10bestpractices1549485091676Upgradingtodominov10bestpractices1549485091676
Upgradingtodominov10bestpractices1549485091676
 

Destaque

Storage and hyper v - the choices you can make and the things you need to kno...
Storage and hyper v - the choices you can make and the things you need to kno...Storage and hyper v - the choices you can make and the things you need to kno...
Storage and hyper v - the choices you can make and the things you need to kno...
Louis Göhl
 
Introduction To Work Item Customisation
Introduction To Work Item CustomisationIntroduction To Work Item Customisation
Introduction To Work Item Customisation
wbarthol
 
Security best practices for hyper v and server virtualisation [svr307]
Security best practices for hyper v and server virtualisation [svr307]Security best practices for hyper v and server virtualisation [svr307]
Security best practices for hyper v and server virtualisation [svr307]
Louis Göhl
 
Understanding AzMan In Hyper-V
Understanding AzMan In Hyper-VUnderstanding AzMan In Hyper-V
Understanding AzMan In Hyper-V
Lai Yoong Seng
 
Windows Server 2008 R2 Hyper-V SP1 Component Architecture
Windows Server 2008 R2 Hyper-V SP1 Component Architecture Windows Server 2008 R2 Hyper-V SP1 Component Architecture
Windows Server 2008 R2 Hyper-V SP1 Component Architecture
Tũi Wichets
 
Getting Started With The TFS API
Getting Started With The TFS APIGetting Started With The TFS API
Getting Started With The TFS API
wbarthol
 
Hyper-V Best Practices & Tips and Tricks
Hyper-V Best Practices & Tips and TricksHyper-V Best Practices & Tips and Tricks
Hyper-V Best Practices & Tips and Tricks
Amit Gatenyo
 

Destaque (20)

Storage and hyper v - the choices you can make and the things you need to kno...
Storage and hyper v - the choices you can make and the things you need to kno...Storage and hyper v - the choices you can make and the things you need to kno...
Storage and hyper v - the choices you can make and the things you need to kno...
 
Attacking Web Applications
Attacking Web ApplicationsAttacking Web Applications
Attacking Web Applications
 
Hyper V And Scvmm Best Practis
Hyper V And Scvmm Best PractisHyper V And Scvmm Best Practis
Hyper V And Scvmm Best Practis
 
The Rules of Network Automation - Interop/NYC 2014
The Rules of Network Automation - Interop/NYC 2014The Rules of Network Automation - Interop/NYC 2014
The Rules of Network Automation - Interop/NYC 2014
 
Network Automation - Interconnection tools
Network Automation - Interconnection toolsNetwork Automation - Interconnection tools
Network Automation - Interconnection tools
 
The Datacenter Network You Wish You Had
The Datacenter Network You Wish You HadThe Datacenter Network You Wish You Had
The Datacenter Network You Wish You Had
 
A Networking View for the DevOps Crew: SDN
A Networking View for the DevOps Crew: SDNA Networking View for the DevOps Crew: SDN
A Networking View for the DevOps Crew: SDN
 
Introduction To Work Item Customisation
Introduction To Work Item CustomisationIntroduction To Work Item Customisation
Introduction To Work Item Customisation
 
Security best practices for hyper v and server virtualisation [svr307]
Security best practices for hyper v and server virtualisation [svr307]Security best practices for hyper v and server virtualisation [svr307]
Security best practices for hyper v and server virtualisation [svr307]
 
Understanding AzMan In Hyper-V
Understanding AzMan In Hyper-VUnderstanding AzMan In Hyper-V
Understanding AzMan In Hyper-V
 
Windows Server 2008 R2 Hyper-V SP1 Component Architecture
Windows Server 2008 R2 Hyper-V SP1 Component Architecture Windows Server 2008 R2 Hyper-V SP1 Component Architecture
Windows Server 2008 R2 Hyper-V SP1 Component Architecture
 
SQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerSQL and NoSQL in SQL Server
SQL and NoSQL in SQL Server
 
Rodc features
Rodc featuresRodc features
Rodc features
 
Class graph neo4j and software metrics
Class graph neo4j and software metricsClass graph neo4j and software metrics
Class graph neo4j and software metrics
 
A Network Engineer's Approach to Automation
A Network Engineer's Approach to AutomationA Network Engineer's Approach to Automation
A Network Engineer's Approach to Automation
 
Getting Started With The TFS API
Getting Started With The TFS APIGetting Started With The TFS API
Getting Started With The TFS API
 
Network analysis with Hadoop and Neo4j
Network analysis with Hadoop and Neo4jNetwork analysis with Hadoop and Neo4j
Network analysis with Hadoop and Neo4j
 
Hyper-V Best Practices & Tips and Tricks
Hyper-V Best Practices & Tips and TricksHyper-V Best Practices & Tips and Tricks
Hyper-V Best Practices & Tips and Tricks
 
DeltaV Development Systems in a Virtualized Environment
DeltaV Development Systems in a Virtualized EnvironmentDeltaV Development Systems in a Virtualized Environment
DeltaV Development Systems in a Virtualized Environment
 
Master the Mystery and Marvels of DeltaV MPC
Master the Mystery and Marvels of DeltaV MPCMaster the Mystery and Marvels of DeltaV MPC
Master the Mystery and Marvels of DeltaV MPC
 

Semelhante a Managing Hyper-V With PowerShell

System Center Virtual Machine Manager 2008 R2
System Center Virtual Machine Manager 2008 R2System Center Virtual Machine Manager 2008 R2
System Center Virtual Machine Manager 2008 R2
aralves
 
IBM’s System Director VMControl: Advanced Multi-Platform Virtualization Manag...
IBM’s System Director VMControl: Advanced Multi-Platform Virtualization Manag...IBM’s System Director VMControl: Advanced Multi-Platform Virtualization Manag...
IBM’s System Director VMControl: Advanced Multi-Platform Virtualization Manag...
IBM India Smarter Computing
 
Scvmm Technical Overview.Son Vu
Scvmm Technical Overview.Son VuScvmm Technical Overview.Son Vu
Scvmm Technical Overview.Son Vu
vncson
 
Virtualising Your Data Center
Virtualising Your Data CenterVirtualising Your Data Center
Virtualising Your Data Center
Lai Yoong Seng
 
The Architecture Of V Mware Es Xi
The Architecture Of V Mware Es XiThe Architecture Of V Mware Es Xi
The Architecture Of V Mware Es Xi
Rishi Sharma
 
Aidan finn vmm 2008 r2 - minasi forum 2010
Aidan finn   vmm 2008 r2 - minasi forum 2010Aidan finn   vmm 2008 r2 - minasi forum 2010
Aidan finn vmm 2008 r2 - minasi forum 2010
Nathan Winters
 
It camp veeam presentation (no videos)
It camp veeam presentation (no videos)It camp veeam presentation (no videos)
It camp veeam presentation (no videos)
Harold Wong
 

Semelhante a Managing Hyper-V With PowerShell (20)

Automating Windows Server 2008 R2 Administration with Windows PowerShell
Automating Windows Server 2008 R2 Administration with Windows PowerShellAutomating Windows Server 2008 R2 Administration with Windows PowerShell
Automating Windows Server 2008 R2 Administration with Windows PowerShell
 
Virtualizare si SCVMM2008
Virtualizare si SCVMM2008Virtualizare si SCVMM2008
Virtualizare si SCVMM2008
 
Introduction to Hyper-V
Introduction to Hyper-VIntroduction to Hyper-V
Introduction to Hyper-V
 
Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008
 
SIM204-What's Coming in Virtual Machine Manager 2012?
SIM204-What's Coming in Virtual Machine Manager 2012?SIM204-What's Coming in Virtual Machine Manager 2012?
SIM204-What's Coming in Virtual Machine Manager 2012?
 
Say Bye to VMware PowerCLI ! Time to "GOVC"
Say Bye to VMware PowerCLI ! Time to "GOVC"Say Bye to VMware PowerCLI ! Time to "GOVC"
Say Bye to VMware PowerCLI ! Time to "GOVC"
 
System Center Virtual Machine Manager 2008 R2
System Center Virtual Machine Manager 2008 R2System Center Virtual Machine Manager 2008 R2
System Center Virtual Machine Manager 2008 R2
 
IBM’s System Director VMControl: Advanced Multi-Platform Virtualization Manag...
IBM’s System Director VMControl: Advanced Multi-Platform Virtualization Manag...IBM’s System Director VMControl: Advanced Multi-Platform Virtualization Manag...
IBM’s System Director VMControl: Advanced Multi-Platform Virtualization Manag...
 
Scvmm Technical Overview.Son Vu
Scvmm Technical Overview.Son VuScvmm Technical Overview.Son Vu
Scvmm Technical Overview.Son Vu
 
Lessons On Hyper V
Lessons On Hyper VLessons On Hyper V
Lessons On Hyper V
 
System Center 2012 for VMware Infrastructure
System Center 2012 for VMware InfrastructureSystem Center 2012 for VMware Infrastructure
System Center 2012 for VMware Infrastructure
 
10215 A 05
10215 A 0510215 A 05
10215 A 05
 
10215 A 09
10215 A 0910215 A 09
10215 A 09
 
Upgrade, Migrate and Virtualisation with SharePoint 2010
Upgrade, Migrate and Virtualisation with SharePoint 2010Upgrade, Migrate and Virtualisation with SharePoint 2010
Upgrade, Migrate and Virtualisation with SharePoint 2010
 
Virtualising Your Data Center
Virtualising Your Data CenterVirtualising Your Data Center
Virtualising Your Data Center
 
The Architecture Of V Mware Es Xi
The Architecture Of V Mware Es XiThe Architecture Of V Mware Es Xi
The Architecture Of V Mware Es Xi
 
Managing Web Infrastructure Systems With Windows Power Shell™ 2.0 90
Managing Web Infrastructure Systems With Windows Power Shell™ 2.0 90Managing Web Infrastructure Systems With Windows Power Shell™ 2.0 90
Managing Web Infrastructure Systems With Windows Power Shell™ 2.0 90
 
Aidan finn vmm 2008 r2 - minasi forum 2010
Aidan finn   vmm 2008 r2 - minasi forum 2010Aidan finn   vmm 2008 r2 - minasi forum 2010
Aidan finn vmm 2008 r2 - minasi forum 2010
 
SVR208 Gaining Higher Availability with Windows Server 2008 R2 Failover Clust...
SVR208 Gaining Higher Availability with Windows Server 2008 R2 Failover Clust...SVR208 Gaining Higher Availability with Windows Server 2008 R2 Failover Clust...
SVR208 Gaining Higher Availability with Windows Server 2008 R2 Failover Clust...
 
It camp veeam presentation (no videos)
It camp veeam presentation (no videos)It camp veeam presentation (no videos)
It camp veeam presentation (no videos)
 

Mais de Ravikanth Chaganti

Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc indiaDesired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Ravikanth Chaganti
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanth
Ravikanth Chaganti
 

Mais de Ravikanth Chaganti (20)

Azure Bicep - An Introduction
Azure Bicep - An IntroductionAzure Bicep - An Introduction
Azure Bicep - An Introduction
 
Azure CLI 2.0 Tips and Tricks
Azure CLI 2.0 Tips and TricksAzure CLI 2.0 Tips and Tricks
Azure CLI 2.0 Tips and Tricks
 
Tests Driven PowerShell Learning
Tests Driven PowerShell LearningTests Driven PowerShell Learning
Tests Driven PowerShell Learning
 
PowerShell Data as File System
PowerShell Data as File SystemPowerShell Data as File System
PowerShell Data as File System
 
Azure at the command line
Azure at the command lineAzure at the command line
Azure at the command line
 
Microsoft Azure Cloud and DevOps
Microsoft Azure Cloud and DevOpsMicrosoft Azure Cloud and DevOps
Microsoft Azure Cloud and DevOps
 
Using PowerShell DSC with AWS Cloud and CloudFormation
Using PowerShell DSC with AWS Cloud and CloudFormationUsing PowerShell DSC with AWS Cloud and CloudFormation
Using PowerShell DSC with AWS Cloud and CloudFormation
 
Developing Infrastructure Code for CI & CD
Developing Infrastructure Code for CI & CDDeveloping Infrastructure Code for CI & CD
Developing Infrastructure Code for CI & CD
 
PowerShell DSC Partial Configurations and Cross-node Synchronization
PowerShell DSC Partial Configurations and Cross-node SynchronizationPowerShell DSC Partial Configurations and Cross-node Synchronization
PowerShell DSC Partial Configurations and Cross-node Synchronization
 
Operations Validation for Infrastructure As Code - PSConfEU 2016
Operations Validation for Infrastructure As Code - PSConfEU 2016Operations Validation for Infrastructure As Code - PSConfEU 2016
Operations Validation for Infrastructure As Code - PSConfEU 2016
 
Authoring Azure Resource Manager Templates - Future Unleashed 2015
Authoring Azure Resource Manager Templates - Future Unleashed 2015Authoring Azure Resource Manager Templates - Future Unleashed 2015
Authoring Azure Resource Manager Templates - Future Unleashed 2015
 
Cloud Computing for IT professionals
Cloud Computing for IT professionalsCloud Computing for IT professionals
Cloud Computing for IT professionals
 
Introduction to Microsoft Azure Compute
Introduction to Microsoft Azure ComputeIntroduction to Microsoft Azure Compute
Introduction to Microsoft Azure Compute
 
Cross platform configuration management using Desired State Configuration
Cross platform configuration management using Desired State ConfigurationCross platform configuration management using Desired State Configuration
Cross platform configuration management using Desired State Configuration
 
Windows Server 2012 R2 Hyper-V Replica
Windows Server 2012 R2 Hyper-V ReplicaWindows Server 2012 R2 Hyper-V Replica
Windows Server 2012 R2 Hyper-V Replica
 
Whats new in Windows Server 2012 R2 Hyper-V
Whats new in Windows Server 2012 R2 Hyper-VWhats new in Windows Server 2012 R2 Hyper-V
Whats new in Windows Server 2012 R2 Hyper-V
 
Configuration management comes to Windows
Configuration management comes to WindowsConfiguration management comes to Windows
Configuration management comes to Windows
 
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc indiaDesired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanth
 
PowerShell 3.0 workflows
PowerShell 3.0 workflowsPowerShell 3.0 workflows
PowerShell 3.0 workflows
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Managing Hyper-V With PowerShell

  • 1. Managing Microsoft Hyper-V with PowerShell Ravikanth Chaganti
  • 2. About Me Lead Engineer at Dell Windows PowerShell MVP Author of Free eBook: Layman’s guide to PowerShell 2.0 remoting Free eBook: WMI Query Language via PowerShell (coming soon) Co-author on Quest’s SharePoint 2010 & PowerShell cheat sheet Blog at http://www.ravichaganti.com/blog
  • 3. Agenda PowerShell 2.0 features Integrated Scripting Environment PowerShell remoting PowerShell for Hyper-V Hyper-V WMI – Overview Virtual Machine Management Virtual Network Management Virtual Storage Management Hyper-V PowerShell Module Q & A
  • 4. PowerShell 2.0 Features Advanced Functions Integrated Scripting Environment Remoting Background jobs Eventing Better error handling & debugging support Several new cmdlets
  • 5. Integrated Scripting Environment (ISE) Output Pane Script Pane Command Pane
  • 6. PowerShell Remoting Enables Universal Code Execution Model Whatever runs locally should run anywhere Uses Windows Remote Management Supports several remoting methods Invoke-Command Interactive remoting Implicit remoting
  • 7. PowerShell for Hyper-V No built-in cmdlets Rich set of WMI interfaces under rootirtualization namespace 108 classes prefixed with Msvm_ Complex to script PowerShell module for Hyper-V Developed by James O’neill http://pshyperv.codeplex.com System Center Virtual Machine Manager cmdlets
  • 8. Hyper-V WMI - Overview Get enabled when Hyper-V role is installed Present in rootirtualization namespace 108 classes Excluding the CIM and system classes Can be categorized in to: BIOS Input Integration Component Memory / Processor / Networking / Storage / Serial / Video Devices Virtual System & Virtual System Management Profile Registration & Resource Management
  • 9. Hyper-V WMI: Virtual Machine Management Msvm_VirtualSystemManagementService class is used Create, Delete, and Manage VMs DefineVirtualSystem DestroyVirtualSystem ModifyVirtualSystem ModifyVirtualSystemResources RemoveVirtualSystemResources Import, Export, and snapshot VMs ImportVirtualSystemEx ExportVirtualSystemEx CreateVirtualSystemSnapshot RemoveVirtualSystemSnapshot
  • 10. Hyper-V WMI: Virtual Network Management Msvm_VirtualSwitchManagementService class is used Create, Delete, and Manage virtual network components CreateSwitch CreateSwitchPort DeleteSwitch DeleteSwitchPort ConnectSwitchPort DisconnectSwitchPort
  • 11. Hyper-V WMI: Virtual Storage Management Msvm_ImageManagementService class is used Create, Mount, and Dismount virtual media CreateFixedVirtualHardDisk CreateDynamicVirtualHardDisk CreateDifferencingVirtualHardDisk Mount Unmount ValidateVirtualHardDisk
  • 12. Hyper-V PowerShell Module Scripting WMI interfaces is Quite complex Quite verbose Hyper-V PowerShell Module Developed by James O’neill Can be download from http://pshyperv.codeplex.com Import-Module –Name hyperv Get-Command –Module hyperv Contains 122 cmdlets
  • 13. Hyper-V PowerShell Module: Virtual Machine Get-VM New-VM Remove-VM Move-VM Export-VM Import-VM Many more…. Get-Command -noun VM*
  • 14. Get-VMSwitch New-VMExternalSwitch New-VMInternalSwitch New-VMPrivateSwitch Remove-VMSwitch Many More.. Get-Command –Noun VM*Switch Get-Command -Noun VMNIC* Hyper-V PowerShell Module: Virtual Network
  • 15. Hyper-V PowerShell Module: Virtual Storage Compress-VHD Convert-VHD Dismount-VHD Expand-VHD Get-VHD Merge-VHD Mount-VHD New-VHD Test-VHD Add-VMDrive Remove-VMDrive
  • 16. Hyper-V PowerShell Module: VM Resources Add-VMNIC Add-VMDisk Set-VMCPUCount Set-VMMemory Set-VM Many More..
  • 17. References Hyper-V WMI interfaces: http://msdn.microsoft.com/en-us/library/cc136986(v=VS.85).aspx PowerShell Module for Hyper-V: http://pshyperv.codeplex.com Getting Started with PowerShell: http://technet.microsoft.com/en-us/scriptcenter/dd742419
  • 18. Q & A