tests: Use -pool when importing vmdk & booting a VM. Fixes #953

explicitly specify the cluster and the default resource pool
when importing b/c the import process creates a temporary VM,
which requires a ResourcePool to provision. Same thing when
provisioning a VM.
This commit is contained in:
Alexander Todorov 2020-08-31 05:31:28 -04:00 committed by Tom Gundersen
parent d5ddcbc921
commit 25c3deda83

View file

@ -91,6 +91,7 @@ func ImportImage(creds *AuthOptions, imagePath, imageName string) error {
"import.vmdk",
fmt.Sprintf("-u=%s:%s@%s", creds.Username, creds.Password, creds.Host),
"-k=true",
fmt.Sprintf("-pool=%s/Resources", creds.Cluster),
fmt.Sprintf("-dc=%s", creds.Datacenter),
fmt.Sprintf("-ds=%s", creds.Datastore),
imagePath,
@ -142,6 +143,7 @@ func WithBootedImage(creds *AuthOptions, imagePath, imageName, publicKey string,
"vm.create",
fmt.Sprintf("-u=%s:%s@%s", creds.Username, creds.Password, creds.Host),
"-k=true",
fmt.Sprintf("-pool=%s/Resources", creds.Cluster),
fmt.Sprintf("-dc=%s", creds.Datacenter),
fmt.Sprintf("-ds=%s", creds.Datastore),
fmt.Sprintf("-folder=%s", creds.Folder),