From 7bcfdda043b98fea74f7fddb97474f6100eda7f6 Mon Sep 17 00:00:00 2001 From: Jonathan Senkerik Date: Tue, 26 Oct 2021 22:05:59 -0400 Subject: [PATCH] v1.9.0 Manage portgroup security policies, fix typos --- README.md | 2 ++ esxi/esxi_remote_cmds.go | 5 +++++ esxi/guest-create.go | 2 +- go.mod | 2 +- version | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b588eb..75129bc 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Terraform-provider-esxi plugin What's New: ----------- +* v1.9.0 Changed default hwversion from 8 to 13. NOTE that this is a possible breaking change if you are using an old ESXi version. * v1.8.0 added vswitch and portgroup resources. * v1.7.1 added Terraform 0.13 support. This provider is now in the terraform registry. >https://registry.terraform.io/providers/josenk/esxi @@ -280,6 +281,7 @@ I work very hard to produce a stable, well documented product. I appreciate any Version History --------------- +* 1.9.0 Manage portgroup security policies, fix typos. * 1.8.3 Add support for ldap integrated esxi systems. * 1.8.2 Fix, Disk Stores containing spaces for bare-metal builds. * 1.8.1 Fix, multimachine create on Windows. diff --git a/esxi/esxi_remote_cmds.go b/esxi/esxi_remote_cmds.go index e62de69..4e9af5d 100644 --- a/esxi/esxi_remote_cmds.go +++ b/esxi/esxi_remote_cmds.go @@ -75,6 +75,11 @@ func runRemoteSshCommand(esxiConnInfo ConnectionStruct, remoteSshCommand string, stdout_raw, err := session.CombinedOutput(remoteSshCommand) stdout := strings.TrimSpace(string(stdout_raw)) + + if stdout == "" { + return "Failed to ssh to esxi host or Management Agent has been restarted", err + } + log.Printf("[runRemoteSshCommand] cmd:/%s/\n stdout:/%s/\nstderr:/%s/\n", remoteSshCommand, stdout, err) client.Close() diff --git a/esxi/guest-create.go b/esxi/guest-create.go index 6ae798d..d18681d 100644 --- a/esxi/guest-create.go +++ b/esxi/guest-create.go @@ -103,7 +103,7 @@ func guestCREATE(c *Config, guest_name string, disk_store string, memsize = 512 } if virthwver == 0 { - virthwver = 8 + virthwver = 13 } if guestos == "" { guestos = "centos-64" diff --git a/go.mod b/go.mod index 59446fe..0cd8ed9 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/josenk/terraform-provider-esxi require ( github.com/hashicorp/terraform v0.12.2 - github.com/jszwec/csvutil v1.5.1 // indirect + github.com/jszwec/csvutil v1.5.1 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/tmc/scp v0.0.0-20170824174625-f7b48647feef golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 diff --git a/version b/version index 1182b2f..295e37c 100644 --- a/version +++ b/version @@ -1 +1 @@ -v1.8.3 +v1.9.0