New Launch instance wizard should not display networks when neutron is not enabled. It needs to account for multi-region differences and the user's currently selected region.
See: https://review.openstack.org/#/c/164359/
To test this in a single environment, ensure that you have neutron setup properly. Then setup a two region environment.
In Horizon openstack_dashboard/local/local_setting.py
Uncomment / add the following (assumes keystone running locally)
AVAILABLE_REGIONS = [
('http://127.0.0.1:5000/v2.0', 'RegionOne'),
('http://localhost:5000/v2.0', 'RegionTwo'),
]
Use the keystone command line client to get the service list. You'll need the IDs later.
source <devstack-location>/openrc admin admin
keystone service-list
Then create endpoint entries in the keystone service catalog for the second region. In that region do not add an endpoint for neutron. The following shell script will accomplish this. Just replace the id's appropriately from the service list above.
Then in horizon, login with RegionOne.
Open Launch Instance.
Observe networks step loads properly (assuming you actually have neutron)
Use the project / region select on top toolbar to switch to RegionTwo.
- Do no use the far right one
Launch instance.
Observe that network step is no longer available.
PLEASE NOTE, it will fail to actually launch in region two unless you actually setup a real nova region with nova networking enabled. In other words, this is just to emulate two regions.
----------- Shell script below for creating endpoints ---------
#!/bin/bash
region_name=RegionTwo
compute_svc=<replace with service id>
computev2_1_svc=<replace with service id>
network_svc=<replace with service id>
image_svc=<replace with service id>
volume_svc=<replace with service id>
volumev2_svc=<replace with service id>
# keystone endpoint-get --service compute
keystone endpoint-create --region $region_name --service $compute_svc --publicurl 'http://localhost:8774/v2/$(tenant_id)s' --adminurl 'http://localhost:8774/v2/$(tenant_id)s' --internalurl 'http://localhost:8774/v2/$(tenant_id)s'
# compute v2.1
keystone endpoint-create --region $region_name --service $computev2_1_svc --publicurl 'http://localhost:8774/v2.1/$(tenant_id)s' --adminurl 'http://localhost:8774/v2.1/$(tenant_id)s' --internalurl 'http://localhost:8774/v2.1/$(tenant_id)s'
# image
keystone endpoint-create --region $region_name --service $image_svc --publicurl 'http://127.0.0.1:9292' --adminurl 'http://127.0.0.1:9292' --internalurl 'http://127.0.0.1:9292'
# volume
keystone endpoint-create --region $region_name --service $volume_svc --publicurl 'http://localhost:8776/v1/$(tenant_id)s' --adminurl 'http://localhost:8776/v1/$(tenant_id)s' --internalurl 'http://localhost:8776/v1/$(tenant_id)s'
# volume v2
keystone endpoint-create --region $region_name --service $volumev2_svc --publicurl 'http://localhost:8776/v2/$(tenant_id)s' --adminurl 'http://localhost:8776/v2/$(tenant_id)s' --internalurl 'http://localhost:8776/v2/$(tenant_id)s'
#network Uncomment following to also create network endpoint
#keystone endpoint-create --region $region_name --service $network_svc --publicurl 'http://localhost:9696' --adminurl 'http://localhost:9696' --internalurl 'http://localhost:9696'
Reviewed: https:/ /review. openstack. org/164359 /git.openstack. org/cgit/ openstack/ horizon/ commit/ ?id=2d548313cc5 8bd47026930924d d4df222f87d362
Committed: https:/
Submitter: Jenkins
Branch: master
commit 2d548313cc58bd4 7026930924dd4df 222f87d362
Author: Travis Tripp <email address hidden>
Date: Sat Mar 7 00:01:13 2015 -0700
Launch Instance - MultiRegion Support / Networks
This makes it so that networks are only provided
if the network service is enabled.
This bugfix also adds multi-region support.
Details on how to setup a multi-region test
to verify it in horizon are in the bug.
Closes-Bug: #1432401 fc9e1b76ddf57d2 2142a7ddeab
Co-Authored-By: Shaoquan Chen <email address hidden>
Co-Authored-By: Brian Tully <email address hidden>
Co-Authored-By: Richard Jones <email address hidden>
Change-Id: I4e98c18b579eb5