Managing Virtual Infrastructures With PowerShell

Post on 24-May-2015

2,301 views 8 download

Tags:

description

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

transcript

Date: May 4th – 7th, 2009

Prepared for: 2009 Virtualization Congress

Managing Virtual Infrastructureswith Microsoft PowerShell

The Boring Stuff... 

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

• 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

What’s this all about?

What can you say about any good systems administrator?

They’re lazy...

Why would we say this?

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’)

Powershell does this!

Powershell loves this!

And it’s easy!

Who Are We?

Who are we?

Cody Bunch

Rackspace Engineer

Windows User

Virtualization Geek

Patrick Ancillotti

Rackspace Engineer

*nix User

Virtualization Geek

but most of all... ADMINS!

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...

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

What's Different?

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

• VMWare!• Hyper-V• Xen

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.

Putting The Power Into Play

Managing Hypervisors! - Basic Examples

• Storage? Who Needs Storage?

•Networking!

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...?

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

Demo!

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

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

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

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

Demo!

Advanced Topics

Mass Deploy•Deploy from CSV!

Feel The Power! Advanced Stuff!

E-mail Reports•How Many Chickens?

Demo!

 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...

Resources!

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

Q & A

That’s all folks!