Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2024 00:34:25 +0100
From:      Jo Durchholz <jo@durchholz.org>
To:        "freebsd-virtualization@FreeBSD.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: Best way to have a FreeBSD VM for automated testing?
Message-ID:  <84e1634c-1d23-4d2a-867b-4482351da572@durchholz.org>
In-Reply-To: <C5794819-BFE0-4D85-AA5A-00D5988C8B9C@jnielsen.net>
References:  <C5794819-BFE0-4D85-AA5A-00D5988C8B9C@jnielsen.net>

next in thread | previous in thread | raw e-mail | index | archive | help
TL;DR: Just my current status.

On 24.02.24 22:47, John Nielsen wrote:
> 1) AWS EC2 + cloud-init. The FreeBSD Project publishes AMIs for every release (again, thanks cperciva). You can launch an EC2 instance from one of those with a few clicks. You can additionally assign an IAM role to the instance to give it permission to write to an S3 bucket and drop a script in the user-data for the instance to run when it boots. The script could download the Python code to be run, run it, and upload the results to S3 all non-interactively.
> 
> With a couple hours’ work you could adapt the stock image to add any missing dependencies and disable unneeded drivers and services to speed the boot, then snapshot that and use your custom image for future runs.
> 
> You could also easily manage the whole thing with Terraform. Copy/paste the infrastructure as code templates and tweak the variables to get an easily repeatable system.

Ah, I didn't mention that. The tests are for running locally.
The overall project is for a home appliance, so no cloud.

> 2) KVM + libvirt on whatever Linux host(s) you have available. The VM-IMAGES released by the Project include qcow volumes. You might need to tweak the image to do your custom script(s) at startup (though the image may also have cloud-init if your environment supports it) but qcow does support snapshots as well and the whole thing should have low boot times.

That was my second approach :-)
It turned out to have various roadbumps (mostly lack of 
knowledge/experience on my side, no doubts about that).

I'm currently going back to my first approach, Vagrant, but diving into 
writing my own Vagrantfile. I understand that's easy enough for somebody 
without deep knowledge of KVM/libvirt, so I'll see.

Regards,
Jo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84e1634c-1d23-4d2a-867b-4482351da572>