安装三节点OpenStack Queens集群–第9部分

在网络节点和计算节点上配置虚拟网络

确保在两个节点上正确配置了其他NIC。这需要附加的NIC才能工作。

“每个人都是为一份特定的工作而努力的,对这份工作的渴望在每一个心中都有。”
–鲁米

第一步: 如下更改网络节点和计算节点上的设置:

# add a new bridge. You can use any name e.g br-eth1, br-ens192, or any other depending on your needs[[email protected] ~]# ovs-vsctl add-br br-ens192 # add ens192 to the port of the bridge above[[email protected] ~]# ovs-vsctl add-port br-ens192 ens192  
[[email protected] ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini# on line 181: add [ml2_type_flat] flat_networks = physnet1 [[email protected] ~]# vim /etc/neutron/plugins/ml2/openvswitch_agent.ini# on line 194: add the following under [ovs] [ovs] bridge_mappings = physnet1:br-ens192
[[email protected] ~]# systemctl restart neutron-openvswitch-agent 

步骤2: 转到控制节点并创建一个新的虚拟网络,子网以及所有这些。

[[email protected] ~(keystone)]# projectID=$(openstack project list | grep service | awk '{print $2}')# You can call it anything on firstnet1 [[email protected] ~(keystone)]# openstack network create --project $projectID  --share --provider-network-type flat --provider-physical-network physnet1 firstnet1   +---------------------------+--------------------------------------+ | Field                     | Value                                | +---------------------------+--------------------------------------+ | admin_state_up            | UP                                   | | availability_zone_hints   |                                      | | availability_zones        |                                      | | created_at                | 2019-03-14T09:39:33Z                 | | description               |                                      | | dns_domain                | None                                 | | id                        | e9927eb9-7467-4e7e-844a-fc07db9c9b85 | | ipv4_address_scope        | None                                 | | ipv6_address_scope        | None                                 | | is_default                | False                                | | is_vlan_transparent       | None                                 | | mtu                       | 1500                                 | | name                      | firstnet1                            | | port_security_enabled     | True                                 | | project_id                | d13375a7f48b4642abc74ad68d6ffe4b     | | provider:network_type     | flat                                 | | provider:physical_network | physnet1                             | | provider:segmentation_id  | None                                 | | qos_policy_id             | None                                 | | revision_number           | 2                                    | | router:external           | Internal                             | | segments                  | None                                 | | shared                    | True                                 | | status                    | ACTIVE                               | | subnets                   |                                      | | tags                      |                                      | | updated_at                | 2019-03-14T09:39:33Z                 | +---------------------------+--------------------------------------+

第三步: 让我们创建第一个net1子网(例如:192.168.55.0/24)

[[email protected] ~(keystone)]# openstack subnet create subnet1 --network firstnet1 --project $projectID --subnet-range 192.168.55.0/24 --allocation-pool start=192.168.55.40,end=192.168.55.254 --gateway 192.168.55.1 --dns-nameserver 8.8.8.8 +-------------------+--------------------------------------+ | Field             | Value                                | +-------------------+--------------------------------------+ | allocation_pools  | 192.168.55.40-192.168.55.254         | | cidr              | 192.168.55.0/24                      | | created_at        | 2019-03-14T09:45:51Z                 | | description       |                                      | | dns_nameservers   | 8.8.8.8                              | | enable_dhcp       | True                                 | | gateway_ip        | 192.168.55.1                         | | host_routes       |                                      | | id                | 800efe16-5a49-40f9-8523-e43a48560650 | | ip_version        | 4                                    | | ipv6_address_mode | None                                 | | ipv6_ra_mode      | None                                 | | name              | subnet1                              | | network_id        | e9927eb9-7467-4e7e-844a-fc07db9c9b85 | | project_id        | d13375a7f48b4642abc74ad68d6ffe4b     | | revision_number   | 0                                    | | segment_id        | None                                 | | service_types     |                                      | | subnetpool_id     | None                                 | | tags              |                                      | | updated_at        | 2019-03-14T09:45:51Z                 | +-------------------+--------------------------------------+

检查是否已成功创建。

[[email protected] ~(keystone)]# openstack network list+--------------------------------------+-----------+--------------------------------------+ | ID                                   | Name      | Subnets                              | +--------------------------------------+-----------+--------------------------------------+ | e9927eb9-7467-4e7e-844a-fc07db9c9b85 | firstnet1 | 800efe16-5a49-40f9-8523-e43a48560650 | +--------------------------------------+-----------+--------------------------------------+

恭喜,您目前已步入正轨。让我们添加一个用户和风格来定义实例的vCPU或内存。继续控制节点:

步骤4: 建立专案

[[email protected] ~(keystone)]# openstack project create --domain default --description "Helloworld Project" helloworld +-------------+----------------------------------+ | Field       | Value                            | +-------------+----------------------------------+ | description | Helloworld Project               | | domain_id   | default                          | | enabled     | True                             | | id          | f5547f8c879c41bea9c60e4541745c35 | | is_domain   | False                            | | name        | helloworld                       | | parent_id   | default                          | | tags        | []                               | +-------------+----------------------------------+

步骤5: 新增使用者

[[email protected] ~(keystone)]# openstack user create --domain default --project helloworld --password helloworld123 penchant +---------------------+----------------------------------+ | Field               | Value                            | +---------------------+----------------------------------+ | default_project_id  | f5547f8c879c41bea9c60e4541745c35 | | domain_id           | default                          | | enabled             | True                             | | id                  | 1e03edc140cf47858778ab44319391f6 | | name                | penchant                         | | options             | {}                               | | password_expires_at | None                             | +---------------------+----------------------------------+

步骤6: 新增角色

[[email protected] ~(keystone)]# openstack role add --project helloworld --user penchant StackUser

步骤7: 创建您喜欢的样品风味。换句话说,虚拟机规范(RAM,磁盘等)

[[email protected] ~(keystone)]# openstack flavor create --id 0 --vcpus 1 --ram 512 --disk 10 Basic +----------------------------+-------+ | Field                      | Value | +----------------------------+-------+ | OS-FLV-DISABLED:disabled   | False | | OS-FLV-EXT-DATA:ephemeral  | 0     | | disk                       | 10    | | id                         | 0     | | name                       | Basic | | os-flavor-access:is_public | True  | | properties                 |       | | ram                        | 512   | | rxtx_factor                | 1.0   | | swap                       |       | | vcpus                      | 1     | +----------------------------+-------+

现在您可以启动实例了。这将在下一篇文章中完成,其中包括Horizo​​n Dashboard的安装。如果是此处的新增内容,则下面的文章在前面链接。

在CentOS 7第1部分上安装Openstack 3节点集群

安装三节点OpenStack Queens集群–第2部分

安装三节点OpenStack Queens集群–第3部分

安装三节点OpenStack Queens集群–第4部分

安装三节点OpenStack Queens集群–第5部分

安装三节点OpenStack Queens集群–第6部分

安装三节点OpenStack Queens集群–第7部分

安装三节点OpenStack Queens集群–第8部分

单击下面的链接以访问Horizo​​ n中的下一个指南

安装三节点OpenStack Queens集群–第10部分

Sidebar