I hereby claim:
- I am zsoldier on github.
- I am zsoldier (https://keybase.io/zsoldier) on keybase.
- I have a public key whose fingerprint is 3494 BE50 A321 0EB2 58F5 B635 6789 920B FAC4 6526
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #Enable All Flash vSAN Intelligently | |
| Import-Module -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue | |
| $TargetHosts = Get-VMHost | |
| #$ESXCLI = $TargetHosts | Get-EsxCli | |
| #$Storage = $Targethosts | Get-SCSILUN | |
| #$Storage.ScsiLun #List of Vendors and model | |
| $CacheDiskVendor = "SanDisk" | |
| $CacheDiskModel = "LT0400WM" | |
| $CapacityDiskVendor = "SanDisk" | |
| $CapacityDiskModel = "LT0800MO" |
| <# | |
| Re-register templates that are locked | |
| KB Reference: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2037005 | |
| #> | |
| Import-Module vmware.vimautomation.core | |
| Connect-VIServer NameofyourVcenter | |
| $TargetTemplates = Get-Template "NamePatternOfTemplateOrRemoveThisIfYouWantToTargetAllTemplates*" -server $Global:DefaultVIServer | |
| Foreach ($Template in $TargetTemplates) | |
| { |
| #!/usr/bin/python | |
| import sys | |
| def cityinfo(lat, lon): | |
| from geopy.geocoders import GoogleV3 | |
| locator = GoogleV3() | |
| address = locator.reverse([lat, lon]) | |
| city = address[3].address.split(",")[0] | |
| print(city.replace(" ", "")) |
| LAT="$(~/Dropbox/LocateMe/LocateMe -f "{LAT}")" | |
| LON="$(~/Dropbox/LocateMe/LocateMe -f "{LON}")" | |
| city=$(python ~/Dropbox/GeekTool/cityLocator.py $LAT $LON) | |
| ~/Dropbox/GeekTool/Geekweather2.sh -A $LAT -O $LON -n $city -u UK |
| <# | |
| You can target a single host or set of hosts. Made to only move 'management' vmk's. | |
| Idea is that you would create vmotion, vsan, etc. vmk's after on VDS/DVS | |
| #> | |
| $VMhost = Get-VMHost "NameofHost" | |
| <# | |
| If you haven't created a vDSwitch yet, you can do so by replacing get-vdswitch with New-VDSwitch | |
| $TargetVDS = New-VDSwitch -Name -Location (get-datacenter "nameofvirtualdatacenter") | |
| $TargetPG = New-VDPortgroup -vdswitch $TargetVDS -Name "Whatevernameyouwant" -VLANID <# Replace if applicable #> | |
| #> |
| function Get-vCenterScheduledTask{ | |
| <# | |
| .SYNOPSIS | |
| Retrieve vCenter Scheduled Tasks. | |
| .DESCRIPTION | |
| Retrieve vCenter Scheduled Tasks. | |
| .NOTES | |
| Source: Automating vSphere Administration | |
| Authors: Luc Dekens, Arnim van Lieshout, Jonathan Medd, | |
| Alan Renouf, Glenn Sizemore |
| <# | |
| Author: K. Chris Nakagaki | |
| Source: tech.zsoldier.com | |
| Use at your own risk, simply listed here for demonstration purposes to use how you see fit. | |
| #> | |
| <# Get the host w/ problem disk group #> | |
| $VMhost = Get-VMHost NameofHostwithProblemDiskGroup | |
| <# ESXCLI Connection #> |
| function Get-VMHostWSManInstance { | |
| param ( | |
| [Parameter(Mandatory=$TRUE,HelpMessage="VMHosts to probe")] | |
| [VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl[]] | |
| $VMHost, | |
| [Parameter(Mandatory=$TRUE,HelpMessage="Class Name")] | |
| [string] | |
| $class, |
| <# Uncomment if you'd like to use. These are assumed and needed for custom report to work. Must be connected to vCenter and NSXMgr. | |
| Import-Module vmware.powercli,powernsx | |
| $Creds = Get-Credential -Message "Provide vCenter Admin credentials" | |
| $vCenterNameorIP = Read-Host "Provide name or IP of vCenter" | |
| Connect-VIServer $vCenterNameorIP -Credential $Creds | |
| Connect-NSXServer -vCenterServer $vCenterNameorIP -Credential $Creds | |
| #> | |
| $DFWRules = Get-NSXFirewallRule | |
| $CustomReport = @() |