Skip to content

Conversation

jwmay2012
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
Adds support for enabling nested virtualization on GCE instances via the enableNestedVirtualization field in GCPMachineSpec. This maps directly to GCP's AdvancedMachineFeatures.EnableNestedVirtualization API field.

This enables running VMs inside GCE instances for container sandboxes, KVM, QEMU, etc.

Special notes for your reviewer:
This is a simple boolean field that maps directly to the GCP API. The field must be set at instance creation time and cannot be changed after creation (GCP limitation).

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Add support for nested virtualization on GCE instances. `GCPMachine.Spec.EnableNestedVirtualization` allows running VMs inside GCE instances.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Sep 26, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jwmay2012
Once this PR has been reviewed and has the lgtm label, please assign fabriziopandini for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 26, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @jwmay2012. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 26, 2025
Copy link

netlify bot commented Sep 26, 2025

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
🔨 Latest commit 338e54c
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-gcp/deploys/68d6def10f72ec00087a721e
😎 Deploy Preview https://deploy-preview-1537--kubernetes-sigs-cluster-api-gcp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

// +optional
GuestAccelerators []Accelerator `json:"guestAccelerators,omitempty"`

// EnableNestedVirtualization specifies whether to enable nested virtualization or not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we should nest this under advancedMachineFeatures to reflect the GCP API, but to be honest I'm not sure that "advanced" is really a semantic grouping, so I think I prefer the flattened structure. It's always risky to change the structure because we can't predict the future evolution of the upstream API, but in this case I think it's fine!

https://cloud.google.com/compute/docs/instances/nested-virtualization/overview
NOTE: Nested virtualization must be enabled at instance creation time and cannot be changed after the instance is created. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we generally treat machines as immutable anyway - i.e. we would launch a new machine, even if the field was mutable. My understanding could be out of date though.

Not sure there's any harm in the NOTE though, but I don't think it's going to be a problem in practice

@justinsb
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 26, 2025
@jwmay2012
Copy link
Contributor Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants