Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] library.deploy does not honor OVA spec file via -options (properties) #2599

Closed
nanw1103 opened this issue Sep 28, 2021 · 3 comments · Fixed by #2636
Closed

[BUG] library.deploy does not honor OVA spec file via -options (properties) #2599

nanw1103 opened this issue Sep 28, 2021 · 3 comments · Fixed by #2636

Comments

@nanw1103
Copy link

nanw1103 commented Sep 28, 2021

Describe the bug
Deploy OVF in content library using library.deploy, but the config in ova spec file does not work as expected. The following fields are not working:

  1. power on
  2. waitForIp
  3. Property mapping

To Reproduce
Steps to reproduce the behavior:

  1. Import this (from VMware network) to content library: http://build-squid.eng.vmware.com/build/mts/release/bora-18567835/publish/edge-gw-2.1.0.0-18567835_OVF10.ovf
  2. Generate ova spec, and set VM name, set powerOn=true, waitForIp=true, and set connectionString in PropertyMapping
  3. Deploy using "govc library.deploy path_to_the_vm_in_lib my_vm_name -options path_to_my_ova_spec.json"

Expected behavior
Expect the VM to be deployed with powered on, with the OVA property "connectionString" to be set.

Affected version
0.26.1, Mac

Screenshots/Debug Output
Actually, the VM is deployed, and NOT powered on automatically, and the property is NOT set as expected.

@github-actions
Copy link
Contributor

Howdy 🖐   nanw1103 ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.

@dougm
Copy link
Member

dougm commented Sep 29, 2021

@nanw1103 in general, Go flags need to be specified for before args. Try:

% govc library.deploy -options path_to_my_ova_spec.json path_to_the_vm_in_lib my_vm_name

@dougm
Copy link
Member

dougm commented Sep 29, 2021

Untested patch if anyone wants to open a PR:

  • fixes example text
  • validates number of arguments
modified   govc/library/deploy.go
@@ -88,10 +88,13 @@ func (cmd *deploy) Description() string {
 
 Examples:
   govc library.deploy /library_name/ovf_template vm_name
-  govc library.deploy /library_name/ovf_template -options deploy.json`
+  govc library.deploy -options deploy.json /library_name/ovf_template`
 }
 
 func (cmd *deploy) Run(ctx context.Context, f *flag.FlagSet) error {
+	if f.NArg() > 2 {
+		return flag.ErrHelp
+	}
 	path := f.Arg(0)
 	name := f.Arg(1)

dougm added a commit to dougm/govmomi that referenced this issue Oct 21, 2021
- add example of using library.export to generate options.json

Fixes vmware#2599
Fixes vmware#2598
dougm added a commit to dougm/govmomi that referenced this issue Oct 21, 2021
- add example of using library.export to generate options.json

Fixes vmware#2599
Fixes vmware#2598
yuyin002 pushed a commit to yuyin002/govmomi that referenced this issue Jan 12, 2022
- add example of using library.export to generate options.json

Fixes vmware#2599
Fixes vmware#2598
pradeep288 pushed a commit to pradeep288/govmomi that referenced this issue Jan 17, 2022
- add example of using library.export to generate options.json

Fixes vmware#2599
Fixes vmware#2598
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants