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
Add content library VmConfigSpec support #2844
Conversation
@@ -1898,6 +1938,17 @@ func (s *handler) deleteVM(ref *types.ManagedObjectReference) { | |||
}) | |||
} | |||
|
|||
func (s *handler) reconfigVM(ref types.ManagedObjectReference, config types.VirtualMachineConfigSpec) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: reconfigureVM
better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok - unexported and the API method is actually called ReconfigVM_Task
.. not sure why chose to spell it out in the wrapper method 🤷
govc/library/deploy.go
Outdated
@@ -61,6 +63,10 @@ func (cmd *deploy) Register(ctx context.Context, f *flag.FlagSet) { | |||
cmd.OptionsFlag.Register(ctx, f) | |||
|
|||
f.StringVar(&cmd.profile, "profile", "", "Storage profile") | |||
|
|||
if os.Getenv("VM_CLASS_AS_CONFIG") == "true" { // FSS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: why do we conditionally enable (define) this flag based on this env var? Is this a pattern we already do? Would it harm to always define it, since it's ""
by default?
Also: what does the comment // FFS
stand for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature State Switch. We use this pattern in vCenter/WCP/VM Service/Guest Cluster Service, but this is the first time in govc it'd be used for a specific flag/field. govc does have a way to disable unreleased commands by default (see below). We'd used that for library.{checkin,checkout} for example. This feature will be released with 8.0, but is still subject to change and could still be disabled by default? Just wanted to add the flag for testing within govmomi itself and folks working on the feature.
Lines 25 to 27 in 18cdce8
// hideUnreleased allows commands to be compiled into the govc binary without being registered by default. | |
// Unreleased commands are omitted from 'govc -h' help text and the generated govc/USAGE.md | |
// Setting the env var GOVC_SHOW_UNRELEASED=true enables any commands registered as unreleased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I suppose we could just use the same GOVC_SHOW_UNRELEASED
env var here instead adding a feature specific env var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM, Doug. Thanks again!.
As this feature is unreleased, the VM_CLASS_AS_CONFIG env var must be set to enable.
Description
govc: add library.deploy '-config' flag
vcsim: add content library VmConfigSpec support
api: add VmConfigSpec field to content library DeploymentSpec
Closes: #2843
Type of change
Please mark options that are relevant:
not work as expected)
Checklist:
this project