Recreate a Server
Description
Use this request to recreate an existing server with the possibility of using a different OS template. This request essentially deletes an existing server and then creates a new server, keeping the original server specifications. Instead of using two separate operations to delete a server and create a new one, use this single request to do both.
The new server will have the same resources (CPU, RAM, bandwidth, disk size, and storage type) as the previous one. The new server will also have the same IP addresses, which is not guaranteed when deleting and creating a server in two separate steps. The new server will also have the same auto scale and firewall rules and backup schedule if they were configured for the original server. If the original server was attached to a load balancer, the new one will be attached as well.
Syntax
POST baseURL/ve/{ve-name}/recreate[?template={new-template-name}][?drop-apps={true|false}]
The optional template
parameter is used to specify an OS template. If the parameter is not specified, the server will be recreated using the same OS template as the original. To obtain the list of the available templates, use the GET /template API call.
The optional drop-apps
parameter is used to specify whether to reinstall the applications in the new server. If the parameter is specified and set to 'true', the applications installed in the original server will not be installed in the new server. The default value of this parameter is 'false', which means that all applications that are installed in the original server will be installed in the new one.
Request Parameters
None
Response
Element |
Attribute |
Description |
---|---|---|
|
|
Container for response data. |
|
|
Contains the internal ID of the new server. |
|
|
Contains the root/admin password. |
Notes
If the original server is running, it will be stopped. The new server state will be CREATED.
The internal server ID will be different from the original, but the history of the new server will include events from the original server, including all previous server versions if it was recreated more than once. The usage report for the new server will be reset.
The original server ID can be obtained from the optional <previous-id>
element of the <ve>
structure. This element is only included for a server that was recreated in the past. For all other servers, the element is hidden.