Managing VMware with PowerShell - VMworld 2008

  • 5,821 views
Uploaded on

This is the slide deck I used during my talk "Managing VMware with PowerShell" at VMworld 2008. Some video snippets of the presentation are also available at …

This is the slide deck I used during my talk "Managing VMware with PowerShell" at VMworld 2008. Some video snippets of the presentation are also available at http://communities.vmware.com/thread/169066

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
5,821
On Slideshare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
211
Comments
0
Likes
4

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • (All VMware employees must include this slide)

Transcript

  • 1. Disclaimer This session may contain product features that are currently under development. This session/overview of the new technology represents no commitment from VMware to deliver these features in any generally available product. Features are subject to change, and must not be included in contracts, purchase orders, or sales agreements of any kind. Technical feasibility and market demand will affect final delivery. Pricing and packaging for any new technologies or features discussed or presented have not been determined. “ These features are representative of feature areas under development. Feature commitments are subject to change, and must not be included in contracts, purchase orders, or sales agreements of any kind. Technical feasibility and market demand will affect final delivery.”
  • 2. Managing VMware With PowerShell Carter Shanklin – Product Manager, VMware Andrey Anastasov – PowerShell Architect, VMware Dmitry Sotnikov – Manager and Microsoft MVP, Quest Software
  • 3. My goal today is simple.
    • Convince you that
    • any serious VMware admin
    • MUST know
    • the VI Toolkit for Windows.
  • 4. Not convinced?
    • To prove this I will:
      • Introduce The VI Toolkit for Windows.
      • Show you the top 3 ways the Toolkit makes your life easier.
      • Show you lots of samples as well as the resources available.
      • Demonstrate how PowerGUI can help you get started.
      • Tell you how to get the toolkit so you can get started today.
  • 5. Introducing The VI Toolkit (for Windows).
    • The VI Toolkit for Windows simplifies large-scale management.
      • Get a handle on VM sprawl or out-of-control snapshots through automation.
    • It’s a scripting tool, based on PowerShell.
    • It’s easy to use.
      • Many useful actions require 0 scripting.
    • It provides 125 powerful cmdlets.
      • Covers all aspects of Virtual Infrastructure management.
    • It’s completely FREE!
  • 6. What is PowerShell?
    • PowerShell is Microsoft’s new foundation for management.
      • PowerShell support is required for all Microsoft Server apps.
      • Manages different applications in a consistent way.
      • Chances are, you are learning it or planning to learn it.
  • 7. What does PowerShell look like?
    • PowerShell is centered around cmdlets.
      • Cmdlets are provided to do all sorts of tasks.
      • More cmdlets can be added with 3 rd party snapins.
      • Cmdlets can be strung together using pipelines.
    • PowerShell cmdlets use common conventions.
      • Cmdlets follow the Verb-Noun convention.
        • Example: Get-Process.
      • This tends to lead to commands that follow our thinking.
        • Example: Get-Process notepad | Stop-Process
    • PowerShell is object-oriented.
      • No more text parsing!
  • 8. Top 3 ways your life gets better with the Toolkit.
      • Save time by automating repetitive tasks. 100 is just as easy as 1.
      • Automate time consuming tasks for greater productivity. Let your scripts do the waiting.
      • Turn questions into answers with our large and growing set of online resources.
  • 9.
    • Disconnect CD-ROM and floppy drives to enable VMotion.
    Automate Repetitive Tasks. PowerShell: 2 Commands Full Automation Manually: 1 Minute / VM BORING!
  • 10.
    • Cloning a VM many times can take forever.
    Save time: Attack of the clones. PowerShell: As little as 1 command Full Automation Manually: 10 Min+ / VM BORING!
  • 11.
    • A customer needed to create secondary service consoles on 400+ hosts.
    The story you are about to witness is real. PowerShell: Automated, with forum support. Manually: 400 Hosts 20+ Hours
  • 12. A tour of the toolkit.
    • VM Lifecycle:
      • New-VM, Start-VM, Set-VM
    • Snapshots:
      • Get-Snapshot, New-Snapshot, Set-VM
    • Templates and Customization Specs:
      • New-Template, New-OSCustomizationSpec, New-VM
    • Virtual Switches:
      • New-VirtualSwitch, New-VirtualPortGroup, Set-VirtualSwitch
    • Performance Statistics and Monitoring:
      • Get-Stat
    • 125 cmdlets in total.
  • 13. VI Toolkit types tag cloud. The focus is on VM and ESX Management, But you can manage all aspects of VI with the toolkit.
  • 14. Incredibly Powerful Examples:
    • Snapshot every VM you have:
      • Get-VM | New-Snapshot –Name “New Snapshot”
    • Find all snapshots older than 1 month:
      • Get-VM | Get-Snapshot |
      • Where { $_.Created –lt (Get-Date).addMonths(-1) }
    • Change every VM on Network A to Network B:
      • Get-VM | Get-NetworkAdapter |
      • where { $_.NetworkName –eq “Network A” } |
      • Set-NetworkAdapter –NetworkName B
  • 15. More Incredibly Powerful Examples:
    • Ensure all your VMs have at least 1GB of RAM:
      • Get-VM | Where { $_.MemoryMB –lt 1024 } |
      • Set-VM –MemoryMB 1024
    • Update VMware Tools in every VM in the “Americas 1” datacenter:
      • Get-Datacenter “Americas 1” | Get-VM | Update-Tools
    • Restart an unresponsive VirtualCenter agent:
      • Get-VMHost badhost | Get-VMHostService |
      • Where { $_.key –eq “vmware-vpxa” } |
      • Restart-VMHostService
  • 16. As if that weren’t enough!
    • Rescan every HBA on all hosts:
      • Get-VMHost | Get-VMHostStorage -RescanAllHba
    • Ensure your VMs will all start after ESX is restarted:
      • Get-VMHostStartPolicy |Set-VMHostStartPolicy -enabled:$true
      • Get-VM | Get-VMStartPolicy |
      • Set-VMStartPolicy -StartAction poweron
    • Move every VM on host A to host B:
      • Get-VMHost A | Get-VM |
      • Move-VM –destination (Get-VMHost B)
  • 17. A Tour of Available Resources.
    • The VI Toolkit (for Windows) Community.
      • A very active community with lots of very smart people.
      • Over 300 examples to guide you.
    • The VI Toolkit (for Windows) FAQ.
      • 40 frequently asked questions with answers.
      • Plenty of sample code.
    • The VI Toolkit (for Windows) Blog.
      • Lots of examples and ideas.
      • Updated regularly.
    • All available from http://vmware.com/go/powershell
  • 18. Announcing The VI Toolkit Community Extensions.
    • The VI Toolkit Community Extensions:
      • A module that can be loaded into your scripts.
      • Open source.
      • A way for us to make all of the good ideas in our forums more accessible.
      • Uses scripts so everyone can contribute.
      • A “first line” for new functionality.
    • Download it at http://codeplex.com/vitoolkitextensions
  • 19. What can you learn through these resources?
    • Among other things you can learn to:
      • Change the VMware tools upgrade policy.
      • List all storage world wide names.
      • Register unregistered VMs.
      • Create reports.
      • Customize VM hardware.
      • Remotely power ESX hosts on and off.
      • Configure NTP.
      • Execute scripts in response to VirtualCenter alarms.
      • Much, much more!
  • 20. What to expect in the future.
    • Even better VI management.
      • We’ll continue to make the VI admin’s life easy.
    • Support for more VMware products.
      • Products that complement and extend VMware VI.
    • Improved VMware PowerShell Community Extensions.
      • This will hold a large library of cmdlets of all different types.
      • Share your own ideas and help us build this community.
  • 21. Don’t be a script-o-phobe!
    • PowerGUI Script Editor makes writing scripts easy.
      • Syntax highlighting.
      • Name completion.
    • PowerGUI Admin Console generates code for you!
      • No more “I’ve been meaning to get around to it”.
  • 22. DEMO
  • 23. Convinced? Get the toolkit today! http://vmware.com/go/powershell
  • 24. Q&A Breakout Session #AD2764 Carter Shanklin Additional Information Product Manager, VMware Inc. http://vmware.com/go/powershell 9/16/2008