Updating a VM
After you create a VM, you can edit its name, description, tags, platform, or metadata.
For information about editing a VM configuration, see Changing VM computing resources.
To update a VM:
- In the management console
, select the folder the VM belongs to. - Select Compute Cloud.
- Click the name of the desired VM.
- Click Edit VM.
- Edit the VM parameters. Rename the machine, for example, by editing the Name field.
- Click Save changes.
If you don't have the Nebius Israel command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View a description of the CLI command for updating VM parameters:
yc compute instance update --help
-
Get a list of VMs in the default folder:
yc compute instance list
Result:
+----------------------+-----------------+---------------+---------+----------------------+ | ID | NAME | ZONE ID | STATUS | DESCRIPTION | +----------------------+-----------------+---------------+---------+----------------------+ | fhm0b28lgfp4tkoa3jl6 | first-instance | il1-a | RUNNING | my first vm via CLI | | fhm9gk85nj7gcoji2f8s | second-instance | il1-a | RUNNING | my second vm via CLI | +----------------------+-----------------+---------------+---------+----------------------+
-
Select the VM
ID
orNAME
(for example,first-instance
). -
Change the VM parameters. For example, rename it:
yc compute instance update first-instance \ --new-name windows-vm
To update a VM, use the update REST API method for the Instance resource or the InstanceService/Update gRPC API call.
Note
Changing the VM name does not change the host name or the FQDN. For more information about generating FQDN names, see Host name and internal FQDN.
Examples
Viewing a list of configurable parameters
To view the list of configurable parameters, run the command:
yc compute instance update --help
Changing the name and description
To update a VM name or description, perform the following steps:
If you don't have the Nebius Israel command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
Get a list of VMs in the default folder:
yc compute instance list
Result:
+----------------------+-----------------+---------------+---------+----------------------+ | ID | NAME | ZONE ID | STATUS | DESCRIPTION | +----------------------+-----------------+---------------+---------+----------------------+ | fhm0b28lgfp4tkoa3jl6 | first-instance | il1-a | RUNNING | my first vm via CLI | | fhm9gk85nj7gcoji2f8s | second-instance | il1-a | RUNNING | my second vm via CLI | +----------------------+-----------------+---------------+---------+----------------------+
-
Select the VM
ID
orNAME
(for example,first-instance
). -
Update the VM name and description:
yc compute instance update first-instance \ --new-name first-vm \ --description "changed description vm via CLI"
Use the update REST API method for the Instance resource or the InstanceService/Update gRPC API call.
Alert
Do not update the VM name if the VM belongs to a Managed Service for Kubernetes cluster node group. The names of these VMs are generated automatically, and updating them will disrupt cluster operations.
Changing metadata
Metadata based on different operating systems may differ. When you change an existing set of metadata, it is completely replaced by the set passed in the command.
To update VM metadata, perform the following steps:
If you don't have the Nebius Israel command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
Get a list of VMs in the default folder:
yc compute instance list
Result:
+----------------------+-----------------+---------------+---------+----------------------+ | ID | NAME | ZONE ID | STATUS | DESCRIPTION | +----------------------+-----------------+---------------+---------+----------------------+ | fhm0b28lgfp4tkoa3jl6 | first-instance | il1-a | RUNNING | my first vm via CLI | | fhm9gk85nj7gcoji2f8s | second-instance | il1-a | RUNNING | my second vm via CLI | +----------------------+-----------------+---------------+---------+----------------------+
-
Select the VM
ID
orNAME
(for example,first-instance
). -
Retrieve VM information with its metadata. All user-defined metadata is specified in the
user-data
key.yc compute instance get --full first-instance
-
Update the VM metadata. You can change the metadata using the flags:
--metadata
: To change a value from a single string.--metadata-from-file
: To change a value from multiple strings.
Example administrator password update on a Windows-based VM:
-
Create a YAML file (for example,
metadata.yaml
) and specify the following:#ps1 net user administrator '<password>'
-
Run this command:
yc compute instance update first-instance \ --metadata-from-file user-data=metadata.yaml
The existing metadata set will be completely overwritten.