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 | |
from pyVmomi import vim, vmodl | |
# this script is intended to be run against all vcenters daily in order to | |
# guard against a possible vcenter crash due to alarms with an unset status. | |
# it prints all alarms with Trigger events w/ an "Unset" status. | |
# this bug is detailed at http://kb.vmware.com/kb/2062989 | |
user = "username" | |
pwd = "password" |
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
/Users/hartsocks/Virtualenvs/cli/bin/python /Users/hartsocks/PycharmProjects/pyvmomi-tools/samples/tasks_different_styles.py -s 192.168.2.11 -u root -p vmware -n MARVEL | |
using wait_for_updates | |
Found VirtualMachine: 'vim.VirtualMachine:vm-748' Name: MARVEL-Serpent_Society | |
power on | |
power off | |
Found VirtualMachine: 'vim.VirtualMachine:vm-746' Name: MARVEL-Hepzibah | |
power on | |
power off | |
Found VirtualMachine: 'vim.VirtualMachine:vm-741' Name: MARVEL-Mach_IV | |
power on |
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
#!/usr/bin/env python | |
# VMware vSphere Python SDK | |
# Copyright (c) 2008-2013 VMware, Inc. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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
#!/usr/bin/env ruby | |
# | |
# Convert blogger (blogspot) posts to jekyll posts | |
# | |
# Basic Usage | |
# ----------- | |
# | |
# ./blogger_to_jekyll.rb feed_url | |
# | |
# where `feed_url` can have the following format: |
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
# first get the disks... | |
disks = [d for d in vm.config.hardware.device | |
if isinstance(d, pyVmomi.vim.vm.device.VirtualDisk) and | |
isinstance(d.backing, pyVmomi.vim.vm.device.VirtualDisk.RawDiskMappingVer1BackingInfo)] | |
print d.deviceInfo.deviceName | |
# then later | |
ss = vm.runtime.host.configManager.storageSystem |
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
#!/usr/bin/python | |
import argparse | |
import cookielib | |
import suds | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-s', '--host', | |
required=True, | |
action='store', |
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
#!/usr/bin/python | |
import argparse | |
import cookielib | |
import suds | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-s', '--host', | |
required=True, | |
action='store', |
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
#!/usr/bin/python | |
import argparse | |
import suds | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-s', '--host', required=True, action='store', help='Remote host to connect to') | |
parser.add_argument('-u', '--user', required=True, action='store', help='User name to use when connecting to host') | |
parser.add_argument('-p', '--password', required=True, action='store', help='Password to use when connecting to host') | |
args = parser.parse_args() |
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
#!/usr/bin/env python | |
import os | |
import sys | |
import platform | |
import requests | |
import requests.utils | |
import certifi |