managing the infrastructure stack with powershell
TRANSCRIPT
![Page 1: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/1.jpg)
Managing the InfrastructureStack with PowerShell
Josh AtwellDeveloper Advocate
SolidFire, now part of NetApp
@josh_atwell#PSHSUMMIT
![Page 2: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/2.jpg)
Celebrating 10 Years of PowerShell2006 - 2016• Jeffrey Snover• Kenneth Hansen• Lee Holmes• Narayanan Lakshmanan• Hemant Mahawar• Bruce Payette• Hitesh Raigandhi• Dan Travison• Jim Truher• Krishna Vutukuri
Congratulations to the team members who’ve been there
since the beginning…...and thanks for all
the great work!
![Page 4: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/4.jpg)
Why PowerShell the Stack?Why wouldn’t you? PowerShell ALL the things!
![Page 5: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/5.jpg)
Twitter PollI polled twitter to see how many layers people are managing with PowerShell
![Page 6: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/6.jpg)
We Now Have• More Layers• More complexity• Consumption models
have shiftedSeeking• Management at Scale• DevOps / Lean Ops• More IT as a Service
Physical Hardware
Operating System
App
VirtualizationNSXACI
vCenter Server
vRealize Suite
Orchestrator
Operating System
App App
VIOHyper-V
System Center
Orchestrator
![Page 7: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/7.jpg)
Let’s Start with the ToolsWhen you’re a hammer every problem is a nail.
![Page 8: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/8.jpg)
More APIs = More PowerShellGrowth of infrastructure extensibility means more opportunities for PowerShell and its users
![Page 9: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/9.jpg)
Infrastructure Tools• PowerShell• VMware PowerCLI• OpenStack PoshShell• Cisco UCS Powertool• HP Scripting Tools for
PowerShell• SolidFire PowerShell Tools• NetApp PowerShell Toolkit• Community
• PowerNSX• EMC {Code}
![Page 10: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/10.jpg)
Physical Hardware
Operating System
App
VirtualizationNSXACI
vCenter Server
vRealize Suite
Orchestrator
Operating System
App App
VIOHyper-V
System Center
Orchestrator
![Page 11: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/11.jpg)
Use CasesWhat to do with this toolbox
![Page 12: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/12.jpg)
PowerShelling StackDuh• Reporting• Implementation• DevOps• Configuration• Extending Tools
![Page 13: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/13.jpg)
Physical
Operating System
App
VirtualizationVirtual Switch
Uplink
VLANMTU
Ethernet Port
Switch Port
Storage
Adapter
![Page 14: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/14.jpg)
Physical
Operating System
App
VirtualizationVMDK / VHD
Datastore
Storage
Volume/Lun
Disk / Mount
Hard Drives
Which VMDK?
Which Datastore?
Which Lun?
Process{$scsiID = ((Get-ScsiLun -Datastore $datastore).CanonicalName).Split(".")[1] $result = Get-SFVolume | Where{$_.ScsiNAAdeviceID -eq $scsiID} Return $result}
![Page 15: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/15.jpg)
DMZDSC in the DMZOperating System
App DSC
vCenter Server
ESXi
DSC
DSC
VMware Tools
https://github.com/DevOpsForVMwareAdministrators/powershell-dsc
?
# Copy the script to the designated directory on target VM
Copy-VMGuestFile -Source $script -Destination $mofpath -LocalToGuest -VM $vm -HostCredential $cred -Server $vcenter -GuestCredential $guestcred
# Invoke the copied script on the target VM
Invoke-VMScript -ScriptText $moffile -VM $vm -HostCredential $cred -Server $global:DefaultVIServer -GuestCredential $guestcred
No Open Ports
![Page 16: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/16.jpg)
PowerActions• Embeds PowerCLI with
vSphere Web Client• Extend web client
capabilities
![Page 17: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/17.jpg)
Let’s learn some cmdletsJust Kidding. Let’s talk challenges
![Page 18: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/18.jpg)
Core Challenges• Managing Multiple
Modules/Tools• Relationship Mapping• Scale
![Page 19: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/19.jpg)
Multiple Providers• PSSnapin vs Modules• Each Vendor has an installer• $env:PSModulePath
Defaults• $home\Documents\
WindowsPowerShell\Modules; $pshome\Modules.
![Page 20: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/20.jpg)
Physical
Operating System
App
VirtualizationVMDK / VHD
Datastore
Storage
Volume/Lun
Disk / Mount
Hard Drives
Which VMDK?
Which Datastore?
Which Lun?
Query for that information can be cumbersomeCollect All | Filter | Grab Piece you really wanted
![Page 21: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/21.jpg)
Physical
Operating System
App
VirtualizationVirtual Switch
Uplink
VLANMTU
Ethernet Port
Switch Port
Adapter
![Page 22: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/22.jpg)
Application DNAApplying Relationship Maps
Physical
Operating System
VirtualizationVirtual Switch
Uplink
Ethernet Port
Switch Port
Storage
Adapter
VMDK / VHD
Datastore
Volume/Lun
Disk / Mount
Hard Drives
JSONXMLCSV
SQL DB
vRAM
Sys Memory
pRAM
Server
ESXi Host
![Page 23: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/23.jpg)
Example
$scsiID = ((Get-ScsiLun -Datastore $datastore).CanonicalName).Split(".")[1] $result = Get-SFVolume | Where{$_.ScsiNAAdeviceID -eq $scsiID}
$result | ConvertTo-JSON | Set-Content Datastore-Volume.JSON
$global:DSVol = (Get-Content Datastore-Volume.JSON) –join “`n” | ConvertFrom-JSON
$scsiID = ($global:DSVol | Where{$_.DatastoreName –eq ‘DatastoreName’}).scsiID$result = Get-SFVolume | Where{$_.ScsiNAAdeviceID -eq $scsiID}
![Page 24: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/24.jpg)
Why App DNA?
• Quicker Reporting• Shorter Time to Resolution• Faster Implementation• Improve Value Stream• Dynamic Parameter Sets• Faster PowerActions or vRO
calls.
![Page 25: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/25.jpg)
Growth Areas• More DSC Resources
• Cisco UCS PowerTool DSC
• Moving away from PSSnapins
![Page 26: Managing the Infrastructure Stack with PowerShell](https://reader035.vdocuments.site/reader035/viewer/2022062507/58a7b2041a28ab70368b4fd9/html5/thumbnails/26.jpg)
Questions?