Mengelola status daya VM yang menggunakan Runtime VM di GDC
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dokumen ini ditujukan untuk pemilik aplikasi yang menjalankan Google Distributed Cloud.
Dokumen ini menunjukkan cara mengelola status daya virtual machine (VM)
yang menggunakan Runtime VM di GDC.
Anda dapat menghentikan, memulai, dan memulai ulang VM sesuai kebutuhan untuk mendukung siklus proses
aplikasi. Misalnya, Anda mungkin ingin mengubah jumlah vCPU yang ditetapkan atau jumlah memori. Setelah mengedit konfigurasi VM, Anda harus
mengalirkan status daya untuk menerapkan perubahan.
Sebelum memulai
Untuk menyelesaikan dokumen ini, Anda memerlukan akses ke resource berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[],[],null,["This document is intended for application owners that run Google Distributed Cloud.\nThis document shows you how to manage the power state of virtual machines (VMs)\nthat use VM Runtime on GDC.\n\nYou can stop, start, and restart VMs as needed to support the lifecycle of your\napplications. For example, you may want to change the number of assigned vCPUs\nor amount of memory. After you edit the configuration of your VM, you must\ncycle the power state to apply the changes.\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\nStop a VM\n\nWhen you stop a VM, compute resources such as CPU and memory are freed from the\nunderlying host. The VM is shut down.\n\nTo stop a VM that's in a running state, use the following steps.\n\n1. Use `kubectl` to stop a VM:\n\n kubectl virt stop \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM that you want to\n stop.\n2. Check the `STATUS` of your VM:\n\n kubectl get gvm \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n The following example output shows the VM in a `Stopped` state: \n\n NAME STATUS AGE IP\n vm1 Stopped 1m 192.168.2.72\n\nStart a VM\n\nTo start a VM that's in a stopped state, use the following steps.\n\n1. Use `kubectl` to start a VM:\n\n kubectl virt start \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM that you want\n to start.\n2. Check the `STATUS` of your VM:\n\n kubectl get gvm \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n The following example output shows the VM in a `Running` state: \n\n NAME STATUS AGE IP\n vm1 Running 1m 192.168.2.72\n\nRestart a VM\n\nTo restart a VM that's in a running state, use the following steps.\n\n1. Use `kubectl` to restart a VM:\n\n kubectl virt restart \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM that you want to\n restart.\n2. Check the `STATUS` of your VM:\n\n kubectl get gvm \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n The following example output shows the VM in a `Stopping` state: \n\n NAME STATUS AGE IP\n vm1 Stopping 7s 192.168.2.72\n\n3. Check the `STATUS` of your VM again after a minute or two:\n\n kubectl get gvm \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n After the VM has successfully restarted, the following example output shows\n the VM in a `Running` state again: \n\n NAME STATUS AGE IP\n vm1 Running 1m 192.168.2.73\n\n This example VM uses an ephemeral pod IP address, so the address changes\n when the VM restarts.\n\nWhat's next\n\n- [Edit a VM in Google Distributed Cloud](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/edit-vm).\n- When you no longer need VMs, [Delete a VM in Google Distributed Cloud](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/delete)."]]