How to change the resource limits of a DreamCompute instance

To change the resource limits (vCPU/RAM) of a specific instance, change its flavor.

  1. Show information about an instance, including its size, which is shown as the value of the flavor property:

    $ nova show myCirrosInstance
    +--------------------------------------+----------------------------------------------------------+
    | Property                             | Value                                                    |
    +--------------------------------------+----------------------------------------------------------+
    | OS-DCF:diskConfig                    | MANUAL                                                   |
    | OS-EXT-AZ:availability_zone          | iad-2                                                    |
    | OS-EXT-STS:power_state               | 1                                                        |
    | OS-EXT-STS:task_state                | -                                                        |
    | OS-EXT-STS:vm_state                  | active                                                   |
    | OS-SRV-USG:launched_at               | 2016-02-09T23:25:12.000000                               |
    | OS-SRV-USG:terminated_at             | -                                                        |
    | accessIPv4                           |                                                          |
    | accessIPv6                           |                                                          |
    | config_drive                         | True                                                     |
    | created                              | 2016-02-09T23:25:05Z                                     |
    | flavor                               | gp1.subsonic (100)                                       |
    | hostId                               | c4606a0b4db316c7827f2d5925d6056936d4f27ac40f5ffff0d8cf73 |
    | id                                   | 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5                     |
    | image                                | Ubuntu-14.04 (03f89ff2-d66e-49f5-ae61-656a006bbbe9)      |
    | key_name                             | -                                                        |
    | metadata                             | {}                                                       |
    | name                                 | myCirrosInstance                                         |
    | os-extended-volumes:volumes_attached | []                                                       |
    | private-network network              | 10.10.10.3                                               |
    | progress                             | 0                                                        |
    | security_groups                      | default                                                  |
    | status                               | ACTIVE                                                   |
    | tenant_id                            | d659dfde1cff47fb99b20395ae04dde1                         |
    | updated                              | 2016-02-09T23:25:12Z                                     |
    | user_id                              | a02e9c8e3d514f658cc67046465c66c2                         |
    +--------------------------------------+----------------------------------------------------------+
    

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

  2. List the available flavors with the following command:

    $ nova flavor-list
    +-----+----------------+-----------+------+-----------+------+-------+-------------+-----------+
    | ID  | Name           | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
    +-----+----------------+-----------+------+-----------+------+-------+-------------+-----------+
    | 100 | gp1.subsonic   | 1024      | 80   | 0         |      | 1     | 1.0         | True      |
    | 200 | gp1.supersonic | 2048      | 80   | 0         |      | 1     | 1.0         | True      |
    | 300 | gp1.lightspeed | 4096      | 80   | 0         |      | 2     | 1.0         | True      |
    | 400 | gp1.warpspeed  | 8192      | 80   | 0         |      | 4     | 1.0         | True      |
    | 50  | gp1.semisonic  | 512       | 80   | 0         |      | 1     | 1.0         | True      |
    | 500 | gp1.hyperspeed | 16384     | 80   | 0         |      | 8     | 1.0         | 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:

      $ openstack server resize --flavor 100 --wait  myCirrosInstance
    Complete
    

    Note

    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.

    $ openstack server list
    +----------------------+------------------+---------------+-----------------------------------------+
    | ID                   | Name             | Status        | Networks                                |
    +----------------------+------------------+---------------+-----------------------------------------+
    | 84c6e57d-a6b1-44b... | myCirrosInstance | 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:

    $ openstack server resize --confirm 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5
    

    The instance status becomes ACTIVE.

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

    $ openstack server resize --revert 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5
    

    The instance status becomes ACTIVE.

 

Did this article answer your questions?

Article last updated .