OpenStack命令行升级实例 resize instance

查看需要调整实例的ID

[lookback@LookdeMacBook-Pro ~/OpenStack]$ openstack server list --name CrateDB
+--------------------------------------+---------------+--------+---------------------+---------------------------------------+---------------+
| ID                                   | Name          | Status | Networks            | Image                                 | Flavor        |
+--------------------------------------+---------------+--------+---------------------+---------------------------------------+---------------+
| b5f0de85-f562-462d-bac7-f323908ab5d1 | CrateDB-Node1 | ACTIVE | NET-B=172.25.106.17 | CentOS-7.7.1908-x86_64-Cloud-20200207 | DT-L-4c8g40gD |
| 08455d13-f25a-4d63-8de5-6482981a3e16 | CrateDB-Node2 | ACTIVE | NET-B=172.25.106.18 | CentOS-7.7.1908-x86_64-Cloud-20200207 | DT-L-4c4g40gD |
| 4fce64c3-e2c7-41a1-af14-5bb2bacd9c7f | CrateDB-Node5 | ACTIVE | NET-B=172.25.106.21 | CentOS-7.7.1908-x86_64-Cloud-20200207 | DT-L-4c4g40gD |
| ac73d291-ca14-4ca1-a10e-bd66b7494735 | CrateDB-Node4 | ACTIVE | NET-B=172.25.106.20 | CentOS-7.7.1908-x86_64-Cloud-20200207 | DT-L-4c4g40gD |
| 4097e75c-322e-45d4-a5c8-6e739914182d | CrateDB-Node3 | ACTIVE | NET-B=172.25.106.19 | CentOS-7.7.1908-x86_64-Cloud-20200207 | DT-L-4c4g40gD |
+--------------------------------------+---------------+--------+---------------------+---------------------------------------+---------------+
[lookback@LookdeMacBook-Pro ~/OpenStack]$ 

查看都有哪些flavor

[lookback@LookdeMacBook-Pro ~/OpenStack]$ openstack flavor list
+-----+-----------------+-------+------+-----------+-------+-----------+
| ID  | Name            |   RAM | Disk | Ephemeral | VCPUs | Is Public |
+-----+-----------------+-------+------+-----------+-------+-----------+
| 101 | DT-L-1c1g40gD   |  1024 |   40 |         0 |     1 | True      |
| 102 | DT-L-1c2g40gD   |  2048 |   40 |         0 |     1 | True      |
| 103 | DT-L-2c2g40gD   |  2048 |   40 |         0 |     2 | True      |
| 104 | DT-L-2c4g40gD   |  4096 |   40 |         0 |     2 | True      |
| 105 | DT-L-4c4g40gD   |  4096 |   40 |         0 |     4 | True      |
| 106 | DT-L-4c8g40gD   |  8192 |   40 |         0 |     4 | True      |
| 107 | DT-L-4c16g40gD  | 16384 |   40 |         0 |     4 | True      |
| 108 | DT-L-8c8g40gD   |  8192 |   40 |         0 |     8 | True      |
| 109 | DT-L-8c16g40gD  | 16384 |   40 |         0 |     8 | True      |
| 110 | DT-L-8c32g40gD  | 32768 |   40 |         0 |     8 | True      |
| 111 | DT-L-16c32g40gD | 32768 |   40 |         0 |    16 | True      |
| 151 | DT-W-1c1g60g    |  1024 |   60 |         0 |     1 | True      |
| 152 | DT-W-2c1g60g    |  1024 |   60 |         0 |     2 | True      |
| 153 | DT-W-2c2g60g    |  2048 |   60 |         0 |     2 | True      |
| 154 | DT-W-2c4g60g    |  4096 |   60 |         0 |     2 | True      |
| 155 | DT-W-4c4g60g    |  4096 |   60 |         0 |     4 | True      |
| 156 | DT-W-4c8g60g    |  8192 |   60 |         0 |     4 | True      |
| 157 | DT-W-8c8g60g    |  8192 |   60 |         0 |     8 | True      |
| 158 | DT-W-8c16g60g   | 16384 |   60 |         0 |     8 | True      |
| 159 | DT-W-8c32g60g   | 32768 |   60 |         0 |     8 | True      |
| 160 | DT-W-16c32g60g  | 32768 |   60 |         0 |    16 | True      |
+-----+-----------------+-------+------+-----------+-------+-----------+
[lookback@LookdeMacBook-Pro ~/OpenStack]$ 

开始调整实例,这里将实例从4c4g调整到4c8g

[lookback@LookdeMacBook-Pro ~/OpenStack]$ openstack server resize --flavor DT-L-4c8g40gD b5f0de85-f562-462d-bac7-f323908ab5d1

确认调整

[lookback@LookdeMacBook-Pro ~/OpenStack]$ openstack server show b5f0de85-f562-462d-bac7-f323908ab5d1
+-------------------------------------+------------------------------------------------------------------------------+
| Field                               | Value                                                                        |
+-------------------------------------+------------------------------------------------------------------------------+
| OS-DCF:diskConfig                   | AUTO                                                                         |
| OS-EXT-AZ:availability_zone         | nova                                                                         |
| OS-EXT-SRV-ATTR:host                | 1063747-compute8                                                             |
| OS-EXT-SRV-ATTR:hypervisor_hostname | 1063747-compute8.dtops.cc                                                    |
| OS-EXT-SRV-ATTR:instance_name       | instance-000005ce                                                            |
| OS-EXT-STS:power_state              | Running                                                                      |
| OS-EXT-STS:task_state               | None                                                                         |
| OS-EXT-STS:vm_state                 | active                                                                       |
| OS-SRV-USG:launched_at              | 2020-03-22T15:20:10.000000                                                   |
| OS-SRV-USG:terminated_at            | None                                                                         |
| accessIPv4                          |                                                                              |
| accessIPv6                          |                                                                              |
| addresses                           | NET-B=172.25.106.17                                                          |
| config_drive                        |                                                                              |
| created                             | 2020-03-09T17:12:59Z                                                         |
| flavor                              | DT-L-4c8g40gD (106)                                                          |
| hostId                              | f8f804c17338428d1c9f54c632762a971edb5ff14ad5f70113e9666e                     |
| id                                  | b5f0de85-f562-462d-bac7-f323908ab5d1                                         |
| image                               | CentOS-7.7.1908-x86_64-Cloud-20200207 (738f7463-b938-4eea-b0c2-b80dbe46d72f) |
| key_name                            | lookback                                                                     |
| name                                | CrateDB-Node1                                                 |
| progress                            | 0                                                                            |
| project_id                          | 5df4e0c1c68647ef800e7904d455b58d                                             |
| properties                          |                                                                              |
| security_groups                     | name='放行进出公网'                                                          |
| status                              | ACTIVE                                                                       |
| updated                             | 2020-03-22T15:22:31Z                                                         |
| user_id                             | e885c093b3144cc6abcd19ff1c300730                                             |
| volumes_attached                    | id='3506b63b-e550-41df-9f9c-463f79b8b4c0'                                    |
+-------------------------------------+------------------------------------------------------------------------------+
[lookback@LookdeMacBook-Pro ~/OpenStack]$
lookback
  • 本文由 发表于 2020年3月22日23:51:05
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: