このドキュメントは、Google Distributed Cloud を実行するアプリケーション オーナーを対象としています。このドキュメントでは、GDC 上の VM ランタイムを使用して Google Distributed Cloud で実行される VM を一覧取得する方法について説明します。各 VM に関する追加情報を表示することもできます。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 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)."]]