VM-Informationen mit VM Runtime on GDC auflisten und ansehen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Dieses Dokument richtet sich an Anwendungsinhaber, die Google Distributed Cloud ausführen.
In diesem Dokument erfahren Sie, wie Sie VMs auflisten, die in der Google Distributed Cloud mit VM Runtime on GDC ausgeführt werden. Sie können auch zusätzliche Informationen zu jeder VM aufrufen.
Vorbereitung
Um dieses Dokument abzuschließen, benötigen Sie Zugriff auf die folgenden Ressourcen:
Verwenden Sie den Parameter --namespace mit dem Befehl kubectl, um eine Liste der VMs in einem bestimmten Namespace aufzurufen.
Rufen Sie mit kubectl get gvm eine Liste der VMs in einem Namespace auf:
kubectlgetgvm--namespaceNAMESPACE_NAME
Ersetzen Sie NAMESPACE_NAME durch den Namespace, den Sie ansehen möchten.
Die folgende Beispielausgabe zeigt die VM-Informationen:
NAMESTATUSAGEIP
vm1Running7m192.168.2.72
VM-Informationen ansehen
Wenn Sie Informationen zu einer bestimmten VM in Ihrem Cluster aufrufen möchten, verwenden Sie kubectl. Diese Option ist nützlich, um zusätzliche Konfigurationsinformationen für eine VM wie Speicher oder Netzwerke anzuzeigen.
Mit kubectl describe gvm erhalten Sie detaillierte Informationen zu einer VM:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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)."]]