Contrary to what some users of cloud server think, it is not necessary to delete a server and create a new one when you want to change something about it. Some small modifications, like changing server name or server access address can be done without such drastic measures.
If you want to change the server name, you will need to use a PUT request directed at /servers/id, where id is the numeric ID of the server you wish to update. You need to include a JSON payload:
{
"server" : {
"name" : "nginx000"
}
}
If you were to use curl to change the server name, this is how you can do it:
$ curl -X PUT -H "X-Auth-Token:999888777666" -H "Accept: application/json" -d '{"server": {"name": "nginx000"}}' http://localhost:8774/v1.1/openstack/servers/1
The response to this request will be a long JSON string similar to the one you get when you create a new server.
