This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#http://docs.openstack.org/network-admin/admin/content/figures/2/figures/under-the-hood-scenario-2-ovs-compute.png | |
#http://www.markhneedham.com/blog/2013/06/26/unixawk-extracting-substring-using-a-regular-expression-with-capture-groups/ | |
ACTIVE_INSTANCE_IDS=`nova list --all-tenants | grep ACTIVE | awk '{print $2}'` | |
length=115 | |
printf -v line '%*s' "$length" | |
echo ${line// /-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Sources: | |
# http://effbot.org/zone/element-xpath.htm | |
# http://eli.thegreenplace.net/2012/03/15/processing-xml-in-python-with-elementtree/ | |
# http://wiki.libvirt.org/page/SSHSetup | |
# http://docs.python.org/2/tutorial/datastructures.html#dictionaries | |
# http://libvirt.org/git/?p=libvirt.git;a=blob;f=tools/virsh-domain-monitor.c | |
# http://www.linuxproblem.org/art_9.html | |
# http://j2labs.tumblr.com/post/4477180133/ssh-with-pythons-paramiko | |
__author__ = 'jcallen' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Sources: | |
# http://effbot.org/zone/element-xpath.htm | |
# http://eli.thegreenplace.net/2012/03/15/processing-xml-in-python-with-elementtree/ | |
# http://wiki.libvirt.org/page/SSHSetup | |
# http://docs.python.org/2/tutorial/datastructures.html#dictionaries | |
# http://libvirt.org/git/?p=libvirt.git;a=blob;f=tools/virsh-domain-monitor.c | |
# http://www.linuxproblem.org/art_9.html | |
# http://j2labs.tumblr.com/post/4477180133/ssh-with-pythons-paramiko | |
__author__ = 'jcallen' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Each run is 5 minutes | |
j=18 | |
for i in `seq $j` ; do | |
let min=$i*5;echo "New esxtop is running - Total $min minutes";esxtop -a -b -d 2 -n 150 | gzip -9c > `hostname -s`-`date +"%Y%m%d-%H%M%S"`.csv.gz; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
naa=`esxcli storage core device detached list | awk 'NR > 2 {print $1}'` | |
for n in $naa ; do | |
`esxcli storage core device detached remove -d $n` | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2013-01-08T20:14:02.132Z cpu24:5867805)DLX: 3901: vol 'View-Replica-31': [Req mode: 2] Not free; Lock [PhoenixDTaaS:type 10c00001 offset 216922112 v 1179, hb offset 319897 | |
gen 619, mode 1, owner 508951c0-5359e3be-36b6-0025b5020a0e mtime 12190974 nHld 0 nOvf 0] | |
2013-01-08T20:14:02.435Z cpu24:5867805)DLX: 3394: vol 'View-Replica-31': PhoenixDTaaS:Req mode 2 Checking liveness of [PhoenixDTaaS:type 10c00001 offset 216922112 v 1179, hb offset 3 | |
gen 619, mode 1, owner 508951c0-5359e3be-36b6-0025b5020a0e mtime 12190974 nHld 0 nOvf 0] | |
#!/bin/sh | |
path=/vmfs/volumes/View-Replica-31/replica-3faf9959-a2e8-4a8a-9dde-908577cb73a2/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Set-PortIdAdvanced { | |
Param([object] $VmView, [object] $PortId ) | |
$netdev = ($VmView.Config.Hardware.Device | Where {$_.MacAddress}) | |
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec | |
$spec.deviceChange = New-Object VMware.Vim.VirtualDeviceConfigSpec[] (1) | |
$spec.deviceChange[0] = New-Object VMware.Vim.VirtualDeviceConfigSpec | |
$spec.deviceChange[0].operation = "edit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### SCRIPT TO CHECK PATHS ON VDI CLUSTER ### | |
Get-Vmhost | % { | |
$vmhostname = $_.Name.ToString().split('.')[0]; | |
rpowermt display host=$vmhostname dev=all >> c:\emc\ppve\vdi.txt | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### SCRIPT TO ADD POWERPATH LICENSES TO VDI HOSTS #### | |
Get-Vmhost | % { | |
rpowermt setup add_host host=$_ username=root password= | |
rpowermt register host=$_ | |
$vmhostname = $_.Name.ToString().split('.')[0]; | |
rpowermt check_registration host=$vmhostname | |
} | |
### END ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vmhosts = Get-VMHost | |
foreach( $vmhost in $vmhosts ) | |
{ | |
$hcv = $vmhost | Get-View | Select Config | |
$hcmv = $vmhost | Get-View | Select ConfigManager | |
$pci = Get-View -Id $hcmv.ConfigManager.PciPassthruSystem | |
$pci.Refresh(); | |
OlderNewer