[toc]
rocky版使用命令启动一个实例
1.创建网络
openstack network create 创建网络 --shared 创建共享网络 --provider-physical-network 指定物理网卡名称 provider网络标签 --provider-network-type 指定网络类型 flat是桥接网络 pptfz是网络名称
openstack network create --share --external \
--provider-physical-network provider \
--provider-network-type flat pptfz
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2020-05-26T12:41:05Z |
| description | |
| dns_domain | None |
| id | 26fa223a-231f-419a-a387-750d6eabf3fe |
| ipv4_address_scope | None |
| ipv6_address_scope | None |
| is_default | None |
| is_vlan_transparent | None |
| mtu | 1500 |
| name | pptfz |
| port_security_enabled | True |
| project_id | 108d3fecb61840e3818f694c69c3ec4a |
| provider:network_type | flat |
| provider:physical_network | provider |
| provider:segmentation_id | None |
| qos_policy_id | None |
| revision_number | 1 |
| router:external | External |
| segments | None |
| shared | True |
| status | ACTIVE |
| subnets | |
| tags | |
| updated_at | 2020-05-26T12:41:05Z |
+---------------------------+--------------------------------------+
2.创建一个子网
创建一个名为pptfz
的子网,依据的网络是第一步中创建的网络pptfz
openstack subnet create --network pptfz \
--allocation-pool start=10.0.0.101,end=10.0.0.250 \
--dns-nameserver 223.5.5.5 --gateway 10.0.0.1 \
--subnet-range 10.0.0.0/24 pptfz
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| allocation_pools | 10.0.0.101-10.0.0.250 |
| cidr | 10.0.0.0/24 |
| created_at | 2020-05-26T12:45:13Z |
| description | |
| dns_nameservers | 223.5.5.5 |
| enable_dhcp | True |
| gateway_ip | 10.0.0.1 |
| host_routes | |
| id | ad3d939a-866f-4b2b-9321-29e98fe64f26 |
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| name | pptfz |
| network_id | 26fa223a-231f-419a-a387-750d6eabf3fe |
| project_id | 108d3fecb61840e3818f694c69c3ec4a |
| revision_number | 0 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2020-05-26T12:45:13Z |
+-------------------+--------------------------------------+
3.创建云主机的硬件配置方案
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 |
+----------------------------+---------+
#参数说明
flavor 硬件配置方案
--id 指定编号
--vcpus cpu个数
--ram 内存(单位:M)
--disk 磁盘(单位:G)
m1.nano 方案名称
#创建其余配置
openstack flavor create --id 1 --vcpus 1 --ram 512 --disk 5 m1.tiny1
openstack flavor create --id 2 --vcpus 1 --ram 1024 --disk 5 m1.tiny2
openstack flavor create --id 3 --vcpus 1 --ram 2048 --disk 10 m1.small
openstack flavor create --id 4 --vcpus 2 --ram 4096 --disk 20 m1.medium