Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird beschrieben, welche VM-Attribute Sie für eine vorhandene VM aktualisieren können und wie Sie eine solche Aktualisierung vornehmen.
Hinweise
Wenn Sie die Befehlszeilenbefehle (Command-Line Interface, CLI) von gdcloud verwenden möchten, müssen Sie die gdcloud-CLI heruntergeladen, installiert und konfiguriert haben.
Für alle Befehle für Distributed Cloud wird die gdcloud- oder kubectl-CLI verwendet. Außerdem ist eine Betriebssystemumgebung erforderlich.
Pfad der kubeconfig-Datei abrufen
Damit Sie Befehle für den Management API-Server ausführen können, benötigen Sie die folgenden Ressourcen:
Verwenden Sie den Pfad zur kubeconfig-Datei des Management API-Servers, um MANAGEMENT_API_SERVER in dieser Anleitung zu ersetzen.
Berechtigungen und Zugriff anfordern
Zum Ausführen der auf dieser Seite aufgeführten Aufgaben benötigen Sie die Rolle „ProjectVirtualMachine Admin“. Prüfen Sie, ob Sie die Rolle „Project VirtualMachine Admin“ (project-vm-admin) im Namespace des Projekts haben, in dem sich die VM befindet.
Wenn Sie VM-Vorgänge über die GDC-Konsole oder die gdcloud-CLI ausführen möchten, bitten Sie Ihren Projekt-IAM-Administrator, Ihnen die Rolle „Project VirtualMachine Admin“ und die Rolle „Project Viewer“ (project-viewer) zuzuweisen.
Aktualisierbare Attribute
Sie können nur die Eigenschaften ändern, die sich im spec der VM befinden.
Aktualisierbare Attribute ansehen
Suchen Sie mit der GDC Console oder kubectl nach den Properties, die Sie ändern möchten.
Console
Klicken Sie im Navigationsmenü auf Virtuelle Maschinen > Instanzen.
Klicken Sie in der Liste der VMs auf einen VM-Namen, um die zugehörigen Eigenschaften aufzurufen.
Bearbeitbare Eigenschaften haben ein edit-Symbol Bearbeiten.
kubectl
Rufen Sie die Liste der Eigenschaften für die VM spec und die gültigen Werte für jede Eigenschaft auf:
KIND: VirtualMachine
VERSION: virtualmachine.gdc.goog/v1
RESOURCE: spec <Object>
DESCRIPTION:
Defines the specification of the Virtual Machine.
FIELDS:
compute <Object>
Specifies the CPU and Memory of the VM. CPU and Memory can be defined
directly or through the VirtualMachineType. Changes to Compute require a
reboot to take effect. Compute is immutable when the VM is in `Unknown`
state.
disks <[]Object> -required-
Specifies the list of disks attached to this vm. There must be exactly one
boot disk. Changes to disk attachments require a reboot to take effect.
...
Untergeordnete Properties für jede Property rekursiv ansehen. In diesen Beispielen sehen Sie die Rückgabe für die untergeordneten Properties compute und vcpus:
Dieser Beispielbefehl gibt die Felder für die Untereigenschaft compute zurück:
KIND: VirtualMachine
VERSION: virtualmachine.gdc.goog/v1
RESOURCE: compute <Object>
DESCRIPTION:
Specifies the CPU and Memory of the VM. CPU and Memory can be defined
directly or through the VirtualMachineType. Changes to Compute require a
reboot to take effect. Compute is immutable when the VM is in `Unknown`
state.
FIELDS:
memory <>
Specifies the amount of physical memory available to the instance. memory
must have a minimum value of `1G`, and can be up to (including) `400G`.
vcpus <integer>
Specifies the number of VCPUs that are available to the instance. Specify
`vcpus` as an integer. This value must be a multiple of 2, with 2 as the
minimum and 128 as the maximum allowed.
...
Dieser Beispielbefehl gibt die Felder für die Untereigenschaft vcpus zurück:
KIND: VirtualMachine
VERSION: virtualmachine.gdc.goog/v1
FIELD: vcpus <integer>
DESCRIPTION:
Specifies the number of VCPUs that are available to the instance. Specify
`vcpus` as an integer. This value must be a multiple of 2, with 2 as the
minimum and 128 as the maximum allowed.
Alle Eigenschaften können auf einer laufenden VM aktualisiert werden. Oft ist jedoch ein Neustart der VM erforderlich, damit die Änderungen wirksam werden.
Für diese Aktualisierungen der Eigenschaften muss die VM neu gestartet werden, damit die Änderungen wirksam werden:
[[["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-04 (UTC)."],[[["\u003cp\u003eThis guide details how to update specific properties of an existing virtual machine (VM), focusing on changes within the VM's \u003ccode\u003espec\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo make changes, ensure you have the Project VirtualMachine Admin role, access to the \u003ccode\u003egdcloud\u003c/code\u003e or \u003ccode\u003ekubectl\u003c/code\u003e CLI, and the Management API server kubeconfig file.\u003c/p\u003e\n"],["\u003cp\u003eUpdatable properties can be viewed through the GDC console or by using \u003ccode\u003ekubectl\u003c/code\u003e to explore the \u003ccode\u003evirtualmachines.virtualmachine.gdc.goog.spec\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eCertain property updates, such as \u003ccode\u003ecompute\u003c/code\u003e and \u003ccode\u003edisks\u003c/code\u003e, require a VM restart to take effect, while others like \u003ccode\u003eguestEnvironment\u003c/code\u003e and \u003ccode\u003erunningState\u003c/code\u003e are applied immediately.\u003c/p\u003e\n"],["\u003cp\u003eUpdating VM properties involves using either the GDC console's edit features or \u003ccode\u003ekubectl\u003c/code\u003e commands to modify the VM's \u003ccode\u003espec\u003c/code\u003e, and may require a VM restart to fully implement the changes.\u003c/p\u003e\n"]]],[],null,["# Update VM properties\n\nThis page describes which virtual machine (VM) properties you can update for an\nexisting VM and how to perform such an update.\n\nBefore you begin\n----------------\n\nTo use `gdcloud` command-line interface (CLI) commands, ensure that you have downloaded, installed,\nand configured the [`gdcloud` CLI](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-overview).\nAll commands for Distributed Cloud use the `gdcloud` or\n`kubectl` CLI, and require an operating system (OS) environment.\n\n### Get the kubeconfig file path\n\nTo run commands against the Management API server, ensure you have the following\nresources:\n\n1. [Sign in and generate](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/iam/sign-in#cli) the\n kubeconfig file for the Management API server if you don't have one.\n\n2. Use the path to the kubeconfig file of the Management API server to replace\n \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e in these instructions.\n\n### Request permissions and access\n\nTo perform the tasks listed in this page, you must have the Project\nVirtualMachine Admin role. Follow the steps to\n[verify](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/preparation#verify-user-access)\nthat you have the Project VirtualMachine Admin (`project-vm-admin`) role in the namespace\nof the project where the VM resides.\n\nFor VM operations using the GDC console or the gdcloud CLI,\nrequest your Project IAM Admin to assign you both the\nProject VirtualMachine Admin role and the Project Viewer (`project-viewer`)\nrole.\n\nUpdatable properties\n--------------------\n\nYou can only change the properties that are in the `spec` of the VM.\n\n### View updatable properties\n\nFind properties you want to change by using the GDC console or\n`kubectl`. \n\n### Console\n\n1. In the navigation menu, click **Virtual Machines \\\u003e Instances**.\n\n2. In the list of VMs, click a VM name to view its properties.\n\n3. Editable properties have an *edit* **Edit** icon.\n\n### kubectl\n\n1. View the list of properties for the VM `spec` and the valid values\n corresponding to each property:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e explain virtualmachines.virtualmachine.gdc.goog.spec\n\n The output is similar to the following: \n\n KIND: VirtualMachine\n VERSION: virtualmachine.gdc.goog/v1\n\n RESOURCE: spec \u003cObject\u003e\n\n DESCRIPTION:\n Defines the specification of the Virtual Machine.\n\n FIELDS:\n compute \u003cObject\u003e\n Specifies the CPU and Memory of the VM. CPU and Memory can be defined\n directly or through the VirtualMachineType. Changes to Compute require a\n reboot to take effect. Compute is immutable when the VM is in `Unknown`\n state.\n\n disks \u003c[]Object\u003e -required-\n Specifies the list of disks attached to this vm. There must be exactly one\n boot disk. Changes to disk attachments require a reboot to take effect.\n\n ...\n\n2. Recursively view the sub-properties for each property. These examples show\n the return for the `compute` and the `vcpus` sub-properties:\n\n - This example command returns the fields for the `compute` sub-property:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e explain virtualmachines.virtualmachine.gdc.goog.spec.compute\n\n The output is similar to the following: \n\n KIND: VirtualMachine\n VERSION: virtualmachine.gdc.goog/v1\n\n RESOURCE: compute \u003cObject\u003e\n\n DESCRIPTION:\n Specifies the CPU and Memory of the VM. CPU and Memory can be defined\n directly or through the VirtualMachineType. Changes to Compute require a\n reboot to take effect. Compute is immutable when the VM is in `Unknown`\n state.\n\n FIELDS:\n memory \u003c\u003e\n Specifies the amount of physical memory available to the instance. memory\n must have a minimum value of `1G`, and can be up to (including) `400G`.\n\n vcpus \u003cinteger\u003e\n Specifies the number of VCPUs that are available to the instance. Specify\n `vcpus` as an integer. This value must be a multiple of 2, with 2 as the\n minimum and 128 as the maximum allowed.\n\n ...\n\n - This example command returns the fields for the `vcpus` sub-property:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e explain virtualmachines.virtualmachine.gdc.goog.spec.compute.vcpus\n\n The output is similar to the following: \n\n KIND: VirtualMachine\n VERSION: virtualmachine.gdc.goog/v1\n\n FIELD: vcpus \u003cinteger\u003e\n\n DESCRIPTION:\n Specifies the number of VCPUs that are available to the instance. Specify\n `vcpus` as an integer. This value must be a multiple of 2, with 2 as the\n minimum and 128 as the maximum allowed.\n\nAll of the properties can be updated on a running VM, but often require the VM to be restarted to take\neffect.\n\nThese property updates require that the VM be restarted for the changes to\ntake effect:\n\n- compute\n- disks\n- firmware\n- [startupScripts](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-the-os/startup-script-vm-instance)\n\nThese property updates take effect immediately:\n\n- guestEnvironment\n- runningState\n\nUpdate VM properties\n--------------------\n\nUpdate VM properties by using the GDC console or `kubectl`. \n\n### Console\n\n1. In the navigation menu, click **Virtual Machines \\\u003e Instances**.\n\n2. In the list of VMs, click a VM name to view its properties.\n\n3. Click *edit* **Edit** next to the property that\n you want to edit and make your changes.\n\n4. If you want to replace the boot disk or add a new disk, see\n [Replace a boot disk](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vm-boot-disks/replace-a-boot-disk)\n or [Add a disk to a VM](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-storage/add-a-vm-disk).\n\n5. Click **Save**.\n\n### kubectl\n\n1. Run the following command:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e \\\n edit virtualmachines.virtualmachine.gdc.goog \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e \\\n -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\n\n Replace the variables as defined in the following table.\n\n2. Edit the `spec` to update the required fields and values for the updatable\n properties.\n\n3. Save the file.\n\n4. If the property update requires the VM to be restarted,\n use the [Restart a VM](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vms/operations-and-lifecycle/start-and-stop-vm#restart-a-vm)\n instructions to restart the VM."]]