Automation using power cli

936 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
936
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
18
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Automation using power cli

  1. 1. Automa'on  Using  PowerCLI   Eric  Wannemacher  
  2. 2. h9p://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Atlas_San'ago_Toural_GFDL.jpg/220px-­‐ Atlas_San'ago_Toural_GFDL.jpg  
  3. 3. Give  me  a  lever  long  enough  and  a  fulcrum  on  which  to  place  it,  and   I  shall  move  the  world.     Archimedes    
  4. 4. vs.  
  5. 5. How  Do  I  Use  It?   •  Things  that  are  boring/repe''ve   –  Server  builds   –  LUN  migra'ons   –  Changing  seRngs  across  many  hosts/VMs   –  Reports  for  management/other  teams   –  Managing  mul'ple  vCenters   •  Things  I  should  do,  but  may  not  otherwise   –  Configura'on  monitoring   –  Log  review  
  6. 6. GeRng  Started   •  Install  PowerShell  (v2  if  possible)   •  Run  “Set-­‐Execu'onPolicy  RemoteSigned”   •  Install  PowerCLI  4.0  U1  (Maybe  4.1)   •  Connect-­‐VIServer  <host  or  vCenter>   •  MAGIC   •  Disconnect-­‐VIServer  
  7. 7. Demo  Recipes   h9p://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Cheese_Soup_Recipe.jpg/800px-­‐Cheese_Soup_Recipe.jpg  
  8. 8. Making  Toast   # List all VMs Get-VM # Get one VM Get-VM ubuntu01 # Get VMs that match Get-VM ubuntu*  
  9. 9. Boiling  an  Egg   # List VMs in a Datacenter Get-Datacenter dc001 | Get-VM # List VMs in a cluster Get-Cluster dc001 | Get-VM  
  10. 10. Sieing  Through  What  You  Have   # Get 2 CPU or larger VMs Get-VM | Where-Object {$_.NumCPU -ge 2} # Get 2 GB RAM or larger VMs Get-VM | Where-Object {$_.MemoryMB -ge 2048}  
  11. 11. Available  Ingredients   Get-Command Get-VICommand Summarized By Noun h9p://wannemacher.us/?p=315   Get-Help Get-VM Get-Member Get-VM | Get-Member  
  12. 12. Addi'onal  Info   •  Local  Resources   –  h9p://vmwarescrip'ng.com   –  h9p://wannemacher.us   •  Other   –  Managing  VMware  Infrastructure  with  Windows   PowerShell  TFM   –  The  VMware  Community  Forums  (LucD)   –  Google  

×