Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Affichez les machines virtuelles (VM) créées dans un projet et consultez les détails associés à chacune d'elles, tels que l'adresse IP d'entrée, l'adresse IP de sortie et l'état de la VM (Running, par exemple).
Avant de commencer
Pour utiliser les commandes de l'interface de ligne de commande (CLI) gdcloud, assurez-vous d'avoir téléchargé, installé et configuré la CLI gdcloud.
Toutes les commandes pour l'appliance GDC isolée utilisent la CLI gdcloud ou kubectl et nécessitent un environnement de système d'exploitation (OS).
Obtenir le chemin d'accès au fichier kubeconfig
Pour exécuter des commandes sur le serveur de l'API Management, assurez-vous de disposer des ressources suivantes :
Localisez le nom du serveur de l'API Management ou demandez-le à votre administrateur de plate-forme.
Connectez-vous et générez le fichier kubeconfig pour le serveur d'API Management si vous n'en avez pas.
Utilisez le chemin d'accès pour remplacer MANAGEMENT_API_SERVER{"</var>"}} dans ces instructions.
Demander des autorisations et un accès
Pour effectuer les tâches listées sur cette page, vous devez disposer du rôle Administrateur VirtualMachine du projet. Suivez les étapes pour valider ou demandez à votre administrateur IAM de projet de vous attribuer le rôle Administrateur VirtualMachine du projet (project-vm-admin) dans l'espace de noms du projet dans lequel réside la VM.
Pour les opérations sur les VM à l'aide de la console GDC ou de la CLI gdcloud, demandez à votre administrateur IAM de projet de vous attribuer le rôle Administrateur de machines virtuelles du projet et le rôle Lecteur du projet (project-viewer).
Obtenir une liste des VM
Vous pouvez lister les VM disponibles dans un projet à l'aide de la console GDC ou de kubectl.
Console
Dans le menu de navigation, cliquez sur Machines virtuelles > Instances.
La page "Instances de VM" affiche la liste des VM.
Cliquez sur le nom d'une instance de VM pour afficher ses détails.
gdcloud
Pour lister les instances de VM :
gdcloudcomputeinstanceslist--projectPROJECT
Remplacez PROJECT par le nom du projet GDC dans lequel se trouve la VM.
Remplacez MANAGEMENT_API_SERVER par le fichier kubeconfig du serveur de l'API Management.
Remplacez PROJECT par le projet GDC dans lequel se trouve la VM.
Remplacez VM_NAME par le nom de la VM.
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\u003eThis guide details how to view and manage virtual machines (VMs) within a project, including listing VMs and viewing their details like ingress and egress IP addresses and status.\u003c/p\u003e\n"],["\u003cp\u003eYou can list VMs using either the GDC console by navigating to the "Virtual Machines > Instances" page, or through the \u003ccode\u003egdcloud\u003c/code\u003e and \u003ccode\u003ekubectl\u003c/code\u003e command-line interfaces.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekubectl\u003c/code\u003e CLI is used to get a list of VMs, their boot disks, and the source image associated with them, requiring the admin cluster's kubeconfig file path and project name.\u003c/p\u003e\n"],["\u003cp\u003eTo use the \u003ccode\u003egdcloud\u003c/code\u003e or \u003ccode\u003ekubectl\u003c/code\u003e CLI, you must ensure you have the appropriate CLI downloaded, installed, and configured, as well as obtain the admin cluster's kubeconfig file if you do not already possess it.\u003c/p\u003e\n"],["\u003cp\u003eDetails on viewing IP addresses for a specific VM are provided on the linked "IP addresses" page, giving further insight into VM management.\u003c/p\u003e\n"]]],[],null,["# View VM properties\n\nView virtual machines (VMs) that have been created within a project and see\ndetails associated with each, such as the ingress IP address, the egress IP\naddress, and the VM's status, such as `Running`.\n\nBefore you begin\n----------------\n\nTo use `gdcloud` command-line interface (CLI) commands, ensure that you have downloaded, installed,\nand configured the [`gdcloud` CLI](/distributed-cloud/hosted/docs/latest/appliance/resources/gdcloud-overview).\nAll commands for GDC air-gapped appliance use the `gdcloud` or\n`kubectl` CLI, and require an operating system (OS) environment.\n\n### Get the kubeconfig file path\n\nTo run commands against the Management API server, ensure you have the following\nresources:\n\n1. Locate the Management API server name, or ask your Platform Administrator (PA)\n what the server name is.\n\n2. [Sign in and generate](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/iam/sign-in#cli) the\n kubeconfig file for the Management API server if you don't have one.\n\n3. Use the path to replace \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER{\"</var>\"}}\u003c/var\u003e in these instructions.\n\n### Request permissions and access\n\nTo perform the tasks listed in this page, you must have the Project\nVirtualMachine Admin role. Follow the steps to either\n[verify](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/preparation#verify-user-access)\nor have your Project IAM Admin\n[assign](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/preparation#grant-user-access-vm-resources)\nyou the Project VirtualMachine Admin (`project-vm-admin`) role in the namespace\nof the project where the VM resides.\n\nFor VM operations using the GDC console or the gdcloud CLI,\nrequest your Project IAM Admin to assign you both the\nProject VirtualMachine Admin role and the Project Viewer (`project-viewer`)\nrole.\n\nGet a list of VMs\n-----------------\n\nYou can list the VMs available in a project by using the GDC console\nor `kubectl`. \n\n### Console\n\n1. In the navigation menu, click **Virtual Machines \\\u003e Instances**.\n\n2. The VM instances page shows a list of VMs.\n\n3. Click the name of a VM instance to view its details.\n\n### gdcloud\n\nTo list VM instances: \n\n gdcloud compute instances list --project \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\n\n- Replace \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e with the name of the GDC project in which the VM lives.\n\n### kubectl\n\nGet a list of VMs: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e \\\n get virtualmachines.virtualmachine.gdc.goog -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\n\n- Replace \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e with the kubeconfig file for the Management API server.\n- Replace \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e with the name of the GDC project in which the VM lives.\n\nLocate IP addresses for a VM\n----------------------------\n\nSee the [IP addresses](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/connect-to-vm/ip-addresses)\npage for instructions on viewing the IP address information for a given VM.\n\nView a VM source image\n----------------------\n\nYou can view the source image of a VM. \n\n### kubectl\n\nTo get the VM boot disk: \n\n DISK=`kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e get virtualmachines.virtualmachine.gdc.goog \\\n -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e \\\n -o jsonpath={.spec.disks[?(@.boot==true)].virtualMachineDiskRef.name}`\n\nTo view the source image: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e get virtualmachinedisk.virtualmachine.gdc.goog \\\n -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e $DISK -o jsonpath={.spec.source.image.name}\n\n- Replace \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e with the kubeconfig file for the Management API server.\n- Replace \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e with the GDC project in which the VM lives.\n- Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM."]]