[WIP] Add MAAS multinode testing#567
Draft
freyes wants to merge 50 commits into
Draft
Conversation
c2f2f2f to
30bf410
Compare
8553e50 to
9ff7687
Compare
sabaini
reviewed
Sep 25, 2025
f47493e to
3767e19
Compare
d0ae872 to
0cdd6e4
Compare
gboutry
requested changes
Oct 28, 2025
| ip_ranges = [maas_subnet_ip_range.generic_subnet_dhcp_range.id] | ||
| } | ||
|
|
||
| resource "maas_machine" "node" { |
Collaborator
There was a problem hiding this comment.
Suggested change
| resource "maas_machine" "node" { | |
| resource "maas_machine" "node" { | |
| depends_on = [ null_resource.maas_controller_null ] |
This fixes the race condition preventing maas to connect via ssh on the libvirt host
Comment on lines
+6
to
+12
| terraform { | ||
| source = "." | ||
| extra_arguments "parallelism" { | ||
| commands = ["apply", "plan", "destroy"] | ||
| arguments = ["-parallelism=1"] | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
Suggested change
| terraform { | |
| source = "." | |
| extra_arguments "parallelism" { | |
| commands = ["apply", "plan", "destroy"] | |
| arguments = ["-parallelism=1"] | |
| } | |
| } |
Parallelism can be dropped
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
This directory is meant to be used to store sensitive information that shouldn't be committed to the git repository, but it's worth to not be written to /tmp since it's helpful when debugging, for example API keys, ssh keys, etc. Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
The maas provider needs information that comes out of the virtualnodes unit, this change introduces autogeneration of the maas provider block based on it. To allow `plan` and `validate` subcommands keep working, the necessary data is mocked. Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
This allows to reuse the value in cloud-init configuration and any other place where the hostname needs to be referenced, e.g. when reading data from MAAS API Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
the maas setup needs to happen in the maas unit, not in a cloud-init driven config script. Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
- Set kernel global options - Disable dnssec - Configure password-less ssh access to the kvm host - Register virtual nodes - Configure networking Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
This allows calling the deploy.sh from anywhere and any relative paths will still work. Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
The script collect-logs.sh calls sosreport on the maas-controller node and the hypervisor. Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
There are scenarios where the apt repo index is presenting invalid checksums, likely during re-sync of the mirrors, so adding a simple retry mechanism to make this step more robust. Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
This key is then used by terragrunt/terraform to provision the maas-controller and access it, but more importantly to configure the hypervisor access and allow MAAS to manage the libvirt instances via the virsh power driver
Rely on `sudo su - ubuntu -c foo` to enforce the execution of the deploy.sh script in a new shell session so the new group memberships become effective Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
This allows the user to ssh into the node and debug interatively, the job will be held on until it times out or the file /tmp/.continue appears.
The genisoimage package is needed to build a iso image that's used to be passed to cloud-init, this image contains all the cloud-init configuration produced by the virtualnodes stack unit Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
This script allows the execution of the testing machinery directly interacting with testflinger. Usage example: ``` ./testing/local-testflinger.sh ``` The script depends on finding a snap file at the top of the git repository, this can be a locally built snap or a snap that was fetched via `snap download ...` Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Create a libvirt pool called "sunbeam" to store all the volumes used by the libvirt instances, this allows a cleaner setup on non-dedicated hypervisors Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Add a busy loop until the MAAS admin API key is written to disk, this prevents race conditions found when testing on physical hardware
This has the intention of putting less pressure on the maas controller and reduce the chances that the libvirt instance fails to pxe boot.
Include a section to document how to run the testing from a local development environment. Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
The terraform libvirt provider changed their schema definition in 0.9.0 Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
Force mac address to be rendered as a literal string Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
c062693 to
bda71a2
Compare
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements testing of the openstack snap using the MAAS provider in a virtual environment.