Skip to content

Commit

Permalink
PTFE-742 gcloud: add option to enable nested virtualization (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet authored Oct 4, 2023
1 parent ba22466 commit fcaa58e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions runner_manager/models/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Annotated, Dict, List, Optional, Sequence, TypedDict

from google.cloud.compute import (
AdvancedMachineFeatures,
AttachedDisk,
Instance,
Items,
Expand Down Expand Up @@ -110,6 +111,7 @@ class GCPInstanceConfig(InstanceConfig):
image_project: str = "ubuntu-os-cloud"
machine_type: str = "e2-small"
network: str = "global/networks/default"
enable_nested_virtualization: bool = True
labels: Optional[Dict[str, str]] = {}
image: Optional[str] = None
disks: Optional[List[Annotated[dict, AttachedDisk]]] = []
Expand Down Expand Up @@ -143,6 +145,9 @@ def configure_instance(self, runner: Runner) -> Instance:
network_interfaces=self.network_interfaces,
labels=self.labels,
metadata=metadata,
advanced_machine_features=AdvancedMachineFeatures(
enable_nested_virtualization=self.enable_nested_virtualization
),
)


Expand Down

0 comments on commit fcaa58e

Please sign in to comment.