Overview of Virtual Machine Manager API

The Virtual Machine Manager (VMM) of Google Distributed Cloud (GDC) air-gapped uses Kubernetes Resource Model (KRM) APIs in its virtual machine (VM) operations and lifecycle management.

Use the kubectl CLI for the VMM APIs.

Service endpoint

The following URLs are the API endpoints of the VMs:

  • https://GDCH_API_SERVER_ENDPOINT/apis/virtualmachineoperations.gdc.goog/v1
  • https://GDCH_API_SERVER_ENDPOINT/apis/virtualmachine.gdc.goog/v1

Discovery document

Use the kubectl proxy command to open a proxy to the API server on your local machine. From there, you can access the discovery document at one of the following URLs:

  • http://127.0.0.1:8001/apis/virtualmachineoperations.gdc.goog/v1
  • http://127.0.0.1:8001/apis/virtualmachine.gdc.goog/v1

Example of VM KRM

The following VirtualMachineImageImport file shows the creation of a disk image from a persistent disk. You choose the persistent disk from a VirtualMachineDisk list and select it to create the image and get the size parameter of the source. The same example is on the Create custom images page.

apiVersion: virtualmachine.gdc.goog/v1
kind: VirtualMachineImageImport
metadata:
  name: VM_IMAGE_IMPORT_NAME
  # Name of the VM image you want to import.
spec:
  source:
    diskRef:
      name: DISK_NAME
      # Name of the source disk that you will use to create your image.
  imageMetadata:
    name: IMAGE_NAME
    # Name of your created VM image.
    operatingSystem: OS_NAME
    # Name of the image OS.
    minimumDiskSize: MINIMUM_DISK_SIZE
    # Disk size in the VM image. It must be greater than or equal to the source disk size. An example value is 20G.