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
#requires -Version 1 | |
#requires -PSSnapin VMware.VimAutomation.Core | |
function Get-CpuRatio { | |
<# | |
.SYNOPSIS | |
No parameters needed. Just execute the script. | |
.DESCRIPTION |
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
<# | |
.SYNOPSIS | |
No parameters needed. Just execute the script. | |
.DESCRIPTION | |
This script uses sdelete to zero-out all disks of a Windows VM. Afterwards, the VM | |
is moved between datastores to reclaim zeroed space. | |
History | |
v1.3: Redesign. |
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
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates -y | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | |
sudo apt-get update | |
sudo apt-get purge lxc-docker | |
sudo apt-get install linux-image-extra-$(uname -r) -y | |
sudo apt-get install docker-engine cgroup-lite apparmor -y | |
sudo usermod -a -G docker $USER | |
sudo service docker start |
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
from pyVim.connect import SmartConnect, Disconnect | |
import ssl | |
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) | |
s.verify_mode = ssl.CERT_NONE | |
try: | |
c = SmartConnect(host='vcenter.lab.local', user='root', pwd='Passw0rd') | |
print('Valid certificate\n') | |
except: |
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
<# | |
.SYNOPSIS | |
This script checks if the iovDisableIR setting is set to FALSE. If not, it will set iovDisableIR to FALSE. | |
.DESCRIPTION | |
The script checks the current setting of the Intel IOMMU interrupt remapper (iovDisableIR) and changes the setting | |
if necessary. | |
The script needs a single parameter: | |
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
<# | |
.SYNOPSIS | |
This script checks if the iovDisableIR setting is set to FALSE. | |
.DESCRIPTION | |
The script checks the current setting of the Intel IOMMU interrupt remapper (iovDisableIR). | |
The script needs a single parameter: | |
- vSphere Cluster |
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
<# | |
.SYNOPSIS | |
This script checks if the iovDisableIR setting is set to FALSE. | |
.DESCRIPTION | |
The script checks the current setting of the Intel IOMMU interrupt remapper (iovDisableIR). | |
The script needs a single parameter: | |
- vSphere Cluster |
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
<# | |
.SYNOPSIS | |
This script retrieves a console screenshot of one or more virtual machines. | |
.DESCRIPTION | |
The script needs four parameters: | |
- the name of the VM (name from the inventory) | |
- the hostname of a vCenter or ESXi host | |
- username, and |
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
<# | |
.SYNOPSIS | |
No parameters needed. Just execute the script. | |
.DESCRIPTION | |
The script deploys a couple of VMs to Azure. | |
History | |
v0.1: Under development | |
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
import ssl | |
from pyVim.connect import SmartConnect | |
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) | |
s.verify_mode = ssl.CERT_NONE | |
c = SmartConnect(host="192.168.20.1", user="root", pwd='Passw0rd', sslContext=s) | |
h = c.content.sessionManager.currentSession.key | |
print (h) |