Below are some steps to get openstack horizon (aka dashboard) kinda running. I'm still having issues with talking to nova, hopefully its just a small config problem.
Assumes we are starting from a setup similar to http://fedoraproject.org/wiki/Getting_started_with_OpenStack_Nova
# Not sure if it's required, but this is how I was running sudo setenforce 0 sudo service iptables stop
# First we need to set up keystone, since horizon requires it. sudo yum install -y openstack-keystone # Clear any previous keystone config sudo rm /var/lib/keystone/keystone.sqlite sudo systemctl start openstack-keystone.service
# These steps are derived from # http://keystone.openstack.org/configuringservices.html # Assumes that openstack, keystone, and dashboard are all on localhost
sudo keystone-manage service add nova compute "Nova Compute Service" sudo keystone-manage service add glance image "Glance Image Service" sudo keystone-manage service add keystone identity "Keystone Identity Service"
sudo keystone-manage endpointTemplates add RegionOne nova \ http://localhost:8774/v1.1/ \ http://localhost:8774/v1.1/ \ http://localhost:8774/v1.1/ \ 1 1
sudo keystone-manage endpointTemplates add RegionOne glance \ http://localhost:9292/v1.1/ \ http://localhost:9292/v1.1/ \ http://localhost:9292/v1.1/ \ 1 1
sudo keystone-manage endpointTemplates add RegionOne keystone \ http://localhost:5000/v2.0 \ http://localhost:35357/v2.0 \ http://localhost:5000/v2.0 \ 1 1
sudo keystone-manage user add admin admin sudo keystone-manage user add demo demo
sudo keystone-manage tenant add admin sudo keystone-manage tenant add demo
sudo keystone-manage role add Admin sudo keystone-manage role grant Admin admin admin sudo keystone-manage token add 999888777666 admin admin 2015-02-05T00:00
sudo keystone-manage role add Member sudo keystone-manage role grant Member demo demo sudo keystone-manage role grant Admin admin demo
sudo keystone-manage endpoint add demo nova sudo keystone-manage endpoint add demo glance sudo keystone-manage endpoint add demo identity
sudo keystone-manage endpoint add admin nova sudo keystone-manage endpoint add admin glance sudo keystone-manage endpoint add admin identity
# Checkout horizon (aka dashboard) git clone git://github.com/openstack/horizon.git horizon.git cd horizon.git git branch --track diablo remotes/origin/stable/diablo git checkout diablo
# Now we set up a local environment with all the required dashboard # dependencies, without polluting our system configuration. dashboard # supplies tools for this but some tweaks are needed. sudo yum install -y bzr python-coverage cd openstack-dashboard edit tools/pip-requires, comment out the quantum git URL (reason: https://bugs.launchpad.net/horizon/+bug/888385) python tools/install_venv.py
# Manually install quantum into the virtual environment git clone https://github.com/openstack/quantum.git quantum.git cd quantum.git/common ../../tools/with_venv.sh python setup.py install cd ../client ../../tools/with_venv.sh python setup.py install cd ../..
# Run unit tests. Currently looks like 2 tests are failing with a glance # import issue: 'module' object has no attribute 'Error' ./run_tests.sh
# No unexpected failures, great! Let's configure the dashboard cd openstack-dashboard
# needed by glance imports but wasn't installed automatically ./tools/with_venv.sh pip --verbose install --environment .dashboard-venv/ pycrypto
# Actually run the dashboard ./tools/with_venv.sh python dashboard/manage.py runserver syncdb ./tools/with_venv.sh python dashboard/manage.py runserver 127.0.0.1:9000 firefox 127.0.0.1:9000 # should see a login page, accounts are demo:demo or admin:admin log in with admin:admin, it should work!
# If openstack-nova-api isn't running, you will see and error like: Unable to get usage info: [Errno 111] Connection refused
# If nova-api is running, on log in there will be an error like: Unable to get usage info: This error may be caused by a misconfigured nova url in keystone's service catalog, or by missing openstackx extensions in nova. See the dashboard README.
# Not required, but easy to setup the django debugging toolbar ./tools/with_venv.sh pip --verbose install --environment .dashboard-venv/ django-debug-toolbar
add the following to local/local_settings.py INTERNAL_IPS = ('127.0.0.1',) DEBUG_TOOLBAR_CONFIG = { "INTERCEPT_REDIRECTS" : False, }
# Configure nova to use openstackx admin extension # According to README at: https://github.com/openstack/horizon/blob/stable/diablo/openstack-dashboard/... git clone git://github.com/cloudbuilders/openstackx.git /tmp/openstackx cd /tmp/openstackx git branch --track diablo remotes/origin/diablo git checkout diablo Set --osapi_extensions_path=/tmp/openstackx/extensions in /etc/nova/nova.conf sudo systemctl restart openstack-nova-api.service restart dashboard, login
# Hmm, didn't change anything? Let's try and configure nova to use # keystone according to instructions at # http://keystone.openstack.org/configuringservices.html#setting-up-openstack-... git clone git://github.com/openstack/keystone.git /tmp/keystone Add --api_paste_config=/tmp/keystone/examples/paste/nova-api-paste.ini to /etc/nova/nova.conf sudo systemctl restart openstack-nova-api.service restart dashboard, login
# Something changed... error is now: Unable to get usage info: 401 Unauthorized This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
And that's all I've got for now. The error messages don't prevent poking at some of the UI, but nothing useful like instances are listed. I'd like to find some simple way to test that nova and keystone are working together, so if anyone has ideas that would be appreciated.
Thanks, Cole
Hey Cole,
I started going though your instructions, but got sidetracked a bit by keystone ... seems we have a common theme here :-)
On Mon, 2011-11-28 at 11:34 -0500, Cole Robinson wrote:
# First we need to set up keystone, since horizon requires it. sudo yum install -y openstack-keystone
Best to include --enablerepo=updates-testing
# Clear any previous keystone config sudo rm /var/lib/keystone/keystone.sqlite sudo systemctl start openstack-keystone.service
Right, yes - although keystone-manage doesn't talk to the service, it's best to let the service create the DB as owned by keystone:keystone before trying to use keystone-manage. If you dive right in with keystone-manage, it'll be owned by root:root and the service won't be able to start.
# These steps are derived from # http://keystone.openstack.org/configuringservices.html # Assumes that openstack, keystone, and dashboard are all on localhost
sudo keystone-manage service add nova compute "Nova Compute Service" sudo keystone-manage service add glance image "Glance Image Service" sudo keystone-manage service add keystone identity "Keystone Identity Service"
sudo keystone-manage endpointTemplates add RegionOne nova \ http://localhost:8774/v1.1/ \ http://localhost:8774/v1.1/ \ http://localhost:8774/v1.1/ \ 1 1
Wow, what a disgusting command!
(For my own reference, the args here are region, service, publicURL, adminURL, internalURL, enabled and global)
sudo keystone-manage endpointTemplates add RegionOne glance \ http://localhost:9292/v1.1/ \ http://localhost:9292/v1.1/ \ http://localhost:9292/v1.1/ \ 1 1
sudo keystone-manage endpointTemplates add RegionOne keystone \ http://localhost:5000/v2.0 \ http://localhost:35357/v2.0 \ http://localhost:5000/v2.0 \ 1 1
sudo keystone-manage user add admin admin sudo keystone-manage user add demo demo
sudo keystone-manage tenant add admin sudo keystone-manage tenant add demo
sudo keystone-manage role add Admin
One slightly surprising thing is that the Admin role has special significance - see keystone-admin-role in keystone.conf. I wonder why it's not added automatically if it's special?
sudo keystone-manage role grant Admin admin admin sudo keystone-manage token add 999888777666 admin admin 2015-02-05T00:00
Rather than using keystone-manage to add a token, I think you can just authenticate as admin and generate a token that way e.g.
$> curl -v -d '{"auth": {"passwordCredentials": {"username": "admin", "password": "admin"}}}' \ -H "Content-type: application/json" http://localhost:5000/v2.0/tokens {"access": {"token": {"expires": "2011-11-30T13:14:02.210014", "id": "a361aff4-2a65-480b-a77a-3c81c4ee02cc"}, "user": {"id": "1", "roles": [{"id": "1", "name": "Admin"}], "name": "admin"}}}
and then you can check that token works with e.g.
$> curl -H 'X-Auth-Token: a361aff4-2a65-480b-a77a-3c81c4ee02cc' http://localhost:35357/v2.0/tenants {"tenants": {"values": [{"enabled": true, "description": "None", "name": "admin", "id": "1"}], "links": []}}
sudo keystone-manage role add Member sudo keystone-manage role grant Member demo demo sudo keystone-manage role grant Admin admin demo
sudo keystone-manage endpoint add demo nova sudo keystone-manage endpoint add demo glance sudo keystone-manage endpoint add demo identity
sudo keystone-manage endpoint add admin nova sudo keystone-manage endpoint add admin glance sudo keystone-manage endpoint add admin identity
Okay, this sidetracked me a bit because you named the service for keystone 'keystone' above, not 'identity' - so why does it appear to work?
It turns out this arg should be an integer endpointTemplate ID. I've filed a bug with a fix to validate the arg:
https://bugs.launchpad.net/keystone/+bug/897749
But it looks like that because all the templates you added are 'global' (the second '1' arg to 'endpointTemplates add'), you don't need to also explicitly add them to the tenants
To check the endpoints list, I'm looking at the serviceCatalog list in the result from authenticating using that tenant:
$> curl -v -d '{"auth": {"passwordCredentials": {"username": "admin", "password": "p4ssw0rd"}, "tenantName": "admin"}}' -H "Content-type: application/json" http://localhost:35357/v2.0/tokens
Cheers, Mark.
Hey Cole,
Some more notes on this before I forget the details ...
On Mon, 2011-11-28 at 11:34 -0500, Cole Robinson wrote:
# Checkout horizon (aka dashboard) git clone git://github.com/openstack/horizon.git horizon.git cd horizon.git
Any reason for the '.git' suffix? e.g. I just did:
$> git clone git://github.com/openstack/horizon.git $> cd horizon
git branch --track diablo remotes/origin/stable/diablo git checkout diablo
This works too:
$> git checkout --track -b diablo origin/stable/diablo
# Now we set up a local environment with all the required dashboard # dependencies, without polluting our system configuration. dashboard # supplies tools for this but some tweaks are needed. sudo yum install -y bzr python-coverage
Can you remember what these are for?
cd openstack-dashboard edit tools/pip-requires, comment out the quantum git URL (reason: https://bugs.launchpad.net/horizon/+bug/888385) python tools/install_venv.py
# Manually install quantum into the virtual environment git clone https://github.com/openstack/quantum.git quantum.git cd quantum.git/common ../../tools/with_venv.sh python setup.py install cd ../client ../../tools/with_venv.sh python setup.py install cd ../..
Interestingly, on horizon master they've changed pip-requires to use stable/diablo quantum ... so:
$> git clone https://github.com/openstack/quantum $> cd quantum $> git checkout --track -b diablo origin/stable/diablo $> ../tools/with_venv.sh python setup.py install
# Run unit tests. Currently looks like 2 tests are failing with a glance # import issue: 'module' object has no attribute 'Error' ./run_tests.sh
# No unexpected failures, great! Let's configure the dashboard cd openstack-dashboard
# needed by glance imports but wasn't installed automatically ./tools/with_venv.sh pip --verbose install --environment .dashboard-venv/ pycrypto
Can be simplified to
$> ./tools/with_venv.sh pip install pycrypto
# Actually run the dashboard ./tools/with_venv.sh python dashboard/manage.py runserver syncdb
Should be just:
$> ./tools/with_venv.sh python dashboard/manage.py syncdb
./tools/with_venv.sh python dashboard/manage.py runserver 127.0.0.1:9000 firefox 127.0.0.1:9000
I'm running my browser on a different machine, so had to supply the public IP address in the runserver command and open the port up:
$> sudo lokkit -p 9000:tcp $> ./tools/with_venv.sh python dashboard/manage.py runserver 172.31.0.107:9000
# should see a login page, accounts are demo:demo or admin:admin log in with admin:admin, it should work!
Worked, w00t!
Cheers, Mark.
# Manually install quantum into the virtual environment git clone https://github.com/openstack/quantum.git quantum.git cd quantum.git/common ../../tools/with_venv.sh python setup.py install cd ../client ../../tools/with_venv.sh python setup.py install cd ../..
Interestingly, on horizon master they've changed pip-requires to use stable/diablo quantum ... so:
$> git clone https://github.com/openstack/quantum $> cd quantum $> git checkout --track -b diablo origin/stable/diablo $> ../tools/with_venv.sh python setup.py install
Cole,
If you are using RPMs for nova, etc., you also try using the diablo openstack-quantum RPMs now available in the f16 and f17 repos.
-Bob
On 11/30/2011 09:23 AM, Mark McLoughlin wrote:
Hey Cole,
Some more notes on this before I forget the details ...
On Mon, 2011-11-28 at 11:34 -0500, Cole Robinson wrote:
# Checkout horizon (aka dashboard) git clone git://github.com/openstack/horizon.git horizon.git cd horizon.git
Any reason for the '.git' suffix? e.g. I just did:
$> git clone git://github.com/openstack/horizon.git $> cd horizon
Nah just a personal convention, no real reason.
git branch --track diablo remotes/origin/stable/diablo git checkout diablo
This works too:
$> git checkout --track -b diablo origin/stable/diablo
Ah good to know, thanks.
# Now we set up a local environment with all the required dashboard # dependencies, without polluting our system configuration. dashboard # supplies tools for this but some tweaks are needed. sudo yum install -y bzr python-coverage
Can you remember what these are for?
The run_tests.sh script seems to need them.
cd openstack-dashboard edit tools/pip-requires, comment out the quantum git URL (reason: https://bugs.launchpad.net/horizon/+bug/888385) python tools/install_venv.py
# Manually install quantum into the virtual environment git clone https://github.com/openstack/quantum.git quantum.git cd quantum.git/common ../../tools/with_venv.sh python setup.py install cd ../client ../../tools/with_venv.sh python setup.py install cd ../..
Interestingly, on horizon master they've changed pip-requires to use stable/diablo quantum ... so:
$> git clone https://github.com/openstack/quantum $> cd quantum $> git checkout --track -b diablo origin/stable/diablo $> ../tools/with_venv.sh python setup.py install
# Run unit tests. Currently looks like 2 tests are failing with a glance # import issue: 'module' object has no attribute 'Error' ./run_tests.sh
# No unexpected failures, great! Let's configure the dashboard cd openstack-dashboard
# needed by glance imports but wasn't installed automatically ./tools/with_venv.sh pip --verbose install --environment .dashboard-venv/ pycrypto
Can be simplified to
$> ./tools/with_venv.sh pip install pycrypto
# Actually run the dashboard ./tools/with_venv.sh python dashboard/manage.py runserver syncdb
Should be just:
$> ./tools/with_venv.sh python dashboard/manage.py syncdb
Whoops, copy/paste typo.
Thanks, Cole
./tools/with_venv.sh python dashboard/manage.py runserver 127.0.0.1:9000 firefox 127.0.0.1:9000
I'm running my browser on a different machine, so had to supply the public IP address in the runserver command and open the port up:
$> sudo lokkit -p 9000:tcp $> ./tools/with_venv.sh python dashboard/manage.py runserver 172.31.0.107:9000
# should see a login page, accounts are demo:demo or admin:admin log in with admin:admin, it should work!
Worked, w00t!
Cheers, Mark.
cloud mailing list cloud@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/cloud
On Mon, 2011-11-28 at 11:34 -0500, Cole Robinson wrote:
# Actually run the dashboard ./tools/with_venv.sh python dashboard/manage.py runserver syncdb ./tools/with_venv.sh python dashboard/manage.py runserver 127.0.0.1:9000 firefox 127.0.0.1:9000 # should see a login page, accounts are demo:demo or admin:admin log in with admin:admin, it should work!
# If openstack-nova-api isn't running, you will see and error like: Unable to get usage info: [Errno 111] Connection refused
# If nova-api is running, on log in there will be an error like: Unable to get usage info: This error may be caused by a misconfigured nova url in keystone's service catalog, or by missing openstackx extensions in nova. See the dashboard README.
I'm seeing this too and it looks like an authentication issue.
I created a Nova user called "admin" and a project called "demo".
It looks like Horizon is doing GET /v1/extras/usage on Nova (port 8774) and getting a 401
Nova is hitting up keystone in order to authenticate the request, by doing a GET /v2.0/tokens/XXXXXXXX on port 35357 where XXXXXX is the authentication token Horizon supplied to Nova
Now, this is the keystone auth_token.py middleware which the Nova process is using to do this request back to keystone. It sets the X-Auth-Token header to whatever you put into Nova's api-paste.ini for admin_token
So, I'm not sure yet why the authentication is failing for me.
Alan is doing experimenting with keystone and nova at the moment - can you help us out?
Cheers, Mark.
So I got horizon working from git last week. Here's steps if anyone wants to give it a spin. This uses nova, glance, and keystone from get, so a prerequisite here is that no packaged versions are already running.
I'm not sure if running all this from git is a requirement or not, but since horizon won't likely ever be packaged for f16 I figured I'd try and use the code that is closest to what horizon will eventually be packaged against.
(and now that I try and reproduce the steps, I'm actually getting some horizon errors. Seems to be causde by some change in nova in the past week, see end of the mail for details.)
Again, as a precursor, set selinux to permissive and disable the firewall :)
# Get keystone from git and run it git clone git://github.com/openstack/keystone.git cd keystone python tools/install_venv.py (optionally enable 'debug' and 'verbose' in ./etc/keystone.conf)
# Set up keystone configuration (doesn't require daemon running) sudo bin/keystone-manage database sync
# Tenants sudo bin/keystone-manage tenant add admin sudo bin/keystone-manage tenant add demo
# Users sudo bin/keystone-manage user add admin admin sudo bin/keystone-manage user add demo admin
# Roles sudo bin/keystone-manage role add Admin sudo bin/keystone-manage role add Member sudo bin/keystone-manage role grant Admin admin admin sudo bin/keystone-manage role grant Member demo demo sudo bin/keystone-manage role grant Admin admin demo sudo bin/keystone-manage role grant Admin admin
# Services sudo bin/keystone-manage service add nova compute "Nova Compute Service" sudo bin/keystone-manage service add glance image "Glance Image Service" sudo bin/keystone-manage service add keystone identity "Keystone Identity Service"
# endpointTemplates sudo bin/keystone-manage endpointTemplates add RegionOne \ nova \ http://127.0.0.1:8774/v1.1/%tenant_id% \ http://127.0.0.1:8774/v1.1/%tenant_id% \ http://127.0.0.1:8774/v1.1/%tenant_id% \ 1 1 sudo bin/keystone-manage endpointTemplates add RegionOne \ glance \ http://127.0.0.1:9292/v1 \ http://127.0.0.1:9292/v1 \ http://127.0.0.1:9292/v1 \ 1 1 sudo bin/keystone-manage endpointTemplates add RegionOne \ keystone \ http://127.0.0.1:5000/v2.0 \ http://127.0.0.1:35357/v2.0 \ http://127.0.0.1:5000/v2.0 \ 1 1
# Tokens sudo bin/keystone-manage token add 999888777666 admin admin 2015-02-05T00:00
# Run the daemon sudo ./tools/with_venv.sh bin/keystone --config-file etc/keystone.conf
# Now let's do glance git clone git://github.com/openstack/glance.git cd glance python tools/install_venv.py enable the line after 'NOTE: use the following pipeline for keystone'
# Run glance sudo ./tools/with_venv.sh bin/glance-api --config-file etc/glance-api.conf sudo ./tools/with_venv.sh bin/glance-registry --config-file etc/glance-registry.conf
# Clone devstack, we are going to need some files from here git clone git://github.com/cloudbuilders/devstack.git
# Run nova from git git clone git://github.com/openstack/nova.git cd nova python tools/install_venv.py
# Set up nova keystone integration cp etc/nova/api-paste.ini . cat ../devstack/files/nova-api-paste.ini >> api-paste.ini sed -i -e "s/%SERVICE_TOKEN%/999888777666/" api-paste.ini
# Have nova use openstackx admin API plugin, required for a lot of # horizon functionality git clone git://github.com/cloudbuilders/openstackx.git ln -s openstackx/extensions extensions
# This will be where our nova instance stores state mkdir -p /tmp/nova-local/instances
# Make a local nova.conf with required changes. Drop it in the top level # 'nova' dir and the daemons will use it automatically. This is basically # the f16 nova.conf with the state directories change to /tmp/nova-local # and some added bits to use the openstackx extension
$ cat nova.conf --logdir=/tmp/nova-local --state_path=/tmp/nova-local --lock_path=/tmp/nova-local --dhcpbridge=/usr/bin/nova-dhcpbridge --dhcpbridge_flagfile=nova.conf --injected_network_template=/usr/share/nova/interfaces.template --libvirt_xml_template=/usr/share/nova/libvirt.xml.template --vpn_client_template=/usr/share/nova/client.ovpn.template --credentials_template=/usr/share/nova/novarc.template --network_manager=nova.network.manager.FlatDHCPManager --iscsi_helper=tgtadm --api_paste_config=api-paste.ini --osapi_extension=nova.api.openstack.v2.contrib.standard_extensions --osapi_extension=extensions.admin.Admin
# Set up the nova db sudo ./tools/with_venv.sh bin/nova-manage db sync
# Run all the nova services (requires many different terminal tabs :) ) sudo ./tools/with_venv.sh bin/nova-api sudo ./tools/with_venv.sh bin/nova-network sudo ./tools/with_venv.sh bin/nova-objectstore sudo ./tools/with_venv.sh bin/nova-compute sudo ./tools/with_venv.sh bin/nova-scheduler sudo ./tools/with_venv.sh bin/nova-volume
# At this point, go through the openstack F16 quickstart to setup a VM for # this nova instance
# Finally lets try horizon git clone git://github.com/openstack/horizon.git cd horizon python ./tools/install_venv.py cp openstack-dashboard/local/local_settings.py.example openstack-dashboard/local/local_settings.py set QUANTUM_ENABLED=False in openstack-dashboard/local/local_settings.py ./tools/with_venv.sh python openstack-dashboard/manage.py runserver:9000
firefox localhost:9000 login with admin:admin
And that should work! ... Or at least it did, as of nova commit 8b79dae67ca2686780d3e3b5863d0578264e92a5 on Jan 4. However with current up to date nova I'm getting errors like:
Error: Unable to get usage info: Malformed request url
in horizon. There is a recent nova bug filed with a similar error but I'm not sure if it's the issue I'm currently hitting:
https://bugs.launchpad.net/nova/+bug/915151
Thanks, Cole
On 01/13/2012 01:00 PM, Cole Robinson wrote:
And that should work! ... Or at least it did, as of nova commit 8b79dae67ca2686780d3e3b5863d0578264e92a5 on Jan 4. However with current up to date nova I'm getting errors like:
Error: Unable to get usage info: Malformed request url
in horizon. There is a recent nova bug filed with a similar error but I'm not sure if it's the issue I'm currently hitting:
Bisected to the following nova commit:
commit c9c09bd60e7a0e0258d218a31d7878755bea1395 Author: Thierry Carrez thierry@openstack.org Date: Wed Jan 11 13:48:29 2012 +0100
Do not overwrite project_id from request params
Prevent project_id overwriting from OSAPI request parameters. The patch is actually very simple (nova/api/openstack/wsgi.py) but needs significant test adjustments (nova/tests/*) to pass.
Fixes bug 904072. Patch from Vish Ishaya and Mark McLoughlin.
Change-Id: I66ea0f178ce6271ec1020e9f1a73bd4e8c83ddab
So I assume I've either misconfigured something or horizon is doing something funky. Mark, any clues?
Thanks, Cole
On 01/13/2012 05:06 PM, Cole Robinson wrote:
On 01/13/2012 01:00 PM, Cole Robinson wrote:
And that should work! ... Or at least it did, as of nova commit 8b79dae67ca2686780d3e3b5863d0578264e92a5 on Jan 4. However with current up to date nova I'm getting errors like:
Error: Unable to get usage info: Malformed request url
in horizon. There is a recent nova bug filed with a similar error but I'm not sure if it's the issue I'm currently hitting:
Bisected to the following nova commit:
commit c9c09bd60e7a0e0258d218a31d7878755bea1395 Author: Thierry Carrez thierry@openstack.org Date: Wed Jan 11 13:48:29 2012 +0100
Do not overwrite project_id from request params Prevent project_id overwriting from OSAPI request parameters. The patch is actually very simple (nova/api/openstack/wsgi.py) but needs significant test adjustments (nova/tests/*) to pass. Fixes bug 904072. Patch from Vish Ishaya and Mark McLoughlin. Change-Id: I66ea0f178ce6271ec1020e9f1a73bd4e8c83ddab
So I assume I've either misconfigured something or horizon is doing something funky. Mark, any clues?
Please ignore, yet another config issue that just happened to work due to the original bug.
In the nova api-paste.ini file, we need to change a few pipelines. This script stolen from devstack makes the changes:
$ cat fix-paste.sh #!/bin/bash
PASTE="./api-paste.ini"
# Finally, we change the pipelines in nova to use keystone function replace_pipeline() { sed "/[pipeline:$1]/,/[/s/^pipeline = .*/pipeline = $2/" -i $PASTE }
replace_pipeline "ec2cloud" "ec2faultwrap logrequest totoken authtoken keystonecontext cloudrequest authorizer ec2executor" replace_pipeline "ec2admin" "ec2faultwrap logrequest totoken authtoken keystonecontext adminrequest authorizer ec2executor" replace_pipeline "openstack_api_v2" "faultwrap authtoken keystonecontext ratelimit serialize extensions osapi_app_v2" replace_pipeline "openstack_compute_api_v2" "faultwrap authtoken keystonecontext ratelimit serialize compute_extensions osapi_compute_app_v2" replace_pipeline "openstack_volume_api_v1" "faultwrap authtoken keystonecontext ratelimit serialize volume_extensions osapi_volume_app_v1"
- Cole
On 01/13/2012 01:00 PM, Cole Robinson wrote:
So I got horizon working from git last week. Here's steps if anyone wants to give it a spin. This uses nova, glance, and keystone from get, so a prerequisite here is that no packaged versions are already running.
I'm not sure if running all this from git is a requirement or not, but since horizon won't likely ever be packaged for f16 I figured I'd try and use the code that is closest to what horizon will eventually be packaged against.
(and now that I try and reproduce the steps, I'm actually getting some horizon errors. Seems to be causde by some change in nova in the past week, see end of the mail for details.)
Again, as a precursor, set selinux to permissive and disable the firewall :)
# Get keystone from git and run it git clone git://github.com/openstack/keystone.git cd keystone python tools/install_venv.py (optionally enable 'debug' and 'verbose' in ./etc/keystone.conf)
# Set up keystone configuration (doesn't require daemon running) sudo bin/keystone-manage database sync
# Tenants sudo bin/keystone-manage tenant add admin sudo bin/keystone-manage tenant add demo
# Users sudo bin/keystone-manage user add admin admin sudo bin/keystone-manage user add demo admin
# Roles sudo bin/keystone-manage role add Admin sudo bin/keystone-manage role add Member sudo bin/keystone-manage role grant Admin admin admin sudo bin/keystone-manage role grant Member demo demo sudo bin/keystone-manage role grant Admin admin demo sudo bin/keystone-manage role grant Admin admin
# Services sudo bin/keystone-manage service add nova compute "Nova Compute Service" sudo bin/keystone-manage service add glance image "Glance Image Service" sudo bin/keystone-manage service add keystone identity "Keystone Identity Service"
# endpointTemplates sudo bin/keystone-manage endpointTemplates add RegionOne \ nova \ http://127.0.0.1:8774/v1.1/%tenant_id% \ http://127.0.0.1:8774/v1.1/%tenant_id% \ http://127.0.0.1:8774/v1.1/%tenant_id% \ 1 1 sudo bin/keystone-manage endpointTemplates add RegionOne \ glance \ http://127.0.0.1:9292/v1 \ http://127.0.0.1:9292/v1 \ http://127.0.0.1:9292/v1 \ 1 1 sudo bin/keystone-manage endpointTemplates add RegionOne \ keystone \ http://127.0.0.1:5000/v2.0 \ http://127.0.0.1:35357/v2.0 \ http://127.0.0.1:5000/v2.0 \ 1 1
# Tokens sudo bin/keystone-manage token add 999888777666 admin admin 2015-02-05T00:00
# Run the daemon sudo ./tools/with_venv.sh bin/keystone --config-file etc/keystone.conf
# Now let's do glance git clone git://github.com/openstack/glance.git cd glance python tools/install_venv.py enable the line after 'NOTE: use the following pipeline for keystone'
# Run glance sudo ./tools/with_venv.sh bin/glance-api --config-file etc/glance-api.conf sudo ./tools/with_venv.sh bin/glance-registry --config-file etc/glance-registry.conf
# Clone devstack, we are going to need some files from here git clone git://github.com/cloudbuilders/devstack.git
# Run nova from git git clone git://github.com/openstack/nova.git cd nova python tools/install_venv.py
# Set up nova keystone integration cp etc/nova/api-paste.ini . cat ../devstack/files/nova-api-paste.ini >> api-paste.ini sed -i -e "s/%SERVICE_TOKEN%/999888777666/" api-paste.ini
# Have nova use openstackx admin API plugin, required for a lot of # horizon functionality git clone git://github.com/cloudbuilders/openstackx.git ln -s openstackx/extensions extensions
# This will be where our nova instance stores state mkdir -p /tmp/nova-local/instances
# Make a local nova.conf with required changes. Drop it in the top level # 'nova' dir and the daemons will use it automatically. This is basically # the f16 nova.conf with the state directories change to /tmp/nova-local # and some added bits to use the openstackx extension
$ cat nova.conf --logdir=/tmp/nova-local --state_path=/tmp/nova-local --lock_path=/tmp/nova-local --dhcpbridge=/usr/bin/nova-dhcpbridge --dhcpbridge_flagfile=nova.conf --injected_network_template=/usr/share/nova/interfaces.template --libvirt_xml_template=/usr/share/nova/libvirt.xml.template --vpn_client_template=/usr/share/nova/client.ovpn.template --credentials_template=/usr/share/nova/novarc.template --network_manager=nova.network.manager.FlatDHCPManager --iscsi_helper=tgtadm --api_paste_config=api-paste.ini --osapi_extension=nova.api.openstack.v2.contrib.standard_extensions --osapi_extension=extensions.admin.Admin
Also, due to a recent nova commit, these last to need to start like --osapi_compute_extension
- Cole
Hi Cole, I gave this a whirl to see how it would go and managed to get a running Horizon but have these two error messages in red on the main screen
Error: Unable to get service info: This error may be caused by a misconfigured Nova url in keystone's service catalog, or by missing openstackx extensions in Nova. See the Horizon README.
Error: Unable to get usage info: This error may be caused by a misconfigured Nova url in keystone's service catalog, or by missing openstackx extensions in Nova. See the Horizon README.
so maybe it didn't install right at all.... if you want me to try anything out let me know and I'll give it a go.
see some comments below
Thanks, Derek.
On 01/13/2012 06:00 PM, Cole Robinson wrote:
Again, as a precursor, set selinux to permissive and disable the firewall :)
I also had to install the following packages with yum
python-virtualenv libxml2-devel libxslt-devel openldap-devel rabbitmq-server libvirt libvirt-python qemu qemu-kvm euca2ools
# Set up keystone configuration (doesn't require daemon running) sudo bin/keystone-manage database sync
This (for my environment) should have been sudo ./tools/with_venv.sh bin/keystone-manage database sync
and the same with the other keystone-manage commands
# Run glance
sudo mkdir /var/log/glance # I needed to make this directory
sudo ./tools/with_venv.sh bin/nova-api sudo ./tools/with_venv.sh bin/nova-network sudo ./tools/with_venv.sh bin/nova-objectstore sudo ./tools/with_venv.sh bin/nova-compute sudo ./tools/with_venv.sh bin/nova-scheduler sudo ./tools/with_venv.sh bin/nova-volume
I needed to start libvirtd and rabbitmq-server before these
Also you can use the command below to start these together, its good for devel work, although I usually comment out nova-vncproxy and nova-vsa from the script
sudo ./tools/with_venv.sh bin/nova-all
./tools/with_venv.sh python openstack-dashboard/manage.py runserver:9000
I changed this slightly so that It listened to all interfaces
./tools/with_venv.sh python openstack-dashboard/manage.py runserver 0.0.0.0:9000
One more thing, I did have some kind of authentication error trying to install images for the Nova install, I don't have it any more but if you want it I can redo the steps to see if I can get it again.
On 01/16/2012 09:15 AM, Derek Higgins wrote:
Hi Cole, I gave this a whirl to see how it would go and managed to get a running Horizon but have these two error messages in red on the main screen
Great, thanks for trying it out.
Error: Unable to get service info: This error may be caused by a misconfigured Nova url in keystone's service catalog, or by missing openstackx extensions in Nova. See the Horizon README.
Error: Unable to get usage info: This error may be caused by a misconfigured Nova url in keystone's service catalog, or by missing openstackx extensions in Nova. See the Horizon README.
so maybe it didn't install right at all.... if you want me to try anything out let me know and I'll give it a go.
Might want to check the output of nova-api when it's starting, and make sure there's a message like:
2012-01-16 11:48:05,325 AUDIT nova.api.openstack.extensions [-] Loaded extension: ADMIN
But besides that I don't know off hand.
One more thing, I did have some kind of authentication error trying to install images for the Nova install, I don't have it any more but if you want it I can redo the steps to see if I can get it again.
Hmm, I don't think I hit any errors following the f16 nova install steps. I'll leave it up to you whether its worth tracking down, if it wasn't a one off we will probably see it when we put essex packages in rawhide.
Thanks, Cole
On 01/16/2012 11:51 AM, Cole Robinson wrote:
On 01/16/2012 09:15 AM, Derek Higgins wrote:
Hi Cole, I gave this a whirl to see how it would go and managed to get a running Horizon but have these two error messages in red on the main screen
Great, thanks for trying it out.
Error: Unable to get service info: This error may be caused by a misconfigured Nova url in keystone's service catalog, or by missing openstackx extensions in Nova. See the Horizon README.
Error: Unable to get usage info: This error may be caused by a misconfigured Nova url in keystone's service catalog, or by missing openstackx extensions in Nova. See the Horizon README.
so maybe it didn't install right at all.... if you want me to try anything out let me know and I'll give it a go.
Might want to check the output of nova-api when it's starting, and make sure there's a message like:
2012-01-16 11:48:05,325 AUDIT nova.api.openstack.extensions [-] Loaded extension: ADMIN
But besides that I don't know off hand.
Ah actually I think a recent nova change also broke the required openstackx extensions, forgot I had to make this change (updating one weeks of nova changes caused a whole bunch of cascading issues :/ )
Try this openstackx patch:
diff --git a/extensions/admin.py b/extensions/admin.py index 1e6290a..dd3e0a2 100644 --- a/extensions/admin.py +++ b/extensions/admin.py @@ -39,9 +39,10 @@ from nova.db.sqlalchemy import api as sqlalchemy_api
from nova.api.openstack import wsgi -import nova.api.openstack.v2 as openstack_api -from nova.api.openstack.v2 import extensions -from nova.api.openstack.v2 import views +import nova.api.openstack.compute as openstack_api +from nova.api.openstack import extensions + +from nova.api.openstack.compute import views
from nova.compute import instance_types from nova.scheduler import api as scheduler_api
Thanks, Cole
On Mon, Jan 16, 2012 at 6:08 PM, Cole Robinson crobinso@redhat.com wrote:
Try this openstackx patch:
openstacx is deprecated: https://github.com/cloudbuilders/openstackx#readme We'd better help with https://blueprints.launchpad.net/horizon/+spec/novaclient-migration
On 01/16/2012 05:19 PM, Alan Pevec wrote:
On Mon, Jan 16, 2012 at 6:08 PM, Cole Robinson crobinso@redhat.com wrote:
Try this openstackx patch:
openstacx is deprecated: https://github.com/cloudbuilders/openstackx#readme We'd better help with https://blueprints.launchpad.net/horizon/+spec/novaclient-migration
Yeah that's what I've been poking at. AIUI there's 2 main pieces though: horizon using openstackx directly, and horizon depending on the openstackx 'admin' plugin being hooked up in nova. That blueprint covers the former so there is a clear path there. Not sure about the latter piece though, I need to try pinging one of the upstream horizon guys about it.
- Cole