Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Este documento está dirigido a los propietarios de aplicaciones que ejecutan Google Distributed Cloud.
En este documento, se muestra cómo borrar máquinas virtuales (VM) que usan el entorno de ejecución de VMs en GDC. Puedes elegir borrar la VM y los recursos de disco asociados, solo el recurso de VM o solo los recursos de disco.
Antes de comenzar
Para completar este documento, necesitas acceso a los siguientes recursos:
Esta opción borra el recurso de VM y los discos virtuales asociados.
Usa kubectl para borrar la VM y los recursos del disco asociados:
kubectlvirtdeletevmVM_NAME--all
Reemplaza VM_NAME por el nombre de la VM que deseas borrar.
Si deseas verificar los recursos que usa la VM que se borrarán, puedes especificar la marca --dry-run junto con --all.
Si deseas borrar la VM sin borrar el recurso del disco, no incluyas la marca --all, como se muestra en la siguiente sección.
Borra el recurso de VM
Esta opción solo borra el recurso de VM. Cualquier disco virtual asociado permanece como parte del clúster. Esta opción te permite crear otra VM y volver a usar el recurso de disco. El ciclo de vida de la VM se puede administrar de forma independiente del ciclo de vida del recurso de disco.
Usa kubectl para borrar solo la VM:
kubectlvirtdeletevmVM_NAME
Reemplaza VM_NAME por el nombre de la VM que deseas borrar.
Borra el recurso del disco de VM
Esta opción borra un recurso de disco virtual. Si la VM asociada aún se ejecuta en el clúster, el recurso de VM no se borra. Este método te permite borrar un recurso de disco que se conserva si ya borraste una VM sin usar el parámetro --all.
Usa kubectl para borrar solo los recursos de disco de la VM:
kubectlvirtdeletediskDISK_NAME
Reemplaza DISK_NAME por el nombre del disco que deseas borrar. Por ejemplo, el disco de arranque predeterminado para una VM se llama DISK_NAME-boot-dv. Puedes enumerar todos los discos existentes mediante kubectl get datavolume.
Si intentas borrar el disco de una VM antes de borrarla, se marca el disco para su eliminación. El disco solo se borra cuando también borras la VM.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-01 (UTC)"],[],[],null,["This document is intended for application owners that run Google Distributed Cloud.\nThis document shows you how to delete virtual machines (VMs) that use\nVM Runtime on GDC. You can choose to delete both the VM and\nassociated disk resources, only the VM resource, or only the disk resources.\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\nDelete the VM and disk resources\n\nThis option deletes the VM resource and any associated virtual disks.\n\n- Use `kubectl` to delete both the VM and it's associated disk resources:\n\n kubectl virt delete vm \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e --all\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM that you want to\n delete.\n\n If you want to check the resources used by the VM that would be deleted,\n specify the `--dry-run` flag together with `--all`.\n\n If you want to delete the VM without also deleting the disk resource, don't\n include the `--all` flag, as shown in the next section.\n\nDelete the VM resource\n\nThis option only deletes the VM resource. Any associated virtual disks remain\nas part of the cluster. This option lets you create another VM and resuse the\ndisk resource. The lifecycle of the VM can be managed separately to the\nlifecycle of the disk resource.\n\n- Use `kubectl` to delete only the VM:\n\n kubectl virt delete vm \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 delete.\n\nDelete the VM disk resource\n\nThis option deletes a virtual disk resource. If the associated VM still runs in\nthe cluster, the VM resource isn't deleted. This approach lets you delete a disk\nresource that remains if you previously deleted a VM without using the `--all`\nparameter.\n\n- Use `kubectl` to delete only the VM's disk resources:\n\n kubectl virt delete disk \u003cvar label=\"diskname\" translate=\"no\"\u003eDISK_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eDISK_NAME\u003c/var\u003e with the name of the disk that you want\n to delete. For example, the default boot disk for a VM is named\n \u003cvar translate=\"no\"\u003eDISK_NAME\u003c/var\u003e`-boot-dv`. You can list all existing disks using\n `kubectl get datavolume`.\n\n If you try to delete a VM's disk before deleting the VM, the disk\n is marked for deletion. The disk is only deleted when you also delete the VM.\n\nWhat's next\n\n- [Create and manage disks in Google Distributed Cloud](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/create-manage-disks)."]]