Skip to content

Commit

Permalink
Additional documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
josenk committed May 4, 2017
1 parent 390d04b commit 79ee600
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
Introduction
------------

This utility is a simple to use comand line tool to create VMs on an ESXi host from from a system running python and ssh. vCenter is not required. You need to enable ssh access on your ESXi server. It's HIGHLY RECOMMENDED to use password-less authentication by copying your ssh public keys to the ESXi host.
This utility is a simple to use comand line tool to create VMs on an ESXi host from from a system running python and ssh. vCenter is not required. This tool is an easy way to automate building VM's from command line or from other testing or automation tools such as Bamboo, Puppet, Saltstack, or Chef.


Usage
-----

The only command line required paramater is the VM name (-n), all other command line arguments are optional.
Defaults are stored in your home directory in ~/.esxi-vm.yml. You can edit this file directly, or you can use the tool to update the defaults by specifying --updateDefaults.
Some basic sanity checks are done on the ESXi host before creating the VM. The Verbose (-v) option will give you a little more details in the creation process. If an invalid Disk Stores or Network Interface is specified, the available devices will be shown in the error message. The tool will not show the list of available ISO images, and Guest OS types. CPU, Memory, Virtual Disk sizes are based on ESXi 6.0 limitations.
The Dry run (--dry) option will go through all the sanity checks, but will not create the VM.
By default the Disk Store is set to "LeastUsed". This will use the Disk Store with the most free space (in bytes).
By default the ISO or Network are set to "None".
By default the VM is powered on. If an ISO was specified, then it will boot the ISO image. Otherwise, the VM will attempt a PXE boot. Use COBBLER, Foreman, Razor, or your favorite provisioning tools.



Requirements
------------

-You must enable ssh access on your ESXi server.
-It's HIGHLY RECOMMENDED to use password-less authentication by copying your ssh public keys to the ESXi host, otherwise your ESXi root password could be stored in clear-text in your home directory.
-Python and paramiko is a software requirement.

```
yum -y install python-paramiko
```


Command Line Args
Expand Down Expand Up @@ -41,6 +66,13 @@ Command Line Args
Examples
--------

Running the script for the first time it's recommended to specify your defaults. (ESXi HOST, PASSWORD)

```
./esxi-vm-create -H esxi -P MySecurePassword -u
Saving new Defaults to ~/.esxi-vm.yml
```


Create a new VM named testvm01 using all defaults from ~/.esxi-vm.yml.
```
Expand Down Expand Up @@ -77,7 +109,7 @@ Examples
Network: 192.168.1
```

Available Network Interfaces and Available Disk Storage volumes will be listed if an invalid entry is made.
Available Network Interfaces and Available Disk Storage volumes will be listed if an invalid option is specified.

```
./esxi-vm-create -n testvm03 -N BadNet -S BadDS
Expand Down

0 comments on commit 79ee600

Please sign in to comment.