Skip to content

Commit

Permalink
v1.6.3, mask user/pass in logs, enableUUID
Browse files Browse the repository at this point in the history
  • Loading branch information
josenk committed Feb 16, 2020
1 parent 430848e commit 7ab909a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ Configuration reference


* resource "esxi_virtual_disk"
* virtual_disk_disk_store - Required - esxi Disk Store where guest vm will be created.
* virtual_disk_dir - Required - Disk dir.
* virtual_disk_name - Optional - Virtual Disk Name. A random virtual disk name will be generated if nil.
* virtual_disk_disk_store - Required - esxi Disk Store where virtual disk will be created.
* virtual_disk_dir - Required - A subdirectory to contain the virtual disk. (Can be the same as guest_name)
* virtual_disk_name - Optional - Virtual Disk Name. (ext must be .vmdk)
* virtual_disk_size - Optional - Virtual Disk size in GB. Default 1GB.
* virtual_disk_type - Optional - Virtual Disk type. (thin, zeroedthick or eagerzeroedthick) Default 'thin'.

Expand Down Expand Up @@ -235,6 +235,7 @@ Known issues with vmware_esxi

Version History
---------------
* 1.6.3 Mask username/password in debug logs. Set default, disk.EnableUUID = true.
* 1.6.2 Fix Defaults for guest_startup_timeout and guest_shutdown_timeout. Fix IP address detection type2 to always run regardless of guest_startup_timeout value.
* 1.6.1 Fix some minor refresh bugs, allow http(s) ovf sources.
* 1.6.0 Add support for ovf_properties for OVF/OVA sources.
Expand Down
5 changes: 4 additions & 1 deletion esxi/guest-create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/url"
"os"
"os/exec"
"regexp"
"runtime"
"strconv"
"strings"
Expand Down Expand Up @@ -122,6 +123,7 @@ func guestCREATE(c *Config, guest_name string, disk_store string,
fmt.Sprintf("scsi0.present = \\\"TRUE\\\"\n") +
fmt.Sprintf("scsi0.sharedBus = \\\"none\\\"\n") +
fmt.Sprintf("scsi0.virtualDev = \\\"lsilogic\\\"\n") +
fmt.Sprintf("disk.EnableUUID = \\\"TRUE\\\"\n") +
fmt.Sprintf("pciBridge0.present = \\\"TRUE\\\"\n") +
fmt.Sprintf("pciBridge4.present = \\\"TRUE\\\"\n") +
fmt.Sprintf("pciBridge4.virtualDev = \\\"pcieRootPort\\\"\n") +
Expand Down Expand Up @@ -283,7 +285,8 @@ func guestCREATE(c *Config, guest_name string, disk_store string,
// Execute ovftool script (or batch) here.
cmd := exec.Command(osShellCmd, osShellCmdOpt, ovf_cmd)

log.Printf("[guestCREATE] ovf_cmd: %s\n", ovf_cmd)
re := regexp.MustCompile(`vi://.*?@`)
log.Printf("[guestCREATE] ovf_cmd: %s\n", re.ReplaceAllString(ovf_cmd, "vi://XXXX:YYYY@"))

cmd.Stdout = &out
err = cmd.Run()
Expand Down
5 changes: 5 additions & 0 deletions esxi/guest_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ func updateVmx_contents(c *Config, vmid string, iscreate bool, memsize int, numv
}
}

// Add disk UUID
if !strings.Contains(vmx_contents, "disk.EnableUUID") {
vmx_contents = vmx_contents + "\ndisk.EnableUUID = \"TRUE\""
}

//
// Write vmx file to esxi host
//
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.6.2
v1.6.3

0 comments on commit 7ab909a

Please sign in to comment.