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

govc: Add capability to add and remove standalone host to/from datacenter. #191

Closed
bitwisekaizen opened this issue Dec 21, 2014 · 8 comments

Comments

@bitwisekaizen
Copy link

Doesn't look like we have the ability to add or remove a host to a datacenter from govc or from datacenter.go. Perhaps we could have something like this:

 $ govc datacenter.addhost -dc=somedatacenter -hostname=somehost -hostuser=root -hostpassword=password
 $ govc datacenter.removehost -dc=somedatacenter -hostname=somehost

I'm working on this now to support my work on the Terraform vSphere plugin. Would be happy to contribute it back upstream if the usage above looks reasonable to you guys.

@bitwisekaizen bitwisekaizen changed the title govc: Add capability to add standalone host to datacenter. govc: Add capability to add and remove standalone host to/from datacenter. Dec 21, 2014
@dougm
Copy link
Member

dougm commented Dec 22, 2014

Sounds great @gavingray . Maybe stick with the MO type . method name for the cli names, in this case:

The HostSystem.ReconnectHost would be: govc host.reconnect -dc x ...
And HostSystem.DisconnectHost: govc host.disconnect -dc x ...

@bitwisekaizen
Copy link
Author

I think that reconnect and disconnect are fundamentally different things that what I'm talking about to do here. AddStandaloneHost is a method on the host folder and Destroy is a method on the ComputeResource. Reconnect and Disconnect are used on a HostSystem. Disconnect leaves the host in the inventory and Reconnect assumes that the HostSystem is in the disconnected state. That said, if you'd like to stick closely with the MO paradigms, it would be something more like this.

$ govc datacenter.addstandalonehost -dc=somedatacenter -hostname=somehost ...
$ govc host.destroy -dc=somedatacenter -hostname=something

I think that "addstandalonehost" is pretty wordy though. I think that "addhost" would probably suffice.

I have most of the work here done on the govmomi side. Will just need to add tests and the proper govc implementation. Just let me know what you think and I'll get a PR out stat!

@dougm
Copy link
Member

dougm commented Dec 22, 2014

Ah cool, in that case I'd probably go with "datacenter.host.add" or even just "host.add".

@bitwisekaizen
Copy link
Author

Agreed. I like host.add. Will do! Thanks for the feedback!

@pietern
Copy link
Contributor

pietern commented Mar 4, 2015

@bitwisekaizen Hi Gavin, did you end up working on this? If not, somebody else can pick it up.

@bitwisekaizen
Copy link
Author

I actually have a changed shelved for this. I got sidetracked for a while, but I should be able to put it up in the next couple of days. Hoping to get more active in the next few weeks.

@pietern
Copy link
Contributor

pietern commented Mar 4, 2015

Thanks for the update.

@dougm
Copy link
Member

dougm commented Jan 26, 2016

We have added both 'host.add' (e01555f) and 'cluster.add' (5154339) commands to govc.

@dougm dougm closed this as completed Jan 26, 2016
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

No branches or pull requests

3 participants