pitstopcloud / virtualbox-go

Most complete golang library for virtualbox
81 stars 17 forks source link

Terraform plugin for VirtualBox #3

Open davidnewcomb opened 4 years ago

davidnewcomb commented 4 years ago

It would seem the next logical step!

I've been hunting around for one and there seems to be about 3 projects on the go. None of them seem to be in any kind of state for me to use! You know how it goes!

Terraform plugins are written in Go and there isn't an official plugin for VirtualBox yet. I was investigating how much work I'd need to do and so far I have: learn Go, learn your thing, learn Terraform plugins. It seems you are most of the way there already, so how about it?

namaggarwal commented 3 years ago

Hey @davidnewcomb did you follow up on this ? Did you find a better one ? I am thinking of writing a terraform provider for virtual box.

davidnewcomb commented 3 years ago

No I didn't unfortunately.

I had wanted to be able to create linked clones from a particular snapshot, start them up, wait for them to get their new ip address and fully start up to the tty login, then take a running snapshot. I implemented it all in bash and python. VirtualBox is really flaky and can be a bit funny about things happening at the same time sometimes, so I had to implement a VirtualBox mutex for certain operations so only one could run at a time ...and lots of that kind of thing.

There isn't an awful lot of "catch error retry after blar seconds" in the scripts, so they carry a certain amount of general acceptance that you going to get a certain amount of VirtualBox failures when all those clones are in a load balanced work pool and are being reset every couple of minutes.

I couldn't help feeling that offloading of the VirtualBox management to terraform could have simplified the whole thing!