diff --git a/cmd/vic-machine/common/target.go b/cmd/vic-machine/common/target.go index e96e5e5fe5..0fe4157e58 100644 --- a/cmd/vic-machine/common/target.go +++ b/cmd/vic-machine/common/target.go @@ -33,6 +33,8 @@ type Target struct { Password *string CloneTicket string Thumbprint string `cmd:"thumbprint"` + + MaxConcurrentConnections *int `cmd:"max-concurrent-connections"` } func NewTarget() *Target { @@ -67,11 +69,30 @@ func (t *Target) TargetFlags() []cli.Flag { Usage: "ESX or vCenter host certificate thumbprint", EnvVar: "VIC_MACHINE_THUMBPRINT", }, + cli.GenericFlag{ + Name: "max-concurrent-connections, mcc", + Value: flags.NewOptionalInt(&t.MaxConcurrentConnections), + Usage: "Determines maximum number of connections (not sessions) to vCenter. Integer value, greater than 0", + EnvVar: "VIC_MACHINE_MAX_CONCURRENT_CONNECTIONS", + Hidden: true, + }, + /* + cli.IntFlag{ + Name: "max-concurrent-connections, mcc", + Value: constants.DefaultMaxConcurrentRequests, + Destination: &t.MaxConcurrentConnections, + Usage: "Determines maximum number of connections (not sessions) to vCenter. Integer value, greater than 0", + EnvVar: "VIC_MACHINE_MAX_CONCURRENT_CONNECTIONS", + Hidden: true, + }, + */ } } // HasCredentials check that the credentials have been supplied by any of the permitted mechanisms func (t *Target) HasCredentials(op trace.Operation) error { + defer trace.End(trace.Begin("", op)) + if t.URL == nil { return cli.NewExitError("--target argument must be specified", 1) } diff --git a/cmd/vic-machine/configure/configure.go b/cmd/vic-machine/configure/configure.go index 23f55ada2c..18b73bc07a 100644 --- a/cmd/vic-machine/configure/configure.go +++ b/cmd/vic-machine/configure/configure.go @@ -19,6 +19,7 @@ import ( "fmt" "net" "os" + "strconv" "strings" "time" @@ -214,6 +215,11 @@ func (c *Configure) copyChangedConf(o *config.VirtualContainerHostConfigSpec, n updateSessionEnv(portlayerSession, config.PortLayerDCPath, v.Session().Datacenter.Name()) } + // if mcc is explicitly set, apply it + if c.Data.MaxConcurrentConnections != nil { + updateSessionEnv(portlayerSession, config.PortLayerMaxConcurrentConnections, strconv.Itoa(*c.Data.MaxConcurrentConnections)) + } + if c.Debug.Debug != nil { o.SetDebug(n.Diagnostics.DebugLevel) } diff --git a/cmd/vic-machine/create/create.go b/cmd/vic-machine/create/create.go index 03915f4968..df9e986fa7 100644 --- a/cmd/vic-machine/create/create.go +++ b/cmd/vic-machine/create/create.go @@ -719,6 +719,8 @@ func (c *Create) Run(clic *cli.Context) (err error) { vConfig.Timeout = c.Data.Timeout + vConfig.MaxConcurrentConnections = c.MaxConcurrentConnections + // separate initial validation from dispatch of creation task op.Info("") diff --git a/lib/config/executor/container_vm.go b/lib/config/executor/container_vm.go index b616e08e66..b9ed6ec6c5 100644 --- a/lib/config/executor/container_vm.go +++ b/lib/config/executor/container_vm.go @@ -119,7 +119,8 @@ type ExitLog struct { // MountSpec details a mount that must be executed within the executor // A mount is a URI -> path mapping with a credential of some kind // In the case of a labeled disk: -// label://