Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Le gestionnaire de machines virtuelles (VMM) de l'appliance Google Distributed Cloud (GDC) isolée utilise les API Kubernetes Resource Model (KRM) dans ses opérations de machines virtuelles (VM) et la gestion du cycle de vie.
Utilisez la CLI kubectl pour les API VMM.
Point de terminaison de service
Le point de terminaison de l'API VMM est https://MANAGEMENT_API_SERVER_ENDPOINT/apis/virtualmachine.gdc.goog/v1, où MANAGEMENT_API_SERVER_ENDPOINT est le point de terminaison du serveur de l'API Management.
Document de découverte
Utilisez la commande kubectl proxy pour ouvrir un proxy vers le serveur d'API sur votre machine locale. Vous pouvez ensuite accéder au document de découverte à l'URL suivante : http://127.0.0.1:8001/apis/virtualmachine.gdc.goog/v1.
Exemple de KRM de VM
Le fichier VirtualMachineImageImport suivant montre la création d'une image de disque à partir d'un disque persistant. Vous choisissez le disque persistant dans une liste VirtualMachineDisk et le sélectionnez pour créer l'image et obtenir le paramètre size de la source. Le même exemple est disponible sur la page Créer des images personnalisées.
apiVersion:virtualmachine.gdc.goog/v1kind:VirtualMachineImageImportmetadata: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.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eThe Virtual Machine Manager (VMM) in Google Distributed Cloud (GDC) uses Kubernetes Resource Model (KRM) APIs for managing virtual machine (VM) operations and lifecycles.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekubectl\u003c/code\u003e CLI is used to interact with the VMM APIs.\u003c/p\u003e\n"],["\u003cp\u003eThe API endpoints for VMs are provided via two specific URLs, both starting with \u003ccode\u003ehttps://<var translate="no">GDCH_API_SERVER_ENDPOINT</var>\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can access the discovery document for the VMM APIs using \u003ccode\u003ekubectl proxy\u003c/code\u003e and navigating to the specified URLs via the local proxy.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eVirtualMachineImageImport\u003c/code\u003e file example demonstrates how to create a disk image from a persistent disk within the admin cluster, including specifying the source disk, image name, operating system, and minimum disk size.\u003c/p\u003e\n"]]],[],null,["# Overview of Virtual Machine Manager API\n\nThe 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.\n\n\u003cbr /\u003e\n\nUse the `kubectl` CLI for the VMM APIs.\n\nService endpoint\n----------------\n\nThe API endpoint for the VMM API is\n`https://`\u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_ENDPOINT\u003c/var\u003e`/apis/virtualmachine.gdc.goog/v1`,\nwhere \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_ENDPOINT\u003c/var\u003e is the endpoint of the\nManagement API server.\n\nDiscovery document\n------------------\n\nUse the `kubectl proxy` command to open a proxy to the API server on your local\nmachine. From there, you can access the discovery document at the\nfollowing URL: `http://127.0.0.1:8001/apis/virtualmachine.gdc.goog/v1`.\n\nExample of VM KRM\n-----------------\n\nThe following `VirtualMachineImageImport` file shows the creation of a disk\nimage from a persistent disk. You choose the persistent\ndisk from a `VirtualMachineDisk` list and select it to create the image and get\nthe `size` parameter of the source. The same example is on the\n[Create custom images](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/create-custom-images/create-custom-images)\npage. \n\n apiVersion: virtualmachine.gdc.goog/v1\n kind: VirtualMachineImageImport\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eVM_IMAGE_IMPORT_NAME\u003c/span\u003e\u003c/var\u003e\n # Name of the VM image you want to import.\n spec:\n source:\n diskRef:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eDISK_NAME\u003c/span\u003e\u003c/var\u003e\n # Name of the source disk that you will use to create your image.\n imageMetadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eIMAGE_NAME\u003c/span\u003e\u003c/var\u003e\n # Name of your created VM image.\n operatingSystem: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eOS_NAME\u003c/span\u003e\u003c/var\u003e\n # Name of the image OS. Select one of the following four options: ubuntu-2004, windows-2019, rhel-8, or rocky-linux-8.\n minimumDiskSize: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eMINIMUM_DISK_SIZE\u003c/span\u003e\u003c/var\u003e\n # Disk size in the VM image. It must be greater than or equal to the source disk size. An example value is 20G."]]