How can I rename an instance or server in OpenStack?. Once you create an instance in OpenStack, you can modify its name in running state. This is true if the service running in the VM is changed, and the name needs to be updated to reflect the same.

Modifying an Instance/VM name in OpenStack can be done from the CLI or Horizon dashboard.

Change / Rename Instance in OpenStack CLI

Get the current instance name:

$ openstack server list
+--------------------------------------+-------------------+---------+-----------------------------------+-----------+-----------+
| ID                                   | Name              | Status  | Networks                          | Image     | Flavor    |
+--------------------------------------+-------------------+---------+-----------------------------------+-----------+-----------+
| d3ae9771-3a95-466d-a1ef-656ee2bb8456 | fed30             | ACTIVE  | private=10.10.1.191               | Fedora-31 | m1.small  |
+--------------------------------------+-------------------+---------+-----------------------------------+-----------+-----------+

Set the new instance name:

$ openstack server set --name fed31  d3ae9771-3a95-466d-a1ef-656ee2bb8456

Confirm that the new name is set:

$ openstack server list
+--------------------------------------+-------------------+---------+-----------------------------------+-----------+-----------+
| ID                                   | Name              | Status  | Networks                          | Image     | Flavor    |
+--------------------------------------+-------------------+---------+-----------------------------------+-----------+-----------+
| d3ae9771-3a95-466d-a1ef-656ee2bb8456 | fed31             | ACTIVE  | private=10.10.1.191               | Fedora-31 | m1.small  |
+--------------------------------------+-------------------+---------+-----------------------------------+-----------+-----------+

Change / Rename Instance in OpenStack Dashboard

Login to Horizon Dashboard

Then navigate to Project > Compute > Instances. Then select the instance to be renamed.

Under Actions, select “EDIT INSTANCE”

Set new name and click save.

You have successfully changed an instance/VM/Server name in OpenStack. Check other OpenStack articles available in our blog.

How To Create OpenStack Instance With a Fixed / Static IP Address

How To Create OpenStack projects, users and roles

How To Migrate OpenStack Instance from one Compute Host to Another

How To Resize OpenStack Instance / Virtual Machine

How To Configure OpenStack Instances / VMs to Autostart after Nova compute reboot