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

Add support for reading and changing SyncTimeWithHost option #539

Merged
merged 1 commit into from
Jan 24, 2017

Conversation

tkak
Copy link
Contributor

@tkak tkak commented Jul 7, 2016

This PR adds support for reading and changing SyncTimeWithHost option of ToolsConfigInfo with govc. The example is as follows.

$ govc vm.change -h
Usage: govc vm.change [OPTIONS]

Options:
  -c=0                                      Number of CPUs
  -cert=                                    Certificate [GOVC_CERTIFICATE]
  -dc=                                      Datacenter [GOVC_DATACENTER]
  -debug=false                              Store debug logs [GOVC_DEBUG]
  -dump=false                               Enable output dump
  -e=[]                                     ExtraConfig. <key>=<value>
  -g=                                       Guest OS
  -json=false                               Enable JSON output
  -k=true                                   Skip verification of server certificate [GOVC_INSECURE]
  -key=                                     Private key [GOVC_PRIVATE_KEY]
  -m=0                                      Size in MB of memory
  -name=                                    Display name
  -nested-hv-enabled=<nil>                  Enable nested hardware-assisted virtualization
  -persist-session=true                     Persist session to disk [GOVC_PERSIST_SESSION]
  -sync-time-with-host-enabled=<nil>        Enable SyncTimeWithHost
  -u=https://@avcenter501z.ms.jp.local/sdk  ESX or vCenter URL [GOVC_URL]
  -vim-namespace=urn:vim25                  Vim namespace [GOVC_VIM_NAMESPACE]
  -vim-version=6.0                          Vim version [GOVC_VIM_VERSION]
  -vm=                                      Virtual machine [GOVC_VM]
  -vm.dns=                                  Find VM by FQDN
  -vm.ip=                                   Find VM by IP address
  -vm.ipath=                                Find VM by inventory path
  -vm.path=                                 Find VM by path to .vmx file
  -vm.uuid=                                 Find VM by instance UUID
$ govc vm.change -sync-time-with-host-enabled=false -vm=/DC-1/vm/test-1

$ govc vm.info -h
Usage: govc vm.info [OPTIONS]

Options:
  -cert=                                    Certificate [GOVC_CERTIFICATE]
  -dc=                                      Datacenter [GOVC_DATACENTER]
  -debug=false                              Store debug logs [GOVC_DEBUG]
  -dump=false                               Enable output dump
  -e=false                                  Show ExtraConfig
  -g=true                                   Show general summary
  -json=false                               Enable JSON output
  -k=true                                   Skip verification of server certificate [GOVC_INSECURE]
  -key=                                     Private key [GOVC_PRIVATE_KEY]
  -persist-session=true                     Persist session to disk [GOVC_PERSIST_SESSION]
  -r=false                                  Show resource summary
  -t=false                                  Show ToolsConfig
  -u=https://@avcenter501z.ms.jp.local/sdk  ESX or vCenter URL [GOVC_URL]
  -vim-namespace=urn:vim25                  Vim namespace [GOVC_VIM_NAMESPACE]
  -vim-version=6.0                          Vim version [GOVC_VIM_VERSION]
  -vm.dns=                                  Find VM by FQDN
  -vm.ip=                                   Find VM by IP address
  -vm.ipath=                                Find VM by inventory path
  -vm.path=                                 Find VM by path to .vmx file
  -vm.uuid=                                 Find VM by instance UUID
  -waitip=false                             Wait for VM to acquire IP address
$ govc vm.info -t /DC-1/vm/test-1
Name:           test-1
  Path:         /DC-1/vm/test-1
  UUID:         4206ca82-2a01-9c81-3422-94e6956c6e3e
  Guest name:   CentOS 4/5/6/7 (64-bit)
  Memory:       2048MB
  CPU:          2 vCPU(s)
  Power state:  poweredOff
  Boot time:    <nil>
  IP address:
  Host:         xxx
  ToolsConfigInfo:
    ToolsVersion:          9355
    AfterPowerOn:          true
    AfterResume:           true
    BeforeGuestStandby:    true
    BeforeGuestShutdown:   true
    BeforeGuestReboot:     <nil>
    ToolsUpgradePolicy:    upgradeAtPowerCycle
    PendingCustomization:
    SyncTimeWithHost:      false

References:

@vmwclabot
Copy link
Member

@tkak, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@dougm
Copy link
Member

dougm commented Jul 14, 2016

@tkak thanks, looks great. I believe you signed the old CLA form, would you mind re-signing with the new system?

@dougm
Copy link
Member

dougm commented Oct 14, 2016

@tkak any issue with signing the CLA form?

@vmwclabot
Copy link
Member

@tkak, VMware has approved your signed contributor license agreement.

@dougm dougm merged commit 913c0eb into vmware:master Jan 24, 2017
@dougm
Copy link
Member

dougm commented Jan 24, 2017

thanks @tkak !

dougm added a commit that referenced this pull request Jan 24, 2017
Rename 'sync-time-with-host-enabled' to 'sync-time-with-host' (PR #539)
@tkak tkak deleted the change-sync-time-with-host branch January 25, 2017 01:29
@tkak
Copy link
Contributor Author

tkak commented Jan 25, 2017

@dougm Thanks!

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 this pull request may close these issues.

None yet

3 participants