Introduction To Managing VMware With PowerShell

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    4 Favorites

    Introduction To Managing VMware With PowerShell - Presentation Transcript

    1. Hal Rottenberg [email_address]
      • Hal Rottenberg [email_address]
        • Over 12 years in the IT industry; everything from helpdesk, to sysadmin, to technical consultant
        • Author, Managing VMware Infrastructure with PowerShell: TFM from Sapien Press (due out “as soon as he can possibly get it done”)
        • Community Director, PowerShellCommunity.org
        • Co-Host, PowerScripting Podcast (powerscripting.net)
        • Blog Author, TechProsaic (halr9000.com)
      • Introduction
      • Feature overview
      • Demo 1: new providers
      • New Cmdlets
      • Demo 2: “wiki deploy”
      • Demo 3: Creating a VM
      • Demo 4: Access VI SDK
      • Programming API
        • Web service (WSDL)
        • Samples included for Java, C, C#
        • Low level
      • Scripting API
        • Perl and COM interfaces available
        • Wrapper for web services
      • You still must learn the VI SDK
      • Higher level than SDK, but not by much
      • Perl interface not familiar to Windows admins
      • COM interface was not very popular, hard to find examples
      • PowerShell snap-in
      • Client-side “automation objects” correspond to server-side “managed objects” and “managed entities”
      • Not just a web service wrapper
      • Favors action-oriented cmdlets over object methods
      • Goal: 80% of tasks will not require SDK
      • Ability to access the SDK for more complex tasks
      • Fully supported:
        • Virtual Center 2.x
        • ESX Server 3.x (including 3i)
      • Unofficially supported:
        • VMware Server 2.0 beta
      • Works with PowerShell v1 or v2 CTP
      • Includes over 120 cmdlets
      Count Name Group ----- ---- ----- 1 Add {Add-VMHost} 1 Connect {Connect-VIServer} 1 Disconnect {Disconnect-VIServer} 1 Dismount {Dismount-Tools} 37 Get {Get-CDDrive, Get-Cluster, Get-Datacenter,... 1 Mount {Mount-Tools} 7 Move {Move-Cluster, Move-Datacenter, Move-Folde... 19 New {New-CDDrive, New-Cluster, New-CustomField... 20 Remove {Remove-CDDrive, Remove-Cluster, Remove-Cu... 2 Restart {Restart-VMGuest, Restart-VMHostService} 27 Set {Set-CDDrive, Set-Cluster, Set-CustomField... 1 Shutdown {Shutdown-VMGuest} 2 Start {Start-VM, Start-VMHostService} 3 Stop {Stop-Task, Stop-VM, Stop-VMHostService} 2 Suspend {Suspend-VM, Suspend-VMGuest} 1 Test {Test-VMHostSNMP} 1 Update {Update-Tools} 1 Wait {Wait-Task}
      • Also includes two PSProviders
        • Remote filesystem (datastore) access via VimDatastore provider
        • Hierarchical management of Folders, Datacenters, VMHosts, VMs using VimInventory provider
      Name Capabilities Drives ---- ------------ ------ VimDatastore Filter, ShouldProcess {DS} VimInventory Filter {VI}
      • VimInventory
      • VimDatastore
        • New-PSDrive -Name VI -PSProvider VimInventory `
        • -Root '/' -location (Get-Folder -NoRecursion)
        • New-PSDrive -Name DS -PSProvider VimDatastore `
        • -Root '/' -location (Get-Datastore $DatastoreName)
      EXPERIMENTAL!
    2.  
        • Get-VM
        • Get-VMHost
        • Get-CDDrive
        • Get-Cluster
      PS > Get-VM Name PowerState Num CPUs Memory (MB) ---- ---------- -------- ----------- SDK-RHAS4U4 PoweredOff 1 512 SDK-W2003ENT PoweredOff 1 256 fudgeapp01 PoweredOff 1 256 fudgedb01 PoweredOff 1 512 vcenter.halr9000.com PoweredOn 2 1500 fudgedb02 PoweredOff 1 1024 SDK-XPSP2 PoweredOff 1 256 PS > Get-VMHost Name State Id ---- ----- -- 192.168.0.51 Connected HostSys... 192.168.0.55 Connected HostSys... PS > Get-VM vcenter.halr9000.com | Get-CDDrive ISOPath : HostDevice : RemoteDevice : ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl ID : VirtualMachine-vm-158/3000 Name : CD/DVD Drive 1 PS > Get-Cluster "test cluster" | fl HAEnabled : False HAAdmissionControlEnabled : False HAFailoverLevel : 1 DRSEnabled : False DRSMode : FullyAutomated CustomFields : {} ID : ClusterComputeResource-domain-c449 Name : Test Cluster
      • New-Datacenter
      • New-Cluster
      • Add-VMHost
      • New-VM
      • Create folders “wiki-style”
      • Cmdlets used:
        • New-VM
      • Remove-Snapshot
      • Move-VM
      • Set-NetworkAdapter
      • Restart-VMGuest
      • Cmdlets used:
        • New-Snapshot
      • get-vm MYSERVER | move-vm -dest (get-vmhost ESX2)
      • get-cluster TEST | get-vm | move-vm –dest (get-cluster PRODUCTION)
    3.  
      • Get-VIEvent
      • Get-Task
      • Get-Log
      • Get-Stat
      • Cmdlets used:
        • Get-VIEvent
      • When the simplified interface doesn’t cut it…you can always work with the SDK
      • Cmdlets used
        • Get-View
      • ISCSI Configuration
    4.  
      • VI Toolkit: http://vmware.com/go/powershell
      • VI Toolkit blog: http://blogs.vmware.com/vipowershell/
      • VI Toolkit Community: http://communities.vmware.com/community/developer/windows_toolkit
      • PowerShellCommunity.org: http://powershellcommunity.org
      • PowerScripting Podcast: http://powerscripting.net
      • Managing VI with PowerShell: TFM: http://sapienpress.com/vmware.asp
      • Hal’s Blog: http://halr9000.com
    5.  

    + Hal RottenbergHal Rottenberg, 11 months ago

    custom

    1927 views, 4 favs, 0 embeds more stats

    Introduction to the VI Toolkit which is available a more

    More info about this document

    CC Attribution License

    Go to text version

    • Total Views 1927
      • 1927 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 4
    • Downloads 19
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories