34
Date: May 4th – 7th, 2009 Prepared for: 2009 Virtualization Congress Managing Virtual Infrastructures with Microsoft PowerShell

Managing Virtual Infrastructures With PowerShell

Embed Size (px)

DESCRIPTION

The slide deck from VC 101: Managing Virtual Infrastructures with PowerShell

Citation preview

Page 1: Managing Virtual Infrastructures With PowerShell

Date: May 4th – 7th, 2009

Prepared for: 2009 Virtualization Congress

Managing Virtual Infrastructureswith Microsoft PowerShell

Page 2: Managing Virtual Infrastructures With PowerShell

The Boring Stuff... 

Page 3: Managing Virtual Infrastructures With PowerShell

This presentation may contain forward-looking statements that involve risks, uncertainties and assumptions. If such risks or uncertainties materialize or such assumptions prove incorrect, the results of Rackspace Hosting could differ materially from those expressed or implied by such forward-looking statements and assumptions. All statements other than statements of historical fact are statements that could be deemed forward-looking statements, including any statements concerning expected development, performance or market acceptance associated with products; anticipated operational and financial benefits from our products and services; any statements of expectation or belief; and any statements of assumptions underlying any of the foregoing.

Risks, uncertainties and assumptions include the possibility that expected benefits from our products may not materialize because they are not generally accepted in the marketplace, which could occur due to certain factors including (i) a failure to market the product cost effectively, differentiate the product from competitive products or communicate differentiations effectively, (ii) the reliability, quality or compatibility associated with the product, (iii) changes in technology which adversely effect the product’s benefit, (iv) slowdowns in the general economy or technology industry that impact consumer spending habits, and (v) internal strategy decisions that impact the product.

Further information on these and other factors that could affect our financial results is included in the reports on Forms 10-K, 10-Q and 8-K and in other filings we make with the Securities and Exchange Commission from time to time. These documents are available on the SEC Filings section of the Investor Information section of our website at http://ir.rackspace.com.

 Except as required by law, Rackspace Hosting assumes no obligation to update these forward-looking statements publicly, or to update the reasons actual results could differ materially from those anticipated in these forward-looking statements, even if new information becomes available in the future.

Safe Harbor Statement

Page 4: Managing Virtual Infrastructures With PowerShell

• Introductionso What’s this all about? o Who are we?• PowerShello PowerShell Basicso Differences in Toolkits  • Putting The Power Into Playo Exampleso Demoso More Examples o Advanced Topics• Resources• Q&A

Agenda

Page 5: Managing Virtual Infrastructures With PowerShell

What’s this all about?

Page 6: Managing Virtual Infrastructures With PowerShell

What can you say about any good systems administrator?

They’re lazy...

Why would we say this?

Page 7: Managing Virtual Infrastructures With PowerShell

A lot of our daily tasks are repetitive, mundane, and required!!!

So how does that make a good systems administrator lazy?

Using automation, scripting, and doing more with less is lazy!(Insert something about the

economy ‘here’)

Page 8: Managing Virtual Infrastructures With PowerShell

Powershell does this!

Powershell loves this!

And it’s easy!

Page 9: Managing Virtual Infrastructures With PowerShell

Who Are We?

Page 10: Managing Virtual Infrastructures With PowerShell

Who are we?

Cody Bunch

Rackspace Engineer

Windows User

Virtualization Geek

Patrick Ancillotti

Rackspace Engineer

*nix User

Virtualization Geek

but most of all... ADMINS!

Page 11: Managing Virtual Infrastructures With PowerShell

PowerShell?

Page 12: Managing Virtual Infrastructures With PowerShell

What is Powershell?

Wikipedia calls it : Windows PowerShell is an extensible command-line shell and associated scripting language from Microsoft. It was released in 2006 ...

We call it : PowerShell is geared around making your life as an ADMIN Easier. PowerShell can be used for:•Scripting! - Automation, Woot!• Interactive Command Shell•GUI!

MSDN calls it : Windows PowerShell is a new Windows command-line shell designed especially for system administrators...

Page 13: Managing Virtual Infrastructures With PowerShell

PowerShell & Virtualization

Virtualization Vendor Support for PowerShell:

• Citrix XenServer/XenCenterhttp://community.citrix.com/cdn/xs/sdks

• VMware VI Toolkit for Windowshttp://vmware.com/go/powershell/

• Microsoft SCVMMhttp://www.codeplex.com/PSHyperV

Page 14: Managing Virtual Infrastructures With PowerShell

What's Different?

What's Different:• Major feature differences • cmdlet differences• Syntax changes• Maturity

• VMWare!• Hyper-V• Xen

Page 15: Managing Virtual Infrastructures With PowerShell

Toolkit Maturity

– VMWare!• Full suite of cmdlets• Well Supported Community• Well published documentation

– Hyper-V• Full suite of cmdlets (SCVMM 2008)• Well published documentation (resources slide)

– Xen• Cmdlets• A few random blog posts• Requires ‘Initialize-XenServer:Aliases’ to behave like

other toolkits.

Page 16: Managing Virtual Infrastructures With PowerShell

Putting The Power Into Play

Page 17: Managing Virtual Infrastructures With PowerShell

Managing Hypervisors! - Basic Examples

• Storage? Who Needs Storage?

•Networking!

Page 18: Managing Virtual Infrastructures With PowerShell

Storage!

• On VMwareo New-Datastoreo Set-Datastoreo Remove-Datastore

• On Xeno Create-Xenserver:SRo Set-Xenserver:SR.*o Destroy-SR

• On Hyper-Vo Handled by Windows/Undocumented...?

Page 19: Managing Virtual Infrastructures With PowerShell

Networking! - Virtual Switches

• On VMwareo New/Set/Remove-VirtualSwitcho New/Set/Remove-VirtualPortGroupo New/Set/Remove-VMHostNetworkAdaptor

• On Xeno Create-Xenserver:Networko Set-Xenserver:Network.*o Destroy-Xenserver:Network

• On Hyper-Vo New-VirtualNetworko Get/Set-VirtualNetworko Remove-VirtualNetwork

Page 20: Managing Virtual Infrastructures With PowerShell

Demo!

Page 21: Managing Virtual Infrastructures With PowerShell

Managing VMs! - Basics

• Pop a VM in the oveno Add VMso Remove VMs

• Whoops! Changes.o Add A NICo Change Memory

• Power Operationso Power Ono Power Off

Page 22: Managing Virtual Infrastructures With PowerShell

Pop a VM in the oven.

• On VMwareo New-VMo Get-VM/Set-VMo Remove-VM

• On Xeno Create-XenServer:VMo Get-XenServer:VM/Set-XenServer:VM.* o Destroy-XenServer:VM

• On Hyper-Vo New-VMo Get-VM/Set-VMo Remove-VM

Page 23: Managing Virtual Infrastructures With PowerShell

Whoops! Changes.

• On VMwareo Get-VM | Set-VM -MemoryMB 1024o Get-VM | New-NetworkAdaptor

• On Xeno Get-Xenserver:VM | Set-Xenserver:VM.MemoryStaticMax

-Value 1024o Dunno

• On Hyper-Vo Get-VM | Set-VM -MemoryMB 1024o Get-VM | New-VirtualNetworkAdaptor

They happen, heres how you would change memory & network info on a VM

Page 24: Managing Virtual Infrastructures With PowerShell

Feel The Power! - Power Operations

• On VMwareo Get-VM -Name $Name | Start-VMo Get-VM -Name $Name | Stop-VM

• On Xen o Get-XenServer:VM | Invoke-XenServer:VM.starto Get-XenServer:VM | Invoke-XenServer:VM.hardshutdown

• On Hyper-V o Get-VM -Name $Name | Start-VMo Get-VM -Name $Name | Shutdown-VM o Get-VM -Name $Name | Stop-VM

Page 25: Managing Virtual Infrastructures With PowerShell

Demo!

Page 26: Managing Virtual Infrastructures With PowerShell

Advanced Topics

Page 27: Managing Virtual Infrastructures With PowerShell

Mass Deploy•Deploy from CSV!

Feel The Power! Advanced Stuff!

E-mail Reports•How Many Chickens?

Page 28: Managing Virtual Infrastructures With PowerShell

Demo!

Page 29: Managing Virtual Infrastructures With PowerShell

 Funky stuff that other people have done: 

•VMware vDiagram (http://teckinfo.blogspot.com/2009/01/vdiagram-document-your-vi-with-one.html)

•VMware Health Check Script (http://www.ivobeerens.nl/?p=256)

•VMware Blue Screen Detector(http://www.ntpro.nl/blog/archives/1100-Virtual-Machine-Blue-Screen-detector.html)

•And more coming....

Feel The Power! - Community...

Page 30: Managing Virtual Infrastructures With PowerShell

Resources!

Page 31: Managing Virtual Infrastructures With PowerShell

• http://www.thepowershelltalk.com - Coming Soon!!! Slide Deck, Code Demonstrated, Video Tutorials, Podcast, and more.

Where to from here?

• Forums!

• IRC!

• Community Blogs!

• And many more!!!

Page 32: Managing Virtual Infrastructures With PowerShell
Page 33: Managing Virtual Infrastructures With PowerShell

Q & A

Page 34: Managing Virtual Infrastructures With PowerShell

That’s all folks!