OpenStack-Queens在指定的Compute节点上创建虚拟机

  • A+
所属分类:OpenStack  虚拟化/私有云
[openstack-admin]-[root@DT_Node-172_17_5_1 ~]# openstack keypair list
+----------+-------------------------------------------------+
| Name     | Fingerprint                                     |
+----------+-------------------------------------------------+
| LookBack | d6:ea:bd:46:06:54:bf:8d:e4:1d:89:5c:f9:85:35:9a |
+----------+-------------------------------------------------+
[openstack-admin]-[root@DT_Node-172_17_5_1 ~]# openstack network list
+--------------------------------------+------------+--------------------------------------+
| ID                                   | Name       | Subnets                              |
+--------------------------------------+------------+--------------------------------------+
| 5f108c10-1abd-41c5-8bed-31a6edf886c6 | PrivateNet | 0ebe7181-528a-42e6-aa9c-d4a6c4377cbe |
| 9e66ff7b-5817-43ba-b1e2-bfa69569ab98 | PublicNet  | edf4cd96-7a5b-44a3-a47c-420ebba5ecf3 |
+--------------------------------------+------------+--------------------------------------+
[openstack-admin]-[root@DT_Node-172_17_5_1 ~]# openstack flavor list
+----+------------+-------+------+-----------+-------+-----------+
| ID | Name       |   RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+------------+-------+------+-----------+-------+-----------+
| 1  | L-1c1g40g  |  1024 |   40 |         0 |     1 | True      |
| 2  | L-1c2g40g  |  2048 |   40 |         0 |     1 | True      |
| 21 | W-2c2g60g  |  2048 |   60 |         0 |     2 | True      |
| 22 | W-2c4g60g  |  4096 |   60 |         0 |     2 | True      |
| 23 | W-4c4g60g  |  4096 |   60 |         0 |     4 | True      |
| 24 | W-4c8g60g  |  8192 |   60 |         0 |     4 | True      |
| 25 | W-4c16g60g | 16384 |   60 |         0 |     4 | True      |
| 26 | W-8c1g60g  | 16384 |   60 |         0 |     8 | True      |
| 27 | W-8c8g40g  |  8192 |   60 |         0 |     8 | True      |
| 28 | W-1c1g60g  |     1 |   60 |         0 |     1 | True      |
| 3  | L-2c2g40g  |  2048 |   40 |         0 |     2 | True      |
| 4  | L-2c4g40g  |  4096 |   40 |         0 |     2 | True      |
| 5  | L-4c4g40g  |  4096 |   40 |         0 |     4 | True      |
| 6  | L-4c8g40g  |  8192 |   40 |         0 |     4 | True      |
| 7  | L-4c16g40g | 16384 |   40 |         0 |     4 | True      |
| 8  | L-8c16g40g | 16384 |   40 |         0 |     8 | True      |
| 9  | L-8c8g40g  |  8192 |   40 |         0 |     8 | True      |
+----+------------+-------+------+-----------+-------+-----------+
[openstack-admin]-[root@DT_Node-172_17_5_1 ~]# openstack image list
+--------------------------------------+------------------------------------+--------+
| ID                                   | Name                               | Status |
+--------------------------------------+------------------------------------+--------+
| 1e6dc5c7-2118-4d63-81f2-60d55d640cfc | CentOS-7.5.1804-20181016           | active |
| 701da1c5-2cf1-43f5-81a7-48f56f47933c | Windows-Server-DataCenter-20181019 | active |
| 5548b655-058f-4241-9545-4e9feb46ecdb | ZABBIX-NEW-SNAPSHOT                | active |
| 752d4118-4990-4417-b9ca-79e5e8e9ea99 | cirros-test                        | active |
+--------------------------------------+------------------------------------+--------+


[openstack-admin]-[root@DT_Node-172_17_5_1 ~]# openstack server list
+--------------------------------------+------------------------------------+--------+---------------------------------------------------+------------------------------------+------------+
| ID                                   | Name                               | Status | Networks                                          | Image                              | Flavor     |
+--------------------------------------+------------------------------------+--------+---------------------------------------------------+------------------------------------+------------+
| d15ca6ba-9d1d-4325-8044-76c8864f529b | benyoo-test5-20181212              | ACTIVE | PublicNet=172.30.5.119                            | CentOS-7.5.1804-20181016           | L-2c2g40g  |
| 8174038b-e3ea-42d0-b981-6d74927e3365 | benyoo-test5-201812012             | ACTIVE | PublicNet=172.30.5.112                            | CentOS-7.5.1804-20181016           | L-2c2g40g  |
| e7b4da96-ccaa-41af-8967-42b83107d4f5 | 内网jump-server                    | ACTIVE | PrivateNet=172.25.10.245                          | CentOS-7.5.1804-20181016           | L-4c8g40g  |
| 69a45a44-3911-416d-acc1-5367bc955566 | Windows-Server-DataCenter-20181026 | ACTIVE | PrivateNet=172.25.200.200                         | Windows-Server-DataCenter-20181019 | W-4c16g60g |
| e7dae01d-6c2c-4ebc-98d7-3d1a31efe70a | Windows镜像测试                    | ACTIVE | PrivateNet=172.25.250.200                         | Windows-Server-DataCenter-20181019 | W-2c2g60g  |
| 96d2a3f6-e12e-41ad-9357-d99bf13c863a | zabbix-server-test-node-2          | ACTIVE | PrivateNet=172.25.250.246                         | CentOS-7.5.1804-20181016           | L-2c2g40g  |
| 98758c12-1b9d-4db2-b789-7880f12d18e1 | zabbix-server-new-node-1           | ACTIVE | PrivateNet=172.25.250.249; PublicNet=172.30.7.249 | CentOS-7.5.1804-20181016           | L-4c8g40g  |
| ca8e22ff-a531-4dbf-93df-e756ab9d3e31 | [内网JENKINS]-Node1                | ACTIVE | PrivateNet=172.25.250.247; PublicNet=172.30.7.247 | CentOS-7.5.1804-20181016           | L-2c4g40g  |
| b272e367-37ef-4eea-a449-2e97b06eace1 | [内网CMDB]-Node1                   | ACTIVE | PrivateNet=172.25.250.248; PublicNet=172.30.7.248 | CentOS-7.5.1804-20181016           | L-4c8g40g  |
+--------------------------------------+------------------------------------+--------+---------------------------------------------------+------------------------------------+------------+
[openstack-admin]-[root@DT_Node-172_17_5_1 ~]# openstack server show d15ca6ba-9d1d-4325-8044-76c8864f529b
+-------------------------------------+-----------------------------------------------------------------+
| Field                               | Value                                                           |
+-------------------------------------+-----------------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                          |
| OS-EXT-AZ:availability_zone         | nova                                                            |
| OS-EXT-SRV-ATTR:host                | compute5                                                        |
| OS-EXT-SRV-ATTR:hypervisor_hostname | compute5                                                        |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000373                                               |
| OS-EXT-STS:power_state              | Running                                                         |
| OS-EXT-STS:task_state               | None                                                            |
| OS-EXT-STS:vm_state                 | active                                                          |
| OS-SRV-USG:launched_at              | 2018-12-12T09:48:39.000000                                      |
| OS-SRV-USG:terminated_at            | None                                                            |
| accessIPv4                          |                                                                 |
| accessIPv6                          |                                                                 |
| addresses                           | PublicNet=172.30.5.119                                          |
| config_drive                        |                                                                 |
| created                             | 2018-12-12T09:48:19Z                                            |
| flavor                              | L-2c2g40g (3)                                                   |
| hostId                              | 369a99c5eca23a174b58ae092e14d33a4a68656cd1bb2393df0c8fa9        |
| id                                  | d15ca6ba-9d1d-4325-8044-76c8864f529b                            |
| image                               | CentOS-7.5.1804-20181016 (1e6dc5c7-2118-4d63-81f2-60d55d640cfc) |
| key_name                            | None                                                            |
| name                                | benyoo-test5-20181212                                           |
| progress                            | 0                                                               |
| project_id                          | e5272be1f6674fbcae5489a099f98e24                                |
| properties                          |                                                                 |
| security_groups                     | name='default'                                                  |
| status                              | ACTIVE                                                          |
| updated                             | 2018-12-13T01:12:28Z                                            |
| user_id                             | 2b83a7415f1342738607ce5307ea9ff1                                |
| volumes_attached                    |                                                                 |
+-------------------------------------+-----------------------------------------------------------------+


[openstack-admin]-[root@DT_Node-172_17_5_1 ~]# openstack server create \
--availability-zone nova:compute5 \                                            #在指定的区域和主机名启动instance
--flavor L-2c2g40g \                                                           #flavor名字
--image CentOS-7.5.1804-20181016 \                                             #镜像id
--nic net-id=9e66ff7b-5817-43ba-b1e2-bfa69569ab98,v4-fixed-ip=172.30.5.120 \   #指定网络和IP地址
'benyoo-test5-20181213'
+-------------------------------------+-----------------------------------------------------------------+
| Field                               | Value                                                           |
+-------------------------------------+-----------------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                          |
| OS-EXT-AZ:availability_zone         | nova                                                            |
| OS-EXT-SRV-ATTR:host                | None                                                            |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                                            |
| OS-EXT-SRV-ATTR:instance_name       |                                                                 |
| OS-EXT-STS:power_state              | NOSTATE                                                         |
| OS-EXT-STS:task_state               | scheduling                                                      |
| OS-EXT-STS:vm_state                 | building                                                        |
| OS-SRV-USG:launched_at              | None                                                            |
| OS-SRV-USG:terminated_at            | None                                                            |
| accessIPv4                          |                                                                 |
| accessIPv6                          |                                                                 |
| addresses                           |                                                                 |
| adminPass                           | zyhf5iPkHqj9                                                    |
| config_drive                        |                                                                 |
| created                             | 2018-12-13T01:33:37Z                                            |
| flavor                              | L-2c2g40g (3)                                                   |
| hostId                              |                                                                 |
| id                                  | 341ae7e3-71ee-414a-a612-987e497b9c1d                            |
| image                               | CentOS-7.5.1804-20181016 (1e6dc5c7-2118-4d63-81f2-60d55d640cfc) |
| key_name                            | None                                                            |
| name                                | benyoo-test5-20181213                                           |
| progress                            | 0                                                               |
| project_id                          | e5272be1f6674fbcae5489a099f98e24                                |
| properties                          |                                                                 |
| security_groups                     | name='default'                                                  |
| status                              | BUILD                                                           |
| updated                             | 2018-12-13T01:33:37Z                                            |
| user_id                             | 2b83a7415f1342738607ce5307ea9ff1                                |
| volumes_attached                    |                                                                 |
+-------------------------------------+-----------------------------------------------------------------+

[openstack-admin]-[root@DT_Node-172_17_5_1 ~]# openstack server show 341ae7e3-71ee-414a-a612-987e497b9c1d
+-------------------------------------+-----------------------------------------------------------------+
| Field                               | Value                                                           |
+-------------------------------------+-----------------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                          |
| OS-EXT-AZ:availability_zone         | nova                                                            |
| OS-EXT-SRV-ATTR:host                | compute5                                                        |
| OS-EXT-SRV-ATTR:hypervisor_hostname | compute5                                                        |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000376                                               |
| OS-EXT-STS:power_state              | Running                                                         |
| OS-EXT-STS:task_state               | None                                                            |
| OS-EXT-STS:vm_state                 | active                                                          |
| OS-SRV-USG:launched_at              | 2018-12-13T01:33:55.000000                                      |
| OS-SRV-USG:terminated_at            | None                                                            |
| accessIPv4                          |                                                                 |
| accessIPv6                          |                                                                 |
| addresses                           | PublicNet=172.30.5.120                                          |
| config_drive                        |                                                                 |
| created                             | 2018-12-13T01:33:37Z                                            |
| flavor                              | L-2c2g40g (3)                                                   |
| hostId                              | 369a99c5eca23a174b58ae092e14d33a4a68656cd1bb2393df0c8fa9        |
| id                                  | 341ae7e3-71ee-414a-a612-987e497b9c1d                            |
| image                               | CentOS-7.5.1804-20181016 (1e6dc5c7-2118-4d63-81f2-60d55d640cfc) |
| key_name                            | None                                                            |
| name                                | benyoo-test5-20181213                                           |
| progress                            | 0                                                               |
| project_id                          | e5272be1f6674fbcae5489a099f98e24                                |
| properties                          |                                                                 |
| security_groups                     | name='default'                                                  |
| status                              | ACTIVE                                                          |
| updated                             | 2018-12-13T01:33:55Z                                            |
| user_id                             | 2b83a7415f1342738607ce5307ea9ff1                                |
| volumes_attached                    |                                                                 |
+-------------------------------------+-----------------------------------------------------------------+
lookback

发表评论

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