Skip to content

Support nested virtualization#26

Open
nmanthey wants to merge 8 commits into
kernelci:mainfrom
nmanthey:support-nested-virtualization
Open

Support nested virtualization#26
nmanthey wants to merge 8 commits into
kernelci:mainfrom
nmanthey:support-nested-virtualization

Conversation

@nmanthey

@nmanthey nmanthey commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

To be able to test virtualization feature better, let's use the c8i instance type by default. That instance type supports nested virtualization within Amazon EC2 instances. Enable nested virtualization by default, if detected. Update example configurations.

With this feature in place, we can install a kernel as part of the test, and then also test the virtualization features of that kernel.

nmanthey added 4 commits July 6, 2026 14:29
Replace c5a.4xlarge (AMD EPYC) with c8i.4xlarge (Intel Xeon 6) as the
default x86_64 instance type in DEFAULT_PLATFORM_MAP. The c8i family
provides a newer CPU generation with equivalent compute resources
(16 vCPUs, 32 GB RAM) and is a prerequisite for enabling nested
virtualization support.

This change affects KernelCI pull-lab jobs: when the poller translates
a job_definition for an x86_64 workload, it will now launch c8i.4xlarge
instances instead of c5a.4xlarge.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Add automatic detection and enablement of nested virtualization when
launching EC2 instances from supported Intel-based families. When a
supported instance type is detected, the CpuOptions parameter with
NestedVirtualization=enabled is passed to the RunInstances API call.

This exposes Intel VT-x to the guest, allowing KVM and Hyper-V
workloads to run inside the EC2 instance. Supported families per AWS
documentation: C8i, M8i, R8i, X8i, C7i, M7i, R7i, I7i and their
variants (flex, d).

Reference: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-ec2-nested-virtualization.html

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Update instance_type from c5a.4xlarge to c8i.4xlarge in both example
configuration files to match the new default platform map. This ensures
local runs and integration tests use the same instance type as
KernelCI-triggered pull-lab jobs.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
The repository default branch is 'main' but all workflows referenced
'mainline', causing them to never trigger on pull requests or pushes.

Changes:
- basic-ci.yml: trigger on main, drop Python 3.9/3.10 from matrix
  (package requires >=3.11)
- coverage-check.yml: checkout origin/main for base coverage
- codeql.yml: trigger on main

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

nmanthey added 3 commits July 7, 2026 14:24
- cli.py: remove empty f-string, wrap long line
- artifacts.py: remove trailing blank line
- pull_labs_poller.py: remove unused submit_tests import
- test_kcidb_submit.py: add blank lines before nested definitions
- test_pull_labs_poller.py: remove unused tempfile import, fix
  over-indented continuation lines, rewrite test to not patch the
  removed submit_tests symbol
- test_pull_labs_translate.py: remove unused DEFAULT_TEST_TYPE_MAP import

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
- setup.py: add analysis deps (pandas, matplotlib, seaborn) to [dev]
  extra so pylint can resolve all imports during linting
- pull_labs_poller.py: suppress unused-import on intentional boto3
  availability check
- setup_validate.py: remove redundant json.JSONDecodeError from except
  clauses (already covered by parent ValueError)
- test_pull_labs_poller.py: disable protected-access check (tests
  intentionally exercise private methods)
- test_role_manager.py: disable protected-access check
- test_kcidb_submit.py: suppress unused-argument on mock callbacks that
  must match urlopen signature

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Add test_nested_virtualization.py covering _supports_nested_virtualization()
in VMLauncher. Tests verify that C8i, M8i, R8i, C7i, M7i, R7i, X8i,
I7i families (and flex/d variants) are correctly detected as supporting
nested virtualization, while older families (c5a, c6g, t3, m5) are not.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
@nmanthey nmanthey force-pushed the support-nested-virtualization branch from 7f32e80 to bf3e19d Compare July 7, 2026 13:02
Twine check failed because the content type was missing, defaulting to
RST which cannot parse Markdown backticks. Set content type explicitly
to text/markdown.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
bhcopeland added a commit to bhcopeland/pullab_cloud that referenced this pull request Jul 16, 2026
Basic CI has never run against this repository, so the tree has drifted
out of line with .flake8 and .pylintrc. Fix the violations so the lint
job can pass:

  F541  f-string without placeholders (cli.py)
  E501  line too long (cli.py)
  W391  blank line at end of file (artifacts.py)
  F401  unused imports (pull_labs_poller.py, test_pull_labs_translate.py)
  E306  missing blank line before nested definition (test_kcidb_submit.py)
  W0714 overlapping excepts, JSONDecodeError derives from ValueError
        (setup_validate.py)
  W0613 unused argument (test_kcidb_submit.py)
  W0212 protected access in tests (test_role_manager.py)

These changes are extracted unmodified from PR kernelci#26 by Norbert Manthey,
which fixes them alongside its feature work.

Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
bhcopeland added a commit to bhcopeland/pullab_cloud that referenced this pull request Jul 16, 2026
pylint reports E0401 import-error for pandas, matplotlib and seaborn in
the analysis package, because the dev extra does not install them and CI
only installs ".[dev]". Add them to dev so lint can resolve the imports.

Also set long_description_content_type, so the README renders as
Markdown rather than plain text.

Extracted unmodified from PR kernelci#26 by Norbert Manthey.

Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants