1

我已经在 Ubuntu 16.04.1 LTS Desktop 上将 Openstack (Newton) 和 Nova (Compute) 设置为 Windows 10 主机上的虚拟机来宾 (Oracle VM VirtualBox ver.5.1.8)。

安装成功,登录后可以通过http://192.168.56.102/dashboard/(来自Host)访问Horizo​​n,如下图所示。(也可以从访客通过http://10.0.2.15/dashboard/访问,但此处未显示)

在此处输入图像描述

当虚拟机关闭并随后再次打开时,使用 Horizo​​n 的仪表板访问 Openstack 的权限就丢失了。仪表盘上显示“错误:无法检索使用信息”(如下图右上角)。这个问题是一个难题,并且可以一直重复。

在此处输入图像描述

以下是登录过程后从 Horizo​​n 的仪表板中选择 Computer->Overview 选项时 /var/log/apache2/horizo​​n_error.log 文件中显示的错误片段(生成上面的图 2)。

2016-12-02 13:03:08.786092 Recoverable error: HTTPConnectionPool(host='10.0.2.15', port=8774): Max retries exceeded with url: /v2.1/extensions (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f3436ebeb10>: Failed to establish a new connection: [Errno 111] Connection refused',))
2016-12-02 13:03:08.804729 DEBUG:keystoneauth.session:REQ: curl -g -i -X GET http://10.0.2.15/identity/v3/users/9af3721f2d8e41cc9342b9941bafc5d1/projects -H "User-Agent: python-keystoneclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}67ffd6b14a7e8891ae7cc8b29a639b81822c7b45"
2016-12-02 13:03:08.935723 DEBUG:keystoneauth.session:RESP: [200] Date: Fri, 02 Dec 2016 13:03:08 GMT Server: Apache/2.4.18 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-fa398fe1-c5c9-4ce6-986b-cec266278f04 Content-Length: 966 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/json 
2016-12-02 13:03:08.935791 RESP BODY: {"links": {"self": "http://10.0.2.15/identity/v3/users/9af3721f2d8e41cc9342b9941bafc5d1/projects", "previous": null, "next": null}, "projects": [{"is_domain": false, "description": "Bootstrap project for initializing the cloud.", "links": {"self": "http://10.0.2.15/identity/v3/projects/4350966521b54001aeb666b6e55b7deb"}, "enabled": true, "id": "4350966521b54001aeb666b6e55b7deb", "parent_id": "default", "domain_id": "default", "name": "admin"}, {"is_domain": false, "description": "", "links": {"self": "http://10.0.2.15/identity/v3/projects/43dba94541ba4e8e83d5528038346ea9"}, "enabled": true, "id": "43dba94541ba4e8e83d5528038346ea9", "parent_id": "default", "domain_id": "default", "name": "demo"}, {"is_domain": false, "description": "", "links": {"self": "http://10.0.2.15/identity/v3/projects/be3ee2f8cb074628ac24c8be6e4c7160"}, "enabled": true, "id": "be3ee2f8cb074628ac24c8be6e4c7160", "parent_id": "default", "domain_id": "default", "name": "alt_demo"}]}
2016-12-02 13:03:08.935809 
2016-12-02 13:03:09.018515 Call to list enabled services failed. This is likely due to a problem communicating with the Neutron endpoint. Load Balancers panel will not be displayed.
2016-12-02 13:03:09.024775 Call to list enabled services failed. This is likely due to a problem communicating with the Neutron endpoint. Firewalls panel will not be displayed.
2016-12-02 13:03:09.029002 Call to list enabled services failed. This is likely due to a problem communicating with the Neutron endpoint. VPN panel will not be displayed.
2016-12-02 13:03:09.035255 Call to list supported extensions failed. This is likely due to a problem communicating with the Nova endpoint. Host Aggregates panel will not be displayed

作为与端点通信时指示的问题的错误。验证服务的端点在 VM 中是否正常,不幸的是它不是。

svanan@svanan:~/devstack$ openstack endpoint list
Password: 
Missing parameter(s): 
Set a username with --os-username, OS_USERNAME, or auth.username
Set an authentication URL, with --os-auth-url, OS_AUTH_URL or auth.auth_url

以下是关闭之前 VM 中的原始输出。

svanan@svanan:~/devstack$ openstack endpoint list
+----------------------------------+-----------+--------------+----------------+---------+-----------+-----------------------------------------+
| ID                               | Region    | Service Name | Service Type   | Enabled | Interface | URL                                     |
+----------------------------------+-----------+--------------+----------------+---------+-----------+-----------------------------------------+
| 07480eca2071416c8dec30bafa95ff8f | RegionOne | neutron      | network        | True    | admin     | http://10.0.2.15:9696/                  |
| 0aa32dc14c194561816b6d1b60d04404 | RegionOne | glance       | image          | True    | admin     | http://10.0.2.15:9292                   |
| 0e5365a8ab3744c780feb25ecffc2c93 | RegionOne | keystone     | identity       | True    | internal  | http://10.0.2.15/identity               |
| 15d8608b021f42e2a3b0402889a9064f | RegionOne | neutron      | network        | True    | public    | http://10.0.2.15:9696/                  |
| 289a99bb83e846b2bfc5eabfb800d86d | RegionOne | glance       | image          | True    | internal  | http://10.0.2.15:9292                   |
| 41397886443d44b7b6d857fccb34d55d | RegionOne | neutron      | network        | True    | internal  | http://10.0.2.15:9696/                  |
| 4458eed550ae44479feca25f9bec96ce | RegionOne | nova_legacy  | compute_legacy | True    | public    | http://10.0.2.15:8774/v2/$(project_id)s |
| 51be7c90e6c4437fbb75c3a40857774f | RegionOne | keystone     | identity       | True    | public    | http://10.0.2.15/identity               |
| 7526c5a7e5084a07b1d1c7affe261ae4 | RegionOne | nova_legacy  | compute_legacy | True    | admin     | http://10.0.2.15:8774/v2/$(project_id)s |
| 7c1e026c1c2d4f0b9dfdfe15860d6c5b | RegionOne | keystone     | identity       | True    | admin     | http://10.0.2.15/identity_v2_admin      |
| 8641d88381fc499688162e8bcde5456c | RegionOne | cinderv2     | volumev2       | True    | internal  | http://10.0.2.15:8776/v2/$(project_id)s |
| 8a194a2954a943568ccaf8bce5eb9400 | RegionOne | cinder       | volume         | True    | internal  | http://10.0.2.15:8776/v1/$(project_id)s |
| 8c0b4d932da34c5990e43c0877146819 | RegionOne | nova         | compute        | True    | admin     | http://10.0.2.15:8774/v2.1              |
| 94e8cae799954ba09abcd3b31b1c926e | RegionOne | nova         | compute        | True    | public    | http://10.0.2.15:8774/v2.1              |
| a1527968e91d4df9b98fe09039e80bed | RegionOne | cinderv2     | volumev2       | True    | public    | http://10.0.2.15:8776/v2/$(project_id)s |
| a3e47c8f82d546c8917a8223b8b81a74 | RegionOne | cinderv3     | volumev3       | True    | internal  | http://10.0.2.15:8776/v3/$(project_id)s |
| b39a19918016462db99cf1de151fc870 | RegionOne | cinderv3     | volumev3       | True    | public    | http://10.0.2.15:8776/v3/$(project_id)s |
| d17514aa0eec4752848df9599dd8cd00 | RegionOne | cinder       | volume         | True    | admin     | http://10.0.2.15:8776/v1/$(project_id)s |
| db570fe7343b461a95cdd4179e1b28d9 | RegionOne | glance       | image          | True    | public    | http://10.0.2.15:9292                   |
| eb4aa71c03b0418eadfed00715744b07 | RegionOne | cinderv3     | volumev3       | True    | admin     | http://10.0.2.15:8776/v3/$(project_id)s |
| ee474205e562411abc1842dc9bccbb5d | RegionOne | nova_legacy  | compute_legacy | True    | internal  | http://10.0.2.15:8774/v2/$(project_id)s |
| f383e0696ee647f79f6fd3a3d7ac5dff | RegionOne | cinder       | volume         | True    | public    | http://10.0.2.15:8776/v1/$(project_id)s |
| f4239a1f86144d8dab3ed94237d7c10f | RegionOne | cinderv2     | volumev2       | True    | admin     | http://10.0.2.15:8776/v2/$(project_id)s |
| fe679fcbc79e4664b7897a381e90dd78 | RegionOne | nova         | compute        | True    | internal  | http://10.0.2.15:8774/v2.1              |
+----------------------------------+-----------+--------------+----------------+---------+-----------+-----------------------------------------+

在 VM 上验证了 ifconfig,它配置了 enp0s3、enp0s8、lo、virbr0 接口,但关闭前存在的 br-ex 如下所示:

br-ex     Link encap:Ethernet  HWaddr 1a:ba:3a:4a:d5:4f  
          inet addr:172.24.4.1  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::18ba:3aff:fe4a:d54f/64 Scope:Link
          inet6 addr: 2001:db8::2/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15 errors:0 dropped:0 overruns:0 frame:0
          TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:776 (776.0 B)  TX bytes:10328 (10.3 KB)

不确定是否缺少此网桥 (br-ex) 可能是 Horizo​​n(来自主机)无法连接来宾中的服务的原因。尝试在 etc/network/interfaces 中进行静态配置,如下所示以获得与上述 br-ex 相同的输出。

auto br-ex
  iface br-ex inet static
  hwaddress 1a:ba:3a:4a:d5:4f
  address 172.24.4.1
  broadcast 0.0.0.0
  netmask 255.255.255.0

  iface br-ex inet6 static
  pre-up modprobe ipv6
  address 2001:db8::2
  netmask 64

我得到的 br-ex 输出

svanan@svanan:~$ sudo systemctl restart networking
svanan@svanan:~$ ifconfig

br-ex     Link encap:Ethernet  HWaddr 7a:07:1d:1d:1a:40  
          inet addr:172.24.4.1  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::18ba:3aff:fe4a:d54f/64 Scope:Link
          inet6 addr: 2001:db8::2/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:126 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:19334 (19.3 KB)

如上所示,我无法将 HWaddr 配置为 1a:ba:3a:4a:d5:4f 而不是 7a:07:1d:1d:1a:40 出现。

问题:

  1. 在 VM 关闭和启动序列后缺少 br-ex 是否可能是 Horizo​​n 未能从其服务中检索信息的原因。
  2. 如何将 br-ex 的 HWaddr 静态设置为 1a:ba:3a:4a:d5:4f?语法 hwaddress 1a:ba:3a:4a:d5:4f 似乎不起作用。
  3. 如果你遇到类似的问题,你能分享你是如何解决的。
  4. 是真的吗,每次重新启动 VM 时都需要运行 ./unstack.sh 和 ./stack.sh ( ./rejoin-stack.sh 在牛顿中已贬值),如我的 No rejoin-stack.sh 脚本中所述设置。这种方法需要很长时间,如下所示,

    ==========================

    DevStack 组件时序

    ==========================

    总运行时间 1777

希望您能协助指导我。谢谢。

萨拉瓦南坎达萨米

4

0 回答 0