Listar e visualizar informações da VM usando o ambiente de execução de VM no GDC
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Este documento é destinado a proprietários de aplicativos que executam o Google Distributed Cloud.
Neste documento, mostramos como listar VMs executadas no Google Distributed Cloud usando
o ambiente de execução de VMs no GDC. Também é possível ver mais informações de cada
VM.
Antes de começar
Para concluir este documento, você precisa de acesso aos seguintes recursos:
Para ver uma lista de VMs em um namespace específico, use o parâmetro --namespace com o comando kubectl.
Veja uma lista de VMs em um namespace usando kubectl get gvm:
kubectlgetgvm--namespaceNAMESPACE_NAME
Substitua NAMESPACE_NAME pelo namespace que você quer
ver.
O exemplo de saída a seguir mostra as informações da VM:
NAMESTATUSAGEIP
vm1Running7m192.168.2.72
Ver informações da VM
Se você quiser ver informações sobre uma VM específica no cluster, use
kubectl. Essa opção é útil para visualizar outras informações de configuração para uma VM, como armazenamento ou rede.
Veja informações detalhadas sobre uma VM usando kubectl describe gvm:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-01 UTC."],[],[],null,["This document is intended for application owners that run Google Distributed Cloud.\nThis document shows you how to list VMs that run on Google Distributed Cloud using\nVM Runtime on GDC. You can also view additional information for each\nVM.\n\nBefore you begin\n\nTo complete this document, you need access to the following resources:\n\n- A VM that runs in one of your clusters. If needed, [create a VM in Google Distributed Cloud](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/quickstart).\n- The `virtctl` client tool installed as a plugin for `kubectl`. If needed, [install the virtctl client tool](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/quickstart#install_the_virtctl_client_tool).\n\nList VMs\n\nYou can list VMs and their status across all namespaces, or only VMs in a\nspecific namespace.\n\nAll namespaces\n\nTo view a list of VMs in your cluster, use the `kubectl` command.\n\n- View a list of all VMs using `kubectl get gvm`:\n\n kubectl get gvm --all-namespaces\n\n The following example output shows the VM information: \n\n NAME STATUS AGE IP\n vm1 Running 7m 192.168.2.72\n vm2 Running 4m 192.168.2.73\n\nSingle namespace\n\nTo view a list of VMs in a specific namespace, use the `--namespace` parameter\nwith the `kubectl` command.\n\n- View a list of VMs in a namespace using `kubectl get gvm`:\n\n kubectl get gvm --namespace \u003cvar label=\"namespace_name\" translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e with the namespace you want to\n view.\n\n The following example output shows the VM information: \n\n NAME STATUS AGE IP\n vm1 Running 7m 192.168.2.72\n\nView VM information\n\nIf you want to view information about a specific VM in your cluster, use\n`kubectl`. This option is useful to view additional configuration information\nfor a VM, such as storage or networking.\n\n- View detailed information about a VM using `kubectl describe gvm`:\n\n kubectl describe gvm \u003cvar label=\"vm_name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e --namespace \u003cvar label=\"namespace_name\" translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e\n\n Replace the following values:\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of your VM.\n - \u003cvar translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e: the namespace for your VM.\n\n The following example output snippet shows the detailed information for the VM\n that you specify: \n\n Name: vm1\n Namespace: default\n Labels: \u003cnone\u003e\n Annotations: \u003cnone\u003e\n API Version: vm.cluster.gke.io/v1\n Kind: VirtualMachine\n Metadata:\n Creation Timestamp: 2022-04-25T23:36:24Z\n Finalizers:\n vm.cluster.gke.io/vm-finalizer\n Generation: 1\n Managed Fields:\n API Version: vm.cluster.gke.io/v1\n Fields Type: FieldsV1\n fieldsV1:\n ...\n Spec:\n Compute:\n Interfaces:\n Name: eth0\n Network Name: pod-network\n Virt Spec:\n Template:\n Metadata:\n Creation Timestamp: \u003cnil\u003e\n Labels:\n kubevirt.io/vm: vm1\n Spec:\n Domain:\n Cpu:\n Cores: 2\n Devices:\n Disks:\n Boot Order: 1\n Disk:\n Bus: virtio\n Name: vm1-boot-dv\n Resources:\n Requests:\n Memory: 4Gi\n Volumes:\n Data Volume:\n Name: vm1-boot-dv\n Name: vm1-boot-dv\n Status:\n ...\n Interfaces:\n Dns Config:\n Nameservers:\n 172.26.232.10\n Ip Addresses:\n 192.168.4.118\n Mac Address: f8:8f:ca:00:00:01\n Name: eth0\n Resource Name: vm1-eth0-f8b63\n Routes:\n To: 192.168.0.0/16\n To: 172.26.232.0/24\n State: Running\n Events: \u003cnone\u003e\n\nWhat's next\n\n- [Manage the power state of VMs in Google Distributed Cloud](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/manage-power-state).\n- [Edit a VM in Google Distributed Cloud in Google Distributed Cloud](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/edit-vm)."]]