Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Visualizza le macchine virtuali (VM) create all'interno di un progetto e visualizza
i dettagli associati a ciascuna, come l'indirizzo IP in entrata, l'indirizzo IP in uscita
e il relativo stato, ad esempio Running.
Prima di iniziare
Per utilizzare i comandi dell'interfaccia a riga di comando (CLI) gdcloud, assicurati di aver scaricato, installato e configurato la CLI gdcloud.
Tutti i comandi per Distributed Cloud utilizzano la CLI gdcloud o
kubectl e richiedono un ambiente del sistema operativo.
Recupera il percorso del file kubeconfig
Per eseguire comandi sul server API Management, assicurati di disporre delle seguenti risorse:
Accedi e genera il file kubeconfig per il server API Management se non ne hai uno.
Utilizza il percorso del file kubeconfig del server API Management per sostituire
MANAGEMENT_API_SERVER in queste istruzioni.
Richiedere autorizzazioni e accesso
Per eseguire le attività elencate in questa pagina, devi disporre del ruolo Amministratore
macchina virtuale progetto. Segui i passaggi per
verificare
di disporre del ruolo Amministratore VirtualMachine progetto (project-vm-admin) nello spazio dei nomi
del progetto in cui si trova la VM.
Per le operazioni sulle VM che utilizzano la console GDC o gcloud CLI,
chiedi all'amministratore IAM del progetto di assegnarti sia il ruolo
Project VirtualMachine Admin sia il ruolo Project Viewer (project-viewer).
Ottieni un elenco di VM
Puoi elencare le VM disponibili in un progetto utilizzando la console GDC, gcloud CLI o kubectl.
Console
Nel menu di navigazione, fai clic su Virtual Machines > Instances.
La pagina delle istanze VM mostra un elenco di VM.
Fai clic sul nome di un'istanza VM per visualizzarne i dettagli.
gdcloud
Per elencare le istanze VM:
gdcloudcomputeinstanceslist--projectPROJECT
Sostituisci PROJECT con il nome del progetto GDC in cui si trova la VM.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis page details how to view virtual machines (VMs) within a project, including associated details like ingress IP, egress IP, and status.\u003c/p\u003e\n"],["\u003cp\u003eYou can list VMs using the GDC console, \u003ccode\u003egdcloud\u003c/code\u003e CLI, or \u003ccode\u003ekubectl\u003c/code\u003e, and you must replace placeholders for management server kubeconfig and project names in commands.\u003c/p\u003e\n"],["\u003cp\u003eTo perform the tasks on this page, the Project VirtualMachine Admin role is required, and the Project Viewer role is required when working with the console or \u003ccode\u003egdcloud\u003c/code\u003e CLI.\u003c/p\u003e\n"],["\u003cp\u003eYou can find instructions to locate IP address information for a specific VM on a separate linked page, and the source image of a VM can also be viewed using \u003ccode\u003ekubectl\u003c/code\u003e.\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 its 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/gdch/resources/gdcloud-overview).\nAll commands for Distributed Cloud 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. [Sign in and generate](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/iam/sign-in#cli) the\n kubeconfig file for the Management API server if you don't have one.\n\n2. Use the path to the kubeconfig file of the Management API server to replace\n \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\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\n[verify](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/preparation#verify-user-access)\nthat you have 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,\ngdcloud CLI, or `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/gdch/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."]]