Commit Graph

23 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 611fb2bf4c Deprecate OpenStack-Ansible nspawn repositories
Since nspawn support has been removed with [1] we now
start repositories deprecation process.

[1] https://review.opendev.org/c/openstack/openstack-ansible/+/782569

Depends-On: https://review.opendev.org/c/openstack/project-config/+/797723
Change-Id: I113f0f2b5befc4bca830c130d7f60e621c86798e
2021-06-23 17:22:41 +00:00
Jonathan Rosser bb73290f44 Update supported operating systems
Remove centos-7
Remove suse
Update vagrantfile for debian buster

Change-Id: I5ebef1d635c0dd9569fc1a61d821d66864f16e15
2020-10-05 11:39:28 +00:00
Jonathan Rosser 2645f180aa Ensure /tmp is writeable during cache preparation
This is necessary to ensure it is possible for apt to write to /tmp
when accessing the container image as a chroot during cache prep.

In addition fix up cross-repo zuul jobs to be in line with the rest of OSA
by dropping the Suse job and switching debian stable(stretch) for buster.

Temporarily make the cross-repo jobs non-voting to break a circular
dependancy between fixes in nspawn_hosts and nspawn_container_create.

Depends-On: https://review.opendev.org/728995
Change-Id: I8c6034f49600b9f1f431eb2a7c02ae567ea6d32c
2020-05-19 10:58:05 +00:00
Guilherme Steinmüller 29bd1ed281 debian: add support
This patch adds the Debian jobs for this role to make sure
it's always passing as well as updates the meta and creates
debian.yml var file to reflect it's support of Debian accordingly.

Change-Id: I2653aea2aebc95bfc67fe49bc66fb68a4f996170
2019-04-12 20:49:56 +00:00
Kevin Carter 26221a267d Use libeatmydata during nspawn cache prep
The nspawn cache prep is timing out regularly so use eatmydata to minimise
pressure on the filesystem during package installation.

dpkg calls fsync for each file installed from each package which can
result in very poor performance on some filesystems. This patch gives
around a 4x improvement in "slow" gate runs, and 2x on esxi hdd storage.

Change-Id: I80efd3f8044f377a497492f09689c459c6094742
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
Co-authored-by: Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
2019-01-02 12:02:54 -06:00
Kevin Carter fce12838ba Update the nspawn unit services
This change updates the unit file for systemd-nspawn to allow it to
better confine containers and have them reliabily start/stop on host
restart.

Change-Id: I3c7a07a94c94a81ac8380a4e336cf744615a6b5b
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-12-22 18:20:36 +00:00
Kevin Carter 27bef72fce Change ssh variable in Ubuntu and remove masks
The ssh service on ubuntu based systems is "ssh" which is established by
the service unit path `/lib/systemd/system/ssh.service`. When running
the service will respond to the name "sshd" however this is just an
alias.

The image prep task used to mask ssh after it was disabled. While
in practice thats OK, its really a little overkill and provides little
benifit. In prep the containers will have ssh disabled, but in the event
its needed it can be easily enabled wihout having to remember to unmask. 

Change-Id: I2edb3ca7cae6e05f15ab29b1d50ff1281762905e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-11-22 14:00:13 +00:00
Jesse Pretorius f3fe949711 Simplify inserting apt keys into nspawn image
Bionic requires a functioning gpg-agent to run apt-key add. This means
that gpg-agent must be working properly in the chroot when the nspawn
image preparation script runs.

Previous changes [1] have enabled apt-key to communicate with gpg-agent
during the nspawn_hosts role checks, however the cache prep fails almost
every time when nspawn_hosts is used within other role checks.

This is not a new issue, debian-installer is affected too [2].

This change adopts the same route as d-i, and simply copies the host
/etc/apt/trusted.gpg.d directory to the nspawn image, removing the
need for apt-key and in turn gpg-agent.

This is a re-implementation of https://review.openstack.org/588962
for nspawn.

[1] https://review.openstack.org/590431
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=851774

Change-Id: I3c56da445377d7ba27a623fb7ebe95c20d28a327
2018-08-25 21:12:51 +01:00
Kevin Carter caf28c7663
Tuneup prep and local routing when running w/out bridges
When running without bridges the local routing needs to be scoped to the
host. This change ensures that is the care.

When re-preping an environment the GPG setup will require aceess to fd's
which may not exist at the time the base cache is re-prep'd.

nspawn mtu settings will now follow the primary interface.

Change-Id: I74e9301a98cf92161feb31e6808e9e02a07f662c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-08-09 23:51:34 -05:00
Kevin Carter 9759e45a93
Fix image preparation for bionic
Ensure that the devices required for apt are present. Ensure
that the required directories for gpg-agent are present. Ensure
that the gpg-agent is running.

Change-Id: I057ac43a7f88654affd14410c06e68bffe34104d
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-08-09 14:26:11 -05:00
Kevin Carter b99f48bc8b
Add the private-network flag to the nspawn ExecStart
In modern kernels sysfs is largely shared with the host in a read only
state when an nspawn container is created. This sharing results in the
container seeing network interfaces that don't belong to them. This
change forces network isolation by instructing the container to begin
with a fully isolated network stack.

Change-Id: I9ef22c5e321dce8025cafc622bdfb6ad252ef0cf
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-08-09 11:15:10 -05:00
Kevin Carter cb466cd385
Update nspawn role correcting several issues
The tempfiles template was being setup on the host, this causes host
machines to have an issue with journald on reboot due to the directory
being part of systemd-tmpfiles.

Nspawn container journals were not being written to the host. This was
fixed by changing try-guest to try-host, which will fall back to the
guest in the event that host journalling is not possible.

Systemd-nspawn containers were not starting on boot due to them needing
to wait for networking to be online. The base template has been updated
to ensure networking is online before starting containers.

Change-Id: I6af3923bd10091172e75cfb16c9146cd47f827a4
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-07-03 23:56:07 -05:00
Kevin Carter d520e80462
Make host copying more selective
The host copy process was taking too much, this makes that process more
selective.

Change-Id: Ic25559d9b68b6208ffdbed020cc79bd6b3d52fdd
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-05-18 19:16:03 -05:00
Kevin Carter 8b74871e98
Update prep scripts to pull in a few updates
Change-Id: I2b5d4573c9237048cf1ffafac474e5c91e351f6a
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-05-17 18:37:11 -05:00
Kevin Carter 556748bc4e
Document everything in config
Update container pkg list and use qgroups

Other roles within OSA require additional packages that were removed
from the base cache. This change puts those packages back.

Additionally this change implements qgroups which will resolve an issue
where the containers are spamming a reoccuring error message indicating
an issue with the loopback file system.

Change-Id: If658e5f332e4580cc51182ac92331a2ef91fbcb8
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-05-14 20:42:33 -05:00
Kevin Carter 50d7cc82c5
Update nspawn hosts
Use the common roles throught this role to remove all of the boilerplate
code we had. The common modules do most of the heavy lifing.

Update to fix the resolve.conf issue with the image cache prep.

Add legacy image support and use smaller upstream images by default.

Now that suse supports systemd-networkd we can enable suse support in
nspawn.

Change-Id: I5f6ceb928f5c0902adf2e34f96a5998840400777
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-05-13 14:28:16 -05:00
Kevin Carter 2758cbfc6a
add network ops
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-02-16 21:25:39 -06:00
Kevin Carter 4e28ef6127
Remove openssh server as a default package
The openssh server package is not needed, this change removes that extra
dep.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-02-14 19:05:44 -06:00
Kevin Carter bccb77c6af
Convert containers to use systemd-resolved
While the legacy resolveconf service is fairly stable this change
updates us to use more of the built-in services and removes additional
dependencies.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-02-14 18:49:13 -06:00
Kevin Carter edf8e1238c
Enable less noisy journaling
Enable persistent journals and link the container journal to the host by
default.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-02-13 17:07:48 -06:00
Kevin Carter b485d3178a
Remove lock file if found
When the cache is created the lock file my be left over, this can cause
some conflicts later in the container provisioning process. This change
removes the file if found.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-02-09 18:54:40 -06:00
Kevin Carter 0c69cf6cdf Add the option to follow inherit the parent MTU
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-02-08 18:06:11 -06:00
Kevin Carter e97c013f67
First commit
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-02-08 11:39:40 -06:00