• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Managing Hyper-V With PowerShell
 

Managing Hyper-V With PowerShell

on

  • 7,794 views

This was the slide deck used for my technet Webcast

This was the slide deck used for my technet Webcast

Statistics

Views

Total Views
7,794
Views on SlideShare
7,728
Embed Views
66

Actions

Likes
0
Downloads
64
Comments
0

1 Embed 66

http://www.ravichaganti.com 66

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Managing Hyper-V With PowerShell Managing Hyper-V With PowerShell Presentation Transcript

    • 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 rootvirtualization 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 rootvirtualization 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