vmware / govmomi

Go library for the VMware vSphere API
Apache License 2.0
2.26k stars 896 forks source link

Add storage profile related api and govc helpers #3466

Closed dougm closed 2 weeks ago

dougm commented 3 weeks ago

api: add pbm.DatastoreMap for finding compatible Datastores

govc: add vm.create '-profile' and '-place' flags

api: add storage_specs field to Namespace related structures

govc: add '-storage' flag to namespace.create and namespace.update commands

dougm commented 3 weeks ago

Example of using -place to see which Datastore is recommended:

% govc vm.create -place -net "VM Network" -cluster $cluster -iso library:/govc/ubuntu-14.04.6-server-amd64/*.iso ubuntu
Target:       /test-vpx-1717673857-26202-wcp.wcp-sanity/host/test-vpx-1717673857-26202-wcp.wcp-sanity-cluster
  Datastore:  /test-vpx-1717673857-26202-wcp.wcp-sanity/datastore/sharedVmfs-0
  Pool:       /test-vpx-1717673857-26202-wcp.wcp-sanity/host/test-vpx-1717673857-26202-wcp.wcp-sanity-cluster/Resources
  Host:       /test-vpx-1717673857-26202-wcp.wcp-sanity/host/test-vpx-1717673857-26202-wcp.wcp-sanity-cluster/10.182.172.85

Note that adding -xml or -dump flags will output the complete spec input and recommendations response.