How to change the resource limits of a DreamCompute instance

To change the resource limits (vCPU/RAM) of a specific instance, you need to change its 'Flavor'. This can be done within the DreamCompute dashboard, or using the OpenStack CLI. Use whichever option you're more comfortable with.

Changing resource limits in the dashboard

    1. Navigate to the DreamCompute page.
    2. Click the 'View Dashboard' button.
    3. In the left menu click 'Compute'.
    4. From the dropdown click 'Instances'.
    5. To the right of your instance, under the "Actions" column, is a Create Snapshot button. Click the little arrow next to it to view the dropdown menu.
    6. From the menu, select "Resize Instance".
    7. In the pop-up, select the New Flavor you want from the dropdown, then click the Resize button.
    8. After a few moments, the instance will report that it is in a Resize/Migrate status and ask you to "Confirm or Revert Resize/Migrate".
    9. You can do this by clicking the Confirm Resize/Migrate button under the 'Actions' column.

You can also cancel the resize by clicking the drop-down arrow and selecting the "Revert Resize/Migrate" action.

After confirming or reverting the resize/migrate, the instance status will switch back to Active.

Changing the resource limit using the OpenStackCLI

To run the commands below, make sure you have installed the OpenStack command line client.

In the following examples, myInstance is the name of your instance. You can view the name of your instance in the DreamCompute dashboard.

  1. First, using the openstack server show SERVER command to show information about an instance. This includes its size, which is shown as the value of the flavor property:
    [user@localhost]$ openstack server show myInstance
    +-----------------------------+--------------------------------------------------------------+
    | Field                       | Value                                                        |
    +-----------------------------+--------------------------------------------------------------+
    | OS-DCF:diskConfig           | AUTO                                                         |
    | OS-EXT-AZ:availability_zone | iad-2                                                        |
    | OS-EXT-STS:power_state      | Running                                                      |
    | OS-EXT-STS:task_state       | None                                                         |
    | OS-EXT-STS:vm_state         | active                                                       |
    | OS-SRV-USG:launched_at      | 2017-10-06T01:23:41.000000                                   |
    | OS-SRV-USG:terminated_at    | None                                                         |
    | accessIPv4                  |                                                              |
    | accessIPv6                  |                                                              |
    | config_drive                | True                                                         |
    | created                     | 2017-10-06T01:23:12Z                                         |
    | flavor                      | gp1.subsonic (100)                                           |
    | hostId                      | 9d915ea664129303798621bb83cb3b2ac04c445cae6fc9e58e90b5d6     |
    | id                          | 246e50c8-22fa-4310-b972-a71cd0df43bf                         |
    | image                       |                                                              |
    | key_name                    | myKey                                                        |
    | name                        | myInstance                                                   |
    | progress                    | 0                                                            |
    | project_id                  | e52edb2a460548zf950ba86497300079                             |
    | properties                  |                                                              |
    | security_groups             | name='default'                                               |
    | status                      | ACTIVE                                                       |
    | updated                     | 2017-10-06T01:23:41Z                                         |
    | user_id                     | 29815515c3be4d49a27e787a63eb8320                             |
    | volumes_attached            | id='e6b7qecc-8be2-4199-a4ad-9905b5591fed'                    |
    +-----------------------------+--------------------------------------------------------------+
    

    In that example, the size (flavor) of the instance is gp1.subsonic (100).

  2. List the available flavors with the following command:

    [user@localhost]$ openstack flavor list
    +-----+----------------+-------+------+-----------+-------+-----------+
    | ID  | Name           |   RAM | Disk | Ephemeral | VCPUs | Is Public |
    +-----+----------------+-------+------+-----------+-------+-----------+
    | 100 | gp1.subsonic   |  1024 |   80 |         0 |     1 | True      |
    | 200 | gp1.supersonic |  2048 |   80 |         0 |     1 | True      |
    | 300 | gp1.lightspeed |  4096 |   80 |         0 |     2 | True      |
    | 400 | gp1.warpspeed  |  8192 |   80 |         0 |     4 | True      |
    | 50  | gp1.semisonic  |   512 |   80 |         0 |     1 | True      |
    | 500 | gp1.hyperspeed | 16384 |   80 |         0 |     8 | True      |
    +-----+----------------+-------+------+-----------+-------+-----------+
    
  3. To resize the instance, use the openstack server resize command specifying the instance ID/name and the new flavor. Include the –-wait parameter to display the resize progress. For example:

    [user@localhost]$ openstack server resize --flavor 200 --wait myInstance
    Complete
    

    By default, the openstack server resize command gives the guest operating system 60 seconds to perform a controlled shutdown before the instance is powered off and the instance is resized.

    The timeout value can be overridden on a per image basis by means of os_shutdown_timeout that is an image metadata setting allowing different types of operating systems to specify how much time they need to shut down cleanly.

  4. Show the status for the instance.

    [user@localhost]$ openstack server show INSTANCE_NAME -c status
    +--------+----------------+
    | Field | Value |
    +--------+----------------+
    | status | VERIFY_RESIZE |
    +--------+----------------+

    When the resize completes, the status becomes VERIFY_RESIZE.

  5. Confirm the resize, for example:

    [user@localhost]$ openstack server resize --confirm myInstance

    Run openstack server show INSTANCE_NAME -c status again and you'll see the status is now ACTIVE.

  6. If the resize fails or does not work as expected, revert the resize. For example:

    [user@localhost]$ openstack server resize --revert myInstance

    The instance status becomes ACTIVE.

Did this article answer your questions?

Article last updated PST.