lnxbil/docker-machine-driver-proxmox-ve

Thank you thank you thank you!

prologic opened this issue ยท 23 comments

Finally! Someone wrote a docker-machine driver for Proxmox VE :)

Thank you!

I'll be testing this out today and report back with any issues and hopefully I will have BW to contribute!

Oh... This driver is incomplete! Are you still working on this locally and haven't pushed latest commits up?

I can probably help here :)

Hi, yes I just started to learn go in order to get the docker machine driver running and yes, it is incomplete at the moment. Just before the cool stuff should start, I found out that the qemu stuff is missing in the library I chose. My current plan is to drop the library and implement it myself, qemu create should not be that hard.

so I noticed that too and you forked that library.

Have you considered some other alternative libraries?

Example:

This one is used by the teraform proxmox provider and seems to have all of the necessary bits to get a docker-machine driver going. We don't really need to implement the entire PVE API!

I have not tried every library and started with one that implemented tests, so my first try was to get the tests running and now they run :-)
Good to know that the api you mentioned is used somewhere, I'm just very new to the whole go thing, so I have not checked the reverse usage of the libraries in order to get the most used, or at least one that works.

Yes, we only need some basic functionality. Driver should be very straight forward ... yet I still struggle with GO in some places, yet I hope to get it to work in the next two weeks. If you want to work with me on this, it should be very easy to get it working (top down prototype). One big problem will be to the IP, we only have the MAC and we only can get the IP with a qemu-guest-agent or by finding it out in a dhcp server.

So I'm actually considering forking and trying to build a working full e2e
version that create a running instance with the teraform library. Is that
okay? :) -- If I focus all day today I might get it working.

Yes, go ahead. At least I kickstarted the development. I'm going to bed now (Germany), have a nice day in Australia :-D

Regarding networking and ip address allocation -- I would leave this to
DHCP and nothing more. Why? Because anyone that sets up Proxmox VE or a
Proxmox VE cluster knows what they're doing and likely has some
non-trivial infra setup (like DHCP, DNS and other basic infrastructure
things; I do).

As far as I understand it, you need to get the IP from the driver to log in via SSH and that is not so trivial. Hopefully I'm wrong and just create, start, stop and status is necessary.

I believe your choice of library to fork and improve upon is the right one. After evaluating the terraform one it's a bit inadequate and I'm not sure tested very well. The code is a bit messy too :/

You made any more progress on this? Would be nice to have a full e2e working version that successfully creates a vm with some hard coded values for which os image to run and what the ip address will be.

FWIW you have 7 watchers and 4 star gazers :)

I worked on a new API client that implements the necessary qemu stuff, yet other go projects were more important at the time. I hope that I can continue next weekend.

Took some time but I got at least the creation working, next up is unfortunately not the GetIP stuff, but how to "find" the VM after creation. Proxmox VE does use internally only IDs and we have to retrieve the created VM ID and store it somehow.

Yes, hopefully there is already some interface to attach to, I'd like to stick as close to the Docker Machine stuff as possible.

There would have to be given many drivers store their configs there.

That's what I thought and what I tried to find. I cannot find any explicit code in the drivers, yet I keep looking and experimenting with other drivers to get a glimpse of whats going on.

Yeah, it is some "convention" and the internal class state seems to be dumped into the configuration file. Hell this is great ... we don't need to worry.

Everything is in ~/.docker/machine/machines/<name>/config.json

Just now, i pushed another version with working guest agent ip detection and it is now stuck in the key-based ssh login sequence.

Have a look at the commit messages, I try to document what i've done and what is next on the agenda.

Finally pushed changes to do the nasty key adding manually and I now can run it with the patches version of boot2docker/boot2docker/pull/1319