History log of /freebsd-current/release/tools/openstack.conf
Revision Date Author Comments
# 0b1c5628 06-May-2024 Colin Percival <cperciva@FreeBSD.org>

release: Rework vm_extra_pre_umount

The vm_extra_pre_umount function in vmimage.subr served two purposes:
It removed /etc/resolv.conf and /qemu (if cross-building), and it
provided a function for cloudware to override in order to make cloud
specific changes to the filesystem before constructing a disk image.

This resulted in a number of bugs:
1. When cross-building, the emulator binary was left as /qemu in the
Azure, GCE, Openstack and Vagrant images.
2. The build host's resolv.conf was left as /etc/resolv.conf in the
basic-ci and basic-cloudinit images.
3. When building GCE images, a Google-specific resolv.conf file was
constructed, and then deleted before the disk image was created.

Move the bits needed for running code inside a VM staging directory
from vm_install_base into a new vm_emulation_setup routine, and move
the corresponding cleanup bits from vm_extra_pre_umount to a new
vm_emulation_cleanup routine.

Remove the /qemu and /etc/resolv.conf cleanups from the cloudware
configuration files (where they exist) since we will now be running
vm_emulation_cleanup to remove those even when vm_extra_pre_umount
has been overridden.

Override vm_emulation_cleanup in gce.conf since in that one case (and
*only* that one case) we don't want to clean up resolv.conf (since it
was constructed for the VM image rather than copied from the host).

releng/14.1 candidate.

MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 2e08f5b4 27-Jan-2020 Warner Losh <imp@FreeBSD.org>

multi-boot for openstack/qcow images

Make stock FreeBSD more useful for people wishing to use them. The
QEMU folks suggested this change. It adds a serial console which
allows them to interact with FreeBSD from the earliest moments. This
allows them to configure FreeBSD via the serial port to set it up for
CI use.

Reviewed by: kevans@
Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D22786


# 82fe8340 13-Dec-2016 Glen Barber <gjb@FreeBSD.org>

- Resize FreeBSD to the size of the OpenStack flavor (growfs).
- Speeds up the boot process by disabling sendmail.
- Allows an user to ssh as root with a public key.
- Make ssh(1) respond faster by disabling DNS lookups.
- Enable DHCP on the vtnet(4) interface.

Note: The CLOUDWARE list has not yet been changed to include the
OpenStack target by default yet.

Submitted by: Diego Casati
PR: 215258
MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# b4ff8f11 14-Jan-2015 Glen Barber <gjb@FreeBSD.org>

Update the VM_EXTRA_PACKAGES list for the openstack
images.

The documentation suggests doing a "just fetch this
and run it"-style bootstrap, from which the list of
dependencies was obtained (in github, at:
pellaeon/bsd-cloudinit-installer)

There is one Python dependency unmet, oslo.config,
which is not in the Ports Collection.

Sponsored by: The FreeBSD Foundation


# 9af30cb2 14-Jan-2015 Glen Barber <gjb@FreeBSD.org>

Enable password-less sudo for openstack images.

Sponsored by: The FreeBSD Foundation


# ee1108eb 14-Jan-2015 Glen Barber <gjb@FreeBSD.org>

In vm_extra_install_base(), do not install waagent
in the openstack image, because it is not used. This
appears to be a copy mistake.

Remove vm_extra_install_base() from the openstack.conf
entirely, since it does not need to be overridden.

Sponsored by: The FreeBSD Foundation


# 30a20c89 20-Nov-2014 Glen Barber <gjb@FreeBSD.org>

Revert r274773, after I *specifically* objected to this change
numerous times.

Sponsored by: The FreeBSD Foundation


# 32dbc829 20-Nov-2014 Colin Percival <cperciva@FreeBSD.org>

Change how packages are installed into VM images: Rather than chrooting
into the image and running 'pkg install' from there, use 'pkg fetch' to
download packages into a temporary location and then 'pkg add' to install
them into the image.

This simplifies the code by avoiding the need to copy /etc/resolv.conf
into the image and then delete it later, and makes it possible to cross
build (e.g., to create an amd64 image when running on i386 hardware; or
in the future for building disk images for embedded platforms).

Because pkg was implicitly installed when VM_EXTRA_PACKAGES was non-empty,
add it to VM_EXTRA_PACKAGES in azure.conf and openstack.conf to maintain
the current behaviour.

By default repo-FreeBSD.sqlite is copied into the image, (a) to match
previous behaviour, where the file would be downloaded by the chrooted
pkg invocation; and (b) because it may be useful for testing purposes,
e.g., to see why a package didn't get installed. Because this file is
large (46 MB) and not likely to be useful in -RELEASE images which are
being launched into Clouds several months later, it can be disabled by
setting NOREPOSQLITE.

As far as I know this commit does not change the disk images produced in
any filesystem-visible way.


# 91333d6a 19-Nov-2014 Glen Barber <gjb@FreeBSD.org>

In vm_install_base(), copy the host resolv.conf into
the build chroot before attempting to do anything that
requires working DNS (i.e., pkg bootstrap).

In vm_extra_pre_umount(), remove the resolv.conf before
the disk image is unmounted from the backing md(4).

Reported by: cperciva
Sponsored by: The FreeBSD Foundation


# 1e7c1f17 05-Nov-2014 Glen Barber <gjb@FreeBSD.org>

Initial rewrite to consolidate VM image build scripts into one.
There may be some very sharp edges here while refactoring.

- Move amd64/mk-vmimage.sh -> scripts/mk-vmimage.sh.
- Remove vm-base target from Makefile.vm.
- In vm-image target, use getopts flags for argument passing.
- Create tools/vmimage.subr, containing default and prototype
for the following functions that are used to drive the build,
run in this order:

vm_install_base()
vm_extra_install_base()
vm_extra_install_packages()
vm_extra_install_ports()
vm_extra_enable_services()
vm_extra_pre_umount()
vm_create_disk()
vm_extra_create_disk()

- In tools/azure.conf, override:

vm_extra_install_base()
vm_extra_pre_umount()
vm_extra_create_disk()

- In tools/openstack.conf, override:

vm_extra_install_base()
vm_extra_pre_umount()

Sponsored by: The FreeBSD Foundation


# 35d8a6aa 01-Nov-2014 Glen Barber <gjb@FreeBSD.org>

Uncomment the cloudinit rc.conf(5) line.

Sponsored by: The FreeBSD Foundation


# 573e7cca 29-Oct-2014 Glen Barber <gjb@FreeBSD.org>

Initial commit providing a mechanism to create
openstack images as part of the release build.

This mimics the way Microsoft Azure images are
built, with the addition of installing the
net/cloud-init package and adding a (commented)
rc.conf(5) entry for cloudinit.

Sponsored by: The FreeBSD Foundation