Skip to content

Instantly share code, notes, and snippets.

View trodemaster's full-sized avatar
💭
Pushing buttons

Blake Garner trodemaster

💭
Pushing buttons
View GitHub Profile
@trodemaster
trodemaster / sVmotion-csv.ps1
Created January 19, 2017 18:38
Maybe you need to do a lot of storage vmotions based on a .csv file of vmname,targetDataStore ?
#Capture pass paramater
param (
[Parameter(Mandatory=$true)]
[string]$csv,
[Parameter(Mandatory=$true)]
[string]$format,
[switch]$dryrun
)
# test virtual center connectivity
# get ESXi build from VMware depot profile
# requires powercli...
# add vmare online depot
Add-EsxSoftwareDepot -DepotUrl https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
# get ESXi build from the image profile named "ESXi-6.0.0-20161104001-standard"
((Get-EsxImageProfile -Name "ESXi-6.0.0-20161104001-standard").viblist | Where-Object {$_.Name -eq "esx-base"}).Version.split('.') | Select-Object -Last 1
2016-11-15T19:42:16.962Z - debug: scope.backupProfileDataArr: undefined
2016-11-15T19:42:16.963Z - error: could not find ovftoolCmd: /private/var/folders/h0/h78t9r056gv9grp9p0v4y9y80000gn/T/AppTranslocation/vcsa/ovftool/mac/ovftool
2016-11-15T19:42:16.963Z - info: ovftoolCmd: null
2016-11-15T19:42:16.963Z - error: OVF probe error: Error: ovftool is not available
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install openssh -params '"/SSHServerFeature"' -force
nextbook:/files/packer-itcloud$ packer validate fry-tempaltes/WinSrv2016-fry-100.json
2016/10/30 16:27:33 [INFO] Packer version: 0.11.1.dev (3c0e5a10eccf7c3ecbf840fb1062b5d1718e3500)
2016/10/30 16:27:33 Packer Target OS/Arch: darwin amd64
2016/10/30 16:27:33 Built with Go Version: go1.7.1
2016/10/30 16:27:33 Detected home directory from env var: /Users/bgarner
2016/10/30 16:27:33 Using internal plugin for amazon-instance
2016/10/30 16:27:33 Using internal plugin for docker
2016/10/30 16:27:33 Using internal plugin for googlecompute
2016/10/30 16:27:33 Using internal plugin for null
2016/10/30 16:27:33 Using internal plugin for parallels-pvm
{
"variables": {
"blob_webserver": "{{env `BLOB_WEBSERVER`}}"
},
"builders": [
{
"type": "vmware-vmx",
"source_path": "VM/WinSrv2016-vmware-fry/WinSrv2016.vmx",
"communicator": "winrm",
"skip_compaction": "true",
Working
[INFO] starting remote command: powershell "& { $env:PACKER_BUILDER_TYPE=\"vmware-iso\"; $env:PACKER_BUILD_NAME=\"vmware-iso\"; $env:blob_webserver=\"http://packer-blobs.s3.localdomain.local/FILES/\"; c:/Windows/temp/download-winfiles.ps1; exit $LastExitCode}"
Busted
[INFO] starting remote command: powershell "& { $env:PACKER_BUILDER_TYPE="vmware-iso"; $env:PACKER_BUILD_NAME="vmware-iso"; $env:blob_webserver="http://packer-blobs.s3.localdomain.local/FILES/"; c:/Windows/temp/download-winfiles.ps1; exit $LastExitCode}"
[2016-10-21T18:33:38.271Z] [INFO ] http-bio-9443-exec-23 70049672 100281 200118 org.springframework.flex.servlet.MessageBrokerHandlerAdapter Channel endpoint amf received request.
[2016-10-21T18:33:45.722Z] [INFO ] http-bio-9443-exec-23 70049673 100281 200118 org.springframework.flex.servlet.MessageBrokerHandlerAdapter Channel endpoint amf received request.
[2016-10-21T18:33:47.389Z] [INFO ] http-bio-9443-exec-23 70049674 100281 200118 org.springframework.flex.servlet.MessageBrokerHandlerAdapter Channel endpoint amf received request.
[2016-10-21T18:33:47.389Z] [INFO ] http-bio-9443-exec-18 70049676 100281 200118 org.springframework.flex.servlet.MessageBrokerHandlerAdapter Channel endpoint amf received request.
[2016-10-21T18:33:47.389Z] [INFO ] http-bio-9443-exec-20 70049675 100281 200118 org.springframework.flex.servlet.MessageBrokerHandlerAdapter Channel endpoint amf received request.
[2016-10-21T18:33:47.389Z] [INFO ] http-bio-9443-exec-26
2016/10/19 20:55:48 ui: ==> vmware-iso: Gracefully halting virtual machine...
2016/10/19 20:55:48 packer: 2016/10/19 20:55:48 Executing shutdown command: sudo shutdown -P now
2016/10/19 20:55:48 packer: 2016/10/19 20:55:48 opening new ssh session
2016/10/19 20:55:48 packer: 2016/10/19 20:55:48 starting remote command: sudo shutdown -P now
2016/10/19 20:56:34 packer: 2016/10/19 20:56:34 Remote command exited without exit status or exit signal.
2016/10/19 20:56:34 packer: 2016/10/19 20:56:34 Executing: /Applications/VMware Fusion.app/Contents/Library/vmrun [-T fusion list]
2016/10/19 20:56:34 packer: 2016/10/19 20:56:34 stdout: Total running VMs: 0
2016/10/19 20:56:34 packer: 2016/10/19 20:56:34 stderr:
2016/10/19 20:56:34 ui: ==> vmware-iso: Deleting output directory...
2016/10/19 20:56:34 ui error: Build 'vmware-iso' errored: Shutdown command has non-zero exit status.
@trodemaster
trodemaster / PowerCli.txt
Last active October 20, 2016 02:02
Some install notes for macOS + .net core + powershell core + PowerCli core
#Install openssl via macports
sudo port install openssl curl
# create a dir in the path for library links
mkdir -p /usr/local/lib
# link tehse librarys ino the path. Not sure this is needed..
ln -s /opt/local/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /opt/local/lib/libssl.1.0.0.dylib /usr/local/lib/