Overview of Virtual Machine Manager API

The Virtual Machine Manager (VMM) of Google Distributed Cloud (GDC) air-gapped appliance 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 API endpoint for the VMM API is https://MANAGEMENT_API_SERVER_ENDPOINT/apis/virtualmachine.gdc.goog/v1, where MANAGEMENT_API_SERVER_ENDPOINT is the endpoint of the Management API server.

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 the following URL: 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. Select one of the following four options: ubuntu-2004, windows-2019, rhel-8, or rocky-linux-8.
    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.