next up previous contents
Next: 登入金鑰對 Up: Instance Previous: Instance   Contents

新增 flavor

  1. 載入管理者 admin 環境變變數。
    [root@controller ~]# . admin.token
    
  2. 新增名為 m1.nano flavor,64M ram。
    [root@controller ~]# openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano
    +----------------------------+---------+
    | Field                      | Value   |
    +----------------------------+---------+
    | OS-FLV-DISABLED:disabled   | False   |
    | OS-FLV-EXT-DATA:ephemeral  | 0       |
    | disk                       | 1       |
    | id                         | 0       |
    | name                       | m1.nano |
    | os-flavor-access:is_public | True    |
    | properties                 |         |
    | ram                        | 64      |
    | rxtx_factor                | 1.0     |
    | swap                       |         |
    | vcpus                      | 1       |
    +----------------------------+---------+
    
  3. 新增名為 m1.crt flavor,4096M ram。
    [root@controller ~]# openstack flavor create --id 1 --vcpus 2 --ram 4096 --disk 16 m1.crt
    +----------------------------+--------+
    | Field                      | Value  |
    +----------------------------+--------+
    | OS-FLV-DISABLED:disabled   | False  |
    | OS-FLV-EXT-DATA:ephemeral  | 0      |
    | disk                       | 16     |
    | id                         | 1      |
    | name                       | m1.crt |
    | os-flavor-access:is_public | True   |
    | properties                 |        |
    | ram                        | 4096   |
    | rxtx_factor                | 1.0    |
    | swap                       |        |
    | vcpus                      | 2      |
    +----------------------------+--------+
    
  4. 查詢 flavor,有 m1.nano 及 m1.crt。
    [root@controller ~]# openstack flavor list
    +----+---------+------+------+-----------+-------+-----------+
    | ID | Name    |  RAM | Disk | Ephemeral | VCPUs | Is Public |
    +----+---------+------+------+-----------+-------+-----------+
    | 0  | m1.nano |   64 |    1 |         0 |     1 | True      |
    | 1  | m1.crt  | 4096 |   16 |         0 |     2 | True      |
    +----+---------+------+------+-----------+-------+-----------+
    



De-Yu Wang 2018-12-12