Skip to content
This repository was archived by the owner on Jun 3, 2023. It is now read-only.

How to set IP address of new VM? #22

Closed
briantopping opened this issue Jan 14, 2018 · 3 comments
Closed

How to set IP address of new VM? #22

briantopping opened this issue Jan 14, 2018 · 3 comments

Comments

@briantopping
Copy link
Contributor

briantopping commented Jan 14, 2018

As a POC (and potential platform) for terraform-provider-xenserver, I forked @quixoten's terraform_salted_aws and modified it to potentially work with the provider. Initial commit is at briantopping/terraform_salted_aws@f66edf0.

In the common AWS provision, the management API provides the ability to recover the IP for an instance, but that's not a part of XenAPI. We do get the GUID back from the provider, but how can that be used to set an IP address so we can do things with the VM? Is there a trick to attach a provisioner to the console through the GUID? It would be a useful part of the example on this project.

Please consider the work I did on terraform_salted_aws as community work toward a more powerful example that we can hopefully merge upstream after it's working. Thanks for everything!

@briantopping
Copy link
Contributor Author

briantopping commented Jan 15, 2018

Hmm, is it possible that Provisioner Connection could be implementedusing the ConsoleClass? It seems like that would be the correct implementation to get into the VM resource that was created and use existing provisioners, no?

EDIT: Looks like that's not exactly the case either. ConsoleClass just provides the API, and that would return the URL for the VNC connection to console (ie. http://xapi-project.github.io/xen-api/consoles.html).

@mborodin
Copy link
Contributor

Hi,
I'm currently working on #13 to obtain IP address of a running instance, so if you have for instance DHCP on your network you will be able to use it during provision.
There is a way to set static IP to a Windows VM using XenAPI (https://xenserver.org/blog/entry/set-windows-guest-vm-static-ip-address-in-xenserver.html), so if it also works for Linux it will be easy to add that feature to provider, but it needs to be tested for which I currently don't have time.

@briantopping
Copy link
Contributor Author

briantopping commented Jan 15, 2018

Ah indeed. Apologize that I didn't see this earlier. After further review of what I was envisioning, I believe now that VNC/RFB can't provide for a simple stream of text like an SSH, it only provides the rendered framebuffer from the console. What I believe now would be necessary for my concept would be to boot the VM with serial console and provide a provisioner connection through that and may start working on that in parallel to your efforts. http://www.francescoprovino.com/2017/04/16/full-disk-encryption-unlocking-from-virtual-serial-tty-paranoia-xenserver-and-libvirt/ is a similar issue.

I would be happy to test your code when it is ready! I will close this issue since it's basically a duplicate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants