Managing virtual server instances
Manage your IBM Cloud® Virtual Servers for Virtual Private Cloud instances by performing tasks such as start, stop, restart, and delete virtual server instances.
If you don't know the name or ID of the virtual server instance that you want to manage, run ibmcloud is instances
to list virtual server instances in your account.
Managing virtual server instances in the console
You can view and manage your IBM Cloud® Virtual Servers for Virtual Private Cloud instances from the Virtual server instances page in IBM Cloud console.
To manage your instances, complete the following steps.
- In IBM Cloud console, navigate to Navigation Menu icon > VPC Infrastructure > Compute > Virtual server instances.
- On the Virtual server instances page, click the Actions icon for the instance that you want to manage. You can select from the following actions:
Action | Description |
---|---|
Rename | Change the name of the instance. |
Stop | Stop the instance. |
Start | Start an instance that is stopped. This action is not available if the instance status is Running. |
Reboot | Immediately powers off a running instance and then powers it back on again. |
Resize | Vertically scale virtual server instances to any supported profile size. For more information, see Resizing a virtual server instance. |
Delete | To delete an instance, the instance must have a powered off status. If the instance has a floating IP address, it must be unassociated or released before the instance is deleted. The delete action permanently removes an instance and its connected vNIC, and data from your account. If auto-delete is enabled, the associated boot volume is also deleted. |
Host failure auto restart | Toggles the host failure restart policy for an instance on or off. For more information, see Host failure recovery policies. |
Rename a virtual server instance in the console
From the Virtual server instances page in IBM Cloud console, click Rename. Enter the new name for the virtual server instance. Click Rename.
Rename a virtual server instance from the CLI
You can rename a virtual server instance in your IBM Cloud VPC by using the command-line interface (CLI).
To rename a virtual server instance, use the ibmcloud is instance-update INSTANCE
command. Specify the new name of the instance with the --name NEW_NAME
option.
The following example renames a virtual server with the name of my-instance-name
to my-instance-name-new
.
ibmcloud is instance-update my-instance-name --name my-instance-name-new
For a full list of command options, see ibmcloud is instance-update.
Rename a virtual server instance with the API
You can rename the virtual server instance in your IBM Cloud VPC by using the API.
The following example renames a virtual server instance from name
to my-instance
.
curl -X PATCH "$vpc_api_endpoint/v1/instances/$instance_id?version=2021-06-29&generation=2" -H "Authorization: $iam_token" -d '{"name": "my-instance"}'
Stop and start a virtual server instance in the console
The stop action shuts down the guest operating system and then the virtual server instance is deprovisioned. This change releases the instance resources that were being consumed. The virtual server instance goes into the Stop state. If the instance is stopped, the instance remains in the stopped state and must be started manually. Billing is suspended for some compute resources while the instance is stopped. You cannot interact with an instance if it is stopped, but volumes remain provisioned. If the instance is started, normal interaction and billing continue.
A Force stop action triggers a power cycle reset of the virtual server instance.
The start action starts a virtual server instance that is in a stopped state.
From the Virtual server instances page in IBM Cloud console, click Stop or Start.
For z/OS virtual server instances only. You must shut down all the subsystems in the z/OS system to halt the virtual server instance. For more information, see Shutting down z/OS virtual server instances.
Stop a virtual server instance from the CLI
You can stop the virtual server instance in your IBM Cloud VPC by using the command-line interface (CLI).
To stop the virtual server instance, use the ibmcloud is instance-stop
command. Specify the ID or name of the virtual server instance that you want to stop with the INSTANCE
variable.
ibmcloud is instance-stop INSTANCE
The stop action shuts down the guest operating system and then the virtual server instance is deprovisioned. This change releases the instance resources that were being consumed. The virtual server instance goes into the Stop state. If the instance is stopped, the instance remains in the stopped state and must be started manually. Billing is suspended for some compute resources while the instance is stopped. You cannot interact with an instance if it is stopped, but volumes remain provisioned. If the instance is started, normal interaction and billing continue.
The following example stops an instance without requesting confirmation. The virtual server instance has an ID of 0777_e7af506a-35d4-451d-aa9e-59330e62b77e
. The --force
option indicates that the request for confirmation
is skipped.
ibmcloud is instance-stop 0777_e7af506a-35d4-451d-aa9e-59330e62b77e --force
A Force stop action triggers a power cycle reset of the virtual server instance.
If you have an instance that gets stuck in a stopping state, you can use the following example command with the --force
and --no-wait
options that are specified to stop the instance immediately without confirmation.
The instance has an ID of 0757_5446c277-3190-48dd-ac67-5f02fab39ed5
. The --force
option indicates that the request for confirmation is skipped. The --no-wait
option runs the command immediately, dropping
any queued actions.
ibmcloud is instance-stop 0757_5446c277-3190-48dd-ac67-5f02fab39ed5 --force --no-wait
For a full list of command options, see ibmcloud is instance-stop.
Start a virtual server instance from the CLI
You can start a virtual server instance that is stopped in your IBM Cloud VPC by using the command-line interface (CLI).
To start the virtual server instance, use the ibmcloud is instance-start
command. Specify the ID or name of the virtual server instance that you want to start by using the INSTANCE
variable.
ibmcloud is instance-start INSTANCE
For a full list of command options, see ibmcloud is instance-start on the VPC CLI reference page.
Stop a virtual server instance with the API
You can stop the virtual server instance in your IBM Cloud VPC by using the API.
The following example stops a virtual server instance with an instance ID of d6c3902d-1ecf-3a2c-b7ab-eb9143581000
.
curl -X POST "https://us-south.iaas.cloud.ibm.com/v1/instances/d6c3902d-1ecf-3a2c-b7ab-eb9143581000/actions?version=2021-06-22&generation=2" -H "Authorization: $iam_token" -d '{"type": "stop"}'
The stop action shuts down the guest operating system and then the virtual server instance is deprovisioned. This change releases the instance resources that were being consumed. The virtual server instance goes into the Stop state. If the instance is stopped, the instance remains in the stopped state and must be started manually. Billing is suspended for some compute resources while the instance is stopped. You cannot interact with an instance if it is stopped, but volumes remain provisioned. If the instance is started, normal interaction and billing continue.
A Force stop action triggers a power cycle reset of the virtual server instance.
For more information, see the Create an instance action in the VPC API.
Start a virtual server instance with the API
You can start a virtual server instance that is stopped in your IBM Cloud VPC by using the API.
The following example stops a virtual server instance with an instance ID of d6c3902d-1ecf-3a2c-b7ab-eb9143581000
.
curl -X POST "https://us-south.iaas.cloud.ibm.com/v1/instances/d6c3902d-1ecf-3a2c-b7ab-eb9143581000/actions?version=2021-06-22&generation=2" -H "Authorization: $iam_token" -d '{"type": "start"}'
The stop and start action remotely turns an instance off or on. If the instance is stopped, the instance remains in the stopped state and must be started manually. Billing is suspended for some compute resources while the instance is stopped. You cannot interact with an instance if it is stopped. If the instance is started, normal interaction and billing continue.
For more information, see the Create an instance action in the VPC API.
Reboot a virtual server instance in the console
The reboot action triggers a guest operating system reboot. The virtual server instance remains in a running state while the guest operating system is rebooting. Billing continues.
A Force reboot action triggers a power cycle reset of the virtual server instance.
From the Virtual server instances page in IBM Cloud console, click Reboot.
Reboot a virtual server instance from the CLI
The reboot action triggers a guest operating system reboot. The virtual server instance remains in a running state while the guest operating system is rebooting. Billing continues.
A Force reboot action, by using the --force
option, triggers a power cycle reset of the virtual server instance.
You can reboot the virtual server instance in your IBM Cloud VPC by using the command-line interface (CLI).
To reboot the virtual server instance, use the ibmcloud is instance-reboot
command. Specify the ID or name of the virtual server instance that you want to reboot by using the INSTANCE
variable.
ibmcloud is instance-reboot INSTANCE
For a full list of command options, see ibmcloud is instance-reboot.
Reboot a virtual server instance with the API
You can reboot the virtual server instance in your IBM Cloud VPC by using the API. The following example reboots the specified virtual server.
curl -X POST "https://us-south.iaas.cloud.ibm.com/v1/instances/d6c3902d-1ecf-3a2c-b7ab-eb9143581000/actions?version=2021-06-22&generation=2" -H "Authorization: $iam_token" -d '{"type": "reboot"}'
The reboot action triggers a guest operating system reboot. The virtual server instance remains in a running state while the guest operating system is rebooting. Billing continues.
A Force reboot action triggers a power cycle reset of the virtual server instance.
For more information, see the Create an instance action in the VPC API.
Resize a virtual server instance in the console
You can increase or decrease the amount of vCPU and RAM available for greater flexibility in workload management to address resource requirement changes, optimize cost or workload performance. After resizing an instance is complete, you are billed the hourly rate of the new instance profile selected.
For the steps to resize a virtual server instance in the console, see Resizing a virtual server instance by using the UI.
Resize a virtual server instance from the CLI
You can increase or decrease the amount of vCPU and RAM available for greater flexibility in workload management to address resource requirement changes, optimize cost or workload performance. After resizing an instance is complete, you are billed the hourly rate of the new instance profile selected.
For the steps to resize a virtual server instance, see Resizing a virtual server instance by using the CLI.
Resize a virtual server instance with the API
You can increase or decrease the amount of vCPU and RAM available for greater flexibility in workload management to address resource requirement changes, optimize cost or workload performance. After resizing an instance is complete, you are billed the hourly rate of the new instance profile selected.
For the steps to resize a virtual server instance, see Resizing a virtual server instance by using the API.
Delete a virtual server instance in the console
You can delete the virtual server instance in your IBM Cloud VPC in the console.
If the instance has a floating IP address, it must be unassociated or released before the instance is deleted. The account that is associated with the floating IP continues to be charged if it is not released.
From the Virtual server instances page in IBM Cloud console, click Delete.
The delete action permanently removes an instance, its connected vNIC, and data from your account. The instance boot volume is also deleted if the volume auto-delete setting is configured to delete when the attached instance is deleted. If an existing boot volume is attached as part of provisioning a virtual server instance, the volume is preserved by default when the instance is deleted. If a boot volume was created as part of provisioning a virtual server instance, the volume is deleted by default when the instance is deleted. After you confirm the delete action, the process to delete the instance and its associated vNIC, boot volume, and data begins. The delete action can take up to 30 minutes, but when the process is complete, the instance no longer appears on the virtual server instances page.
Delete a virtual server instance from the CLI
You can delete the virtual server instance in your IBM Cloud VPC by using the command-line interface (CLI).
If the instance has a floating IP address, it must be unassociated or released before the instance is deleted. The account that is associated with the floating IP continues to be charged if it is not released.
To delete the virtual server instance, use the ibmcloud is instance-delete
command. Specify the ID or name of the virtual server instance that you want to delete by using the INSTANCE
variable.
ibmcloud is instance-delete INSTANCE
For a full list of command options, see ibmcloud is instance-delete.
The delete action permanently removes an instance, its connected vNIC, and data from your account. The instance boot volume is also deleted if the volume auto-delete setting is configured to delete when the attached instance is deleted. If an existing boot volume is attached as part of provisioning a virtual server instance, the volume is preserved by default when the instance is deleted. If a boot volume was created as part of provisioning a virtual server instance, the volume is deleted by default when the instance is deleted. After you confirm the delete action, the process to delete the instance and its associated vNIC, boot volume, and data begins. The delete action can take up to 30 minutes, but when the process is complete, the instance no longer appears on the virtual server instances page.
Delete a virtual server instance with the API
You can delete the virtual server instance in your IBM Cloud VPC by using the API.
If the instance has a floating IP address, it must be unassociated or released before the instance is deleted. The account that is associated with the floating IP continues to be charged if it is not released.
The following example deletes an instance.
curl -X DELETE "$vpc_api_endpoint/v1/instances/$instance_id?version=2021-06-22&generation=2" -H "Authorization: $iam_token"
The delete action permanently removes an instance, its connected vNIC, and data from your account. The instance boot volume is also deleted if the volume auto-delete setting is configured to delete when the attached instance is deleted. If an existing boot volume is attached as part of provisioning a virtual server instance, the volume is preserved by default when the instance is deleted. If a boot volume was created as part of provisioning a virtual server instance, the volume deletes by default when the instance is deleted. After you confirm the delete action, the process to delete the instance and its associated vNIC, boot volume, and data begins. The delete action can take up to 30 minutes, but when the process is complete, the instance no longer appears on the virtual server instances page.
For more information, see the Delete an instance in the VPC API.
Toggle the auto-deletion of boot volumes that are attached to an instance in the console
By default, a boot volume that was created as part of provisioning a virtual server instance is deleted when the instance is deleted. If an existing boot volume is attached as part of provisioning a virtual server instance, the volume is preserved by default when the instance is deleted. You can control this deletion by setting the auto-delete option on the Edit boot volume panel when you create an instance. For more information, see Creating virtual server instances.
Toggle the auto-deletion of boot volumes that are attached to an instance from the CLI
By default, a boot volume that was created as part of provisioning a virtual server instance is preserved when the instance is deleted. You can control this deletion by specifying the auto_delete
property when you create the instance
or update the boot volume attachment. For more information, see Creating virtual server instances.
Toggle the auto-deletion of boot volumes that are attached to an instance with the API
By default, a boot volume that was created as part of provisioning a virtual server instance is preserved when the instance is deleted. You can control this deletion by specifying the delete_volume_on_instance_delete
property when
you create the instance or update the boot volume attachment. For more information, see Creating virtual server instances
Viewing instance details in the console
You can view a summary of all instances on the Virtual server instances page. You can access the details page for an instance by clicking an individual instance name to view details and make changes. From the instance details page, you can also view the associated network interface, access its subnet, toggle the auto-delete setting, and reserve or release a floating IP address.
Viewing instance details from the CLI
You can view the virtual server instance details in your IBM Cloud VPC by using the command-line interface (CLI).
To view the virtual server instance details, use the ibmcloud is instance
command. Specify the ID or name of the virtual server instance that you want to view by using the INSTANCE
variable.
ibmcloud is instance INSTANCE
Viewing instance details with the API
You can view the virtual server instance details in your IBM Cloud VPC by using the API.
The following example displays the virtual server instance details for instance profile with a profile name of version=2021-06-22&generation=2
.
curl -X GET "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/$profile_name?version=2021-06-22&generation=2" -H "Authorization: $iam_token"
For more information, see the Retrieve an instance profile in the VPC API.
Adjusting instance bandwidth allocation in the console
You can adjust the allocation of your instance's total bandwidth between network bandwidth and storage bandwidth in the UI.
To adjust the bandwidth of an instance:
- Go to a virtual service instance.
- Select Bandwidth allocation.
- On the Edit bandwidth allocation screen, adjust the value for Storage bandwidth. You can increase the bandwidth that is allocated for your Block Storage boot and attached data volumes. For more information about how storage bandwidth is allocated, see Bandwidth allocation for Block Storage volumes. After you set storage bandwidth, network bandwidth is automatically adjusted so the total bandwidth of the instance equals the displayed Total bandwidth value. The value for Network bandwidth or Storage bandwidth cannot be set to less than 500 Mbps.
To view the new bandwidth allocation, you must either stop and start the instance, or detach and reattach secondary volumes.
Adjusting instance bandwidth allocation from the CLI
You can adjust the allocation of your instance's total bandwidth between network bandwidth and storage bandwidth by using the CLI.
To reallocate instance bandwidth, run the instance-update
command and specify the total storage bandwidth in megabits per second (Mbps) for the total-volume-bandwidth
parameter. Use the following syntax. Use the ID
or name of the instance for INSTANCE.
ibmcloud is instance-update INSTANCE --total-volume-bandwidth VALUE
Total storage bandwidth (in megabits per second) is the total bandwidth that is allocated for the boot and attached data volumes. Increasing total storage bandwidth results in a corresponding decrease in network bandwidth. The minimum network bandwidth that you can have is 500 Mbps, so adjust the total storage bandwidth accordingly.
To see the new bandwidth allocation, you must either stop and start the instance, or detach and reattach data volumes.
Adjusting instance bandwidth allocation with the API
You can adjust the total storage bandwidth for an existing instance with the API. Make a PATCH /instances
request and specify a new value for total_volume_ bandwidth
. Total storage bandwidth (in megabits per second)
is the total bandwidth that is allocated for primary boot and secondary attached data volumes. Increasing total storage bandwidth results in a corresponding decrease in network bandwidth. The minimum network bandwidth that you can have is
500 Mbps, so adjust the total storage bandwidth accordingly. For example,
curl -X PATCH "$vpc_api_endpoint/v1/instances/$instance_id?version=2021-06-22&generation=2" \
-H "Authorization: $iam_token" \
-d '{
"total_volume_bandwidth": 500
}'
To see the new bandwidth allocation, you must either stop and start the instance, or detach and reattach data volumes. Bandwidth allocation for individual volumes is updated when you add a data volume by using the POST / volume_attachments
method or delete a volume by using the DELETE volume_attachments
method.
Retrieving the virtual server instance identifier
When a virtual server instance is created, that instance is automatically assigned an instance identifier (ID), which includes the SMBIOS system-uuid as a portion of the ID. The ID can be up to 64 bytes and consists of digits, lowercase letters, underscores, and dashes.
IDs are immutable, globally unique, and never reused, so the ID uniquely identifies a particular instantiation of a virtual server instance across all of IBM Cloud. The ID, including the SMBIOS system-uuid portion, is static and persists for the lifecycle of the virtual server instance until that virtual server instance is deleted.
From within your virtual server, you can retrieve the instance identifier in one of the following ways:
Linux
dmidecode -s system-family
Windows
Get-WmiObject Win32_ComputerSystem | Select-Object -ExpandProperty SystemFamily
From within your virtual server, you can retrieve the SMBIOS system-uuid in one of the following ways:
Linux
dmidecode -s system-uuid
Windows
Get-WmiObject Win32_ComputerSystemProduct | Select-Object -ExpandProperty UUID
For z/OS virtual server instances, you can SSH into the instance, and then run the DISPLAY IPLINFO
command. When the IEE254I message is displayed, the ID is included in the VM EXT NAME
.
Viewing instance status and lifecycle_state in the API
status
- This property provides the status of the virtual server instance through the Retrieve an instance request. The values that
status
returns are specialized for virtual server instances and indicate if it is running, stopped, or transitioning. For more information, see the Virtual Private Cloud API.
- This property provides the status of the virtual server instance through the Retrieve an instance request. The values that
lifecycle_state
- This property provides the state of a resource through the Retrieve an instance request. The values that
lifecycle_state
provide are generic and are meant to apply to a variety of resources, such as Placement groups.lifecycle_state
can return values that overlap withstatus
.lifecycle_state
also includes values that detail if a resource is suspended.
- This property provides the state of a resource through the Retrieve an instance request. The values that
Setting the host failure auto restart in the console
To set the host failure auto restart for an existing instance, complete the following steps.
- In IBM Cloud console, click Navigation Menu icon > VPC Infrastructure > Compute > Virtual server instances.
- On the Virtual server instances page, click the Actions icon for the instance that you want to manage.
- From the instance details page, locate 'Host failure auto restart'. Click the Edit icon and choose Enabled or Disabled to toggle the status of the host recovery policy on or off.
For more information, see Host failure recovery policies.
Setting the host failure recovery policy from the CLI
You can update an instance in your IBM Cloud VPC with and change the availability policy on host failure by using the command-line interface (CLI). Run the ibmcloud instance-update
command and set the --host-failure-policy
property to start
or stop
. The host failure policy service is set to restart
by default. Here, INSTANCE can be the ID or Name of the Instance.
ibmcloud is instance-update INSTANCE --total-volume-bandwidth VALUE --host-failure-policy stop
Setting the host failure recovery policy with the API
During instance update, the host_failure
subproperty can be used to set the host failure availability_policy
of the virtual server instance.
Detaching a server from a reservation in the console
You can detach a virtual server from a reservation in the console.
- In the IBM Cloud console, click Navigation Menu icon > VPC Infrastructure > Compute > Reservations.
- From your virtual server list or in the Reservation details page, click the server that you want to detach and then click Actions > Detach.
- To confirm, click Detach.