This file contains hidden or 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
| $vcenterhost = "vcenter_host" | |
| # Set to zero (0) to disable or one (1) to enable. | |
| $intValue = 0; | |
| set-PowerCLIConfiguration -DefaultVIServerMode multiple -Confirm:$false; | |
| Connect-VIServer -Server $vcenterhost | |
| Write-Host -BackgroundColor Red -ForegroundColor White "*** Prompting for ESX(i) host password ***"; | |
| $cred = Get-Credential | |
| $vmhosts = Get-VMHost | |
This file contains hidden or 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
| Add-PSSnapin VMware.VimAutomation.Core | |
| $basedir = "C:\Desktop\ESXTOP-04032012-130000\"; | |
| if( !(Test-Path $basedir) ){ | |
| New-Item -Type Directory $basedir | |
| } | |
| $datastores = Get-Datastore -VMHost (get-vmhost) | Where {$_.Name.Contains("-local") } | |
| foreach( $ds in $datastores ) { |
This file contains hidden or 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
| $vmview = Get-View -ViewType VirtualMachine | |
| $vmview | % { | |
| if( $_.Runtime.PowerState -eq "poweredOn" ) { | |
| $netdev = $_.Config.hardware.Device | Where {$_.MacAddress} | |
| if(!($netdev.Connectable.Connected) ) { | |
| $hostname = (Get-View -id $_.Runtime.Host).Name | |
| Write-Host $_.Name $netdev.Backing.Port.PortKey $hostname | |
| } |
This file contains hidden or 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
| MAC=`ip link | grep "link/ether" | awk '{print $2}'` | |
| echo "HWADDR=$MAC" >> /etc/sysconfig/network-scripts/ifcfg-ens192 |
This file contains hidden or 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
| /*** | |
| * | |
| * Code from: http://sourceforge.net/p/wimlib/code/ci/master/tree/programs/imagex.c | |
| * http://sourceforge.net/p/wimlib/code/ci/master/tree/src/xml.c | |
| */ | |
| #include <wimlib.h> | |
| #include <wimlib_tchar.h> | |
| #include <ctype.h> |
This file contains hidden or 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
| This guide is for individuals just want to get Hanlon installed and running quickly. We are using Ubuntu LTS 14.04 but should also work with previous releases. | |
| Lets first install git, mongodb, dhcpd, tftpd, ipxe installed: | |
| ```bash | |
| root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd curl | |
| ``` | |
| For Windows testing only | |
| ```bash | |
| apt-get install samba apache2 -y |
This file contains hidden or 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
| diff -rupN org_ipxe/src/config/general.h ipxe/src/config/general.h | |
| --- org_ipxe/src/config/general.h 2014-06-11 08:07:39.193081793 -0400 | |
| +++ ipxe/src/config/general.h 2014-06-10 15:15:30.628188405 -0400 | |
| @@ -111,7 +111,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); | |
| //#define IMAGE_PXE /* PXE image support */ | |
| //#define IMAGE_SCRIPT /* iPXE script image support */ | |
| //#define IMAGE_BZIMAGE /* Linux bzImage image support */ | |
| -//#define IMAGE_COMBOOT /* SYSLINUX COMBOOT image support */ | |
| +#define IMAGE_COMBOOT /* SYSLINUX COMBOOT image support */ | |
| //#define IMAGE_EFI /* EFI image support */ |
This file contains hidden or 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
| module ProjectHanlon | |
| module ModelTemplate | |
| class Redhat7 < Redhat | |
| include(ProjectHanlon::Logging) | |
| def initialize(hash) | |
| super(hash) | |
| # Static config | |
| @hidden = false |
This file contains hidden or 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
| cat > /etc/yum.repos.d/epel.repo << EOF | |
| [epel] | |
| name=Extra Packages for Enterprise Linux 6 - $basearch | |
| #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch | |
| mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch | |
| failovermethod=priority | |
| enabled=1 | |
| gpgcheck=1 | |
| gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 |
This file contains hidden or 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
| diff --git a/core/image_service/base.rb b/core/image_service/base.rb | |
| index 90433cb..be09592 100644 | |
| --- a/core/image_service/base.rb | |
| +++ b/core/image_service/base.rb | |
| @@ -9,7 +9,7 @@ module ProjectHanlon | |
| MOUNT_COMMAND = (Process::uid == 0 ? "mount" : "sudo -n mount") | |
| UMOUNT_COMMAND = (Process::uid == 0 ? "umount" : "sudo -n umount") | |
| - # I absolutely do not like hardcoding this | |
| + # TODO - determine another method for providing the path to 7z, configuration file? |