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'.

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.

Changing the resource limit

  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 list
    +----------------------+------------------+---------------+-----------------------------------------+
    | ID                   | Name             | Status        | Networks                                |
    +----------------------+------------------+---------------+-----------------------------------------+
    | 84c6e57d-a6b1-44b... | myInstance       | VERIFY_RESIZE | private=172.16.101.6, public=10.4.113.6 |
    +----------------------+------------------+---------------+-----------------------------------------+
    

    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 list 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 .