This chapter describes how to use the OpenCenter CLI to create an OpenCenter environment and an OpenStack Nova cluster within that environment.
Note: Rackspace recommends that you run OpenCenter behind a firewall, as it is not considered secure at this time.
Before you begin, you should be generally familiar with the concepts and structure of OpenStack. You should also familiarize yourself with the object types in the OpenCenter framework.
A node is any object that can be managed within the environment. It may be a container (such as a Nova cluster) or a server (such as a Chef server)
A fact is a property that can be inherited from a parent node. For example, if a node is placed within a Nova container, the node inherits the container's properties. These properties can include the Chef server that the container uses, the API server, and the nova configuration file information. Each node includes a fact that describes its parent, which determines what additional facts the node needs to inherit.
Attributes are properties that are specific to a single node and are not inherited. These attributes are distinct and unique to the node, such as RAM or disk space.
An adventure is a solution composed of multiple actions that run in sequence, created to manage common changes. For example, OpenCenter includes an adventure that installs Chef server. There are also adventures for rebooting a server, upgrading installation packages, and identifying out-of-date security patches.
A task is an action directed at a specific node, assigned by the OpenCenter server to the OpenCenter agent that is installed on the node. Tasks are extensible via Python.
Filters are used to organize nodes by type. A filter is defined by facts; for example, you may create a filter that includes all nodes that have "Chef server" as a fact.
The device on which OpenCenter Server is installed and all OpenCenter-managed devices must have Ubuntu 12.04, CentOS 6.3, or RHEL 6.3 or 6.4 installed. The following instructions assume that you have a group of devices prepared with the correct operating system, complete with host names and IP addresses.
Your OpenCenter environment must have an OpenCenter server and have the OpenCenter agent installed on every node that will be managed by the server, and you must install the GUI component to manage the environment through the GUI. You must install the server first. Agent installations in the environment will ping the server and indicate that they are available for further configuration.
Instead of the ISO that was used in previous versions, installation is now performed via a curl command that launches an installation script. The script downloads the packages from packages.opencenter.rackspace.com and uses the packages to install the OpenCenter components.
Before you begin, ensure that the OS is up to date on the devices. Log into each device and run the update for the OS and the package manager:
apt-get update; apt-get upgradeyum updateRun the following curl command on the device that will become the OpenCenter server:
$ curl -s -L http://sh.opencenter.rackspace.com/install.sh | \
sudo bash -s - --role=serverWhen the installation is complete, you will receive a confirmation message indicating that OpenCenter server has been installed correctly.
You will also receive a message notifying you of where you can find the default server admin user name and password, which you will use to log into the dashboard and set the endpoint environment variable in the CLI. If you need to change the username and password, you will also need to edit the agent endpoint with the new username and password.
The OpenCenter CLI requires a valid endpoint, which contains the authentication credentials and the host name and port of the OpenCenter server. This can be set in the OPENCENTER_ENDPOINT variable in your environment. You will need the admin username and password from the server installation. Run the following command:
$ export OPENCENTER_ENDPOINT=https://<admin>:<password>@localhost:8443
If you work with multiple OpenCenter environments, you may find it easier to specify the endpoint with the --endpoint option. For example:
$ opencentercli --endpoint \
OPENCENTER_ENDPOINT=https://<admin>:<password>@localhost:8443
If you change the admin username and password in the OpenCenter configuration file, you will need to reset your endpoint environment variable again.
At this time you can run the opencentercli node list command to view the current node configuration.
$opencentercli node listid |name |task |adventure |attrs |facts | ---|--------------|-----|----------|------|------------------| 1 |workspace |None |None |{...} |{u'backends':... | 2 |unprovisioned |None |None |{...} |{u'parent_id':... | 3 |support |None |None |{...} |{u'parent_id':... | 4 |oc-server|None |None |{...} |{u'parent_id':... |
By default, the OpenCenter server is created with four nodes:
workspace: The "master" parent container for the OpenCenter environment.unprovisioned: The parent container for all nodes that have the OpenCenter agent installed, but that have not been assigned a role yet.support: The parent container for all nodes that are used to maintain the OpenCenter environment infrastructure and for external resources. The Chef server is automatically assigned to the support node as soon as it is configured.oc-server: In this example, this is the name of the OpenCenter server, which also counts as a node within the environment.You will need the IP address of the OpenCenter server to proceed with the installation of the OpenCenter agent. This can be obtained with the ifconfig command.
Add the OpenCenter server URL to the configuration information for each server on which the OpenCenter agent will be installed.
Run the following curl command on each node that will be managed with OpenCenter:
$curl -s -L http://sh.opencenter.rackspace.com/install.sh | \ sudo bash -s - --role=agent --ip=<OpenCenter-server-IP>
When the installation is complete, you will receive a confirmation message indicating that OpenCenter agent has been installed correctly.
You will receive a message notifying you of the current agent endpoint settings, incorporating the username and password from the server installation. You will need to change these settings if you change the OpenCenter admin username and password.
Repeat this process on each server.
After the agent has been installed on each managed server, run the opencentercli node list command on the OpenCenter server to view the OpenCenter environment. The newly configured nodes will appear in the list. The node names are the names that were assigned when you originally installed and configured the operating system on those nodes.
$opencentercli node listid |name |task |adventure |attrs |facts | ---|--------------|-----|----------|------|------------------| 1 |workspace |None |None |{...} |{u'backends': ... | 2 |unprovisioned |None |None |{...} |{u'parent_id':... | 3 |support |None |None |{...} |{u'parent_id':... | 4 |oc-server |None |None |{...} |{u'parent_id':... | 5 |chef-server |None |None |{...} |{u'parent_id':... | 6 |controller |None |None |{...} |{u'parent_id':... | 7 |compute |None |None |{...} |{u'parent_id':... |
Once your OpenCenter environment is ready, you can configure the nodes within the environment.
The first node that you will configure is a Chef server, which is required to manage the OpenStack nodes. Do not configure more than one Chef server in your environment.
Before you begin, you can view a list of the adventures that are currently available on a node. Run opencentercli node adventure list against one of the unprovisioned nodes in your environment. In this example, the command is executed on the node 5, chef-server. Since the node is currently unprovisioned, only two adventures are available:
$opencentercli node adventure list chef
Adventures that may be executed against node 5, chef-server:
id |criteria |name |
---|------------------------------|--------------------|
9 |('agent' in facts.backends) |Update Agent |
2 |('agent' in facts.backends... |Install Chef Server |
In this example, we're going to create a Chef server (adventure ID number 2) on node 5, chef-server The syntax for the command is:
opencentercli adventure execute <node_id_or_name><adventure_id_or_name>
On the OpenCenter server, run the command.
$ opencentercli adventure execute 5 2Or:
$ opencentercli adventure execute chef-server 'Install Chef Server'NOTE: Any OpenCenter object that has a name attribute may be referred to by name or ID when using opencentercli. Names with spaces must be quoted. If a name matches multiple objects, an error will be displayed stating that in this case an ID must be specified to avoid ambiguity.
The node will now be configured with all the files necessary to run as a Chef server.
The Chef server installation will take about five minutes, and you can monitor the progress by logging into the node and using the tail -f command to monitor /var/log/opencenter/trans_.N.log
While the configuration is running, you can also use opencentercli task list on the OpenCenter server to view the current node status. The action adventurate and the status running indicate that an adventure is running on the node.
$opencentercli task listid |completed|expires|submitted |parent|state |node |action | ---|---------|-------|----------|------|-------|-----------|-----------| 1 |None |None |1360344253|None |running|chef-server|adventurate| 2 |None |None |1360344253 None |running|chef-server|install_chef_server|
When the configuration is complete, you can view the new facts and attributes in the environment with opencentercli fact list and opencentercli attr list. In the following examples, the output has been truncated to display the facts and attributes relevant to the newly-configured Chef server.
$opencentercli fact listid |value |node |key | ---|--------------------------------------|------------------------------| 12 |[u'node', u'agent', ... |chef-server |backends | 13 |3 |chef-server |parent_id | 14 |admin |chef-server |chef_server_client_name | 15 |-----BEGIN RSA PRIV ... |chef-server |chef_server_client_pem | 16 |https://198.101.239. |chef-server |chef_server_uri | 17 |-----BEGIN RSA PRIV ... |chef-server |chef_server_pem | 18 |current |chef-server |chef_server_cookbook_channels | 19 |v2.9.5 |chef-server |chef_server_cookbook_version |$opencentercli attr listid |value |node |key | ---|------------------------|-------------|------------------------------| 21 |True |chef-server |converged | 22 |1361991837 |chef-server |last_checkin | 23 |{u'run_chef': {u'co ... |chef-server |opencenter_agent_actions | 24 |[u'modules', u'chef ... |chef-server |opencenter_agent_output_... | 25 |ok |chef-server |last_task | 26 |True |chef-server |locked |
You can also view the Chef server management console in your browser at https://. Most users will not need to use this feature, but in the event that you do, refer to the Opscode Chef Management Console documentation for more information about the management console.chef-server-ip-address
Once the Chef server is configured, the client installed on the nodes, and the cookbooks updated. you can now create a Nova cluster. The Nova cluster is created within the workspace node, which has an ID of 1. Use opencentercli adventure list to get the correct adventure number. In this example, the adventure ID number for creating a Nova cluster is 3. Run the following command on the OpenCenter server:
$ opencentercli adventure execute 1 3When you execute this command, you will be prompted to enter the following network information about the Nova cluster:
The system will offer default suggestions for each entry.
When the process is complete, run opencentercli node list. The node list now shows the Nova Custer, Infrastructure, Compute, and Availability Zone nodes.
$opencentercli node listid |name |task |adventure |attrs |facts | ---|---------------|-----|----------|------|----------------------| 1 |workspace |None |None |{...} |{u'backends': ... | 2 |unprovisioned |None |None |{...} |{u'parent_id': ... | 3 |support |None |None |{...} |{u'parent_id': ... | 4 |oc-server |None |None |{...} |{u'parent_id':... | 5 |chef-server |None |None |{...} |{u'parent_id': ... | 6 |controller |None |None |{...} |{u'parent_id': ... | 7 |compute |None |None |{...} |{u'parent_id': ... | 8 |Nova Cluster |None |None |{...} |{u'osops_public': ... | 9 |Infrastructure |None |None |{...} |{u'osops_public': ... | 10 |Compute |None |None |{...} |{u'osops_public': ... | 11 |AZ nova |None |None |{...} |{u'osops_public': ... |
You will now create a Controller node by moving an unprovisioned node to the Infrastructure container. The syntax for moving a node is:
$ opencentercli node move <node_id_or_name> <container_node_id_or_name>
Moving a node into the infrastructure container triggers an adventure that changes the parent_id of the node and applies the single-controller role to the node.
Execute the following command:
$ opencentercli node move controller InfrastructureThe Controller installation can take up to 10-12 minutes. While it is running, you can check on the progress with the opencentercli task list command and look for the currently active tasks. The first will be install_chef. The second will be run_chef. To watch the logs for either task, run opencentercli task logs <id> where <id> is the number of the task. This will show the last 1024 bytes of the log. To retrieve the whole log, run opencentercli task logs <id> --offset=+0.
You can also monitor the progress by logging into the node and using the tail command to monitor /var/log/opencenter/trans_N.log.
When the process is complete, you can access controller via its IP address in your browser and view the OpenStack Horizon dashboard.
However, at this point, you have no Compute nodes.
You will now create a Compute node by adding an unprovisioned node to the Compute container. By default, it will also be added to the default availability zone.
In this case, we're going to move compute (node ID 6) into the container AZ Nova with the node move command. Execute the following command:
$ opencentercli node move compute 'AZ nova' This command triggers an adventure that changes the parent_id of compute and applies the single-compute role to the node.
The Compute installation can take up to 5 minutes, and you can monitor the progress in the same way as you did for the Controller node.
You now have an OpenStack cluster consisting of one Controller node and one Compute node, and are now ready to create instances within the cluster. Refer to the Rackspace Private Cloud Software Getting Started Guide for more information on accessing and using your OpenStack cluster.
$opencentercli node listid |name |task |adventure |attrs |facts | ---|---------------|-----|----------|------|----------------------| 1 |workspace |None |None |{...} |{u'backends': ... | 2 |unprovisioned |None |None |{...} |{u'parent_id': ... | 3 |support |None |None |{...} |{u'parent_id': ... | 4 |oc-server |None |None |{...} |{u'parent_id': ... | 5 |chef-server |None |None |{...} |{u'parent_id': ... | 6 |controller |None |None |{...} |{u'parent_id': ... | 7 |compute |None |None |{...} |{u'parent_id': ... | 8 |Nova Cluster |None |None |{...} |{u'osops_public': ... | 9 |Infrastructure |None |None |{...} |{u'osops_public': ... | 10 |Compute |None |None |{...} |{u'osops_public': ... | 11 |AZ nova |None |None |{...} |{u'osops_public': ... |
To upload a set of disk images to Glance, use the Upload Initial Glance Images adventure. Run opencentercli node adventure list against the Controller node. In this example, the command is executed on the node 5, controller. The command shows that the following adventures are available:
$ opencentercli node adventure list controller id |criteria |name |
---|------------------------------|------------------------------|
14 |(facts.nova_role = 'nova-c... |Upload Initial Glance Images |
2 |('agent' in facts.backends... |Install Chef Server |
To upload the Glance images, you will execute the adventure (14) on the Controller node. In this example, the Controller node's name is controller. You could also use the Controller node ID.
$ opencentercli adventure execute controller 14
For High Availability, all you need to do is add another Controller node to the Infrastructure node. This is accomplished in the same way as the original Controller node was created.
In this example, another node has been added to the cluster called controller-2, which has an ID of 12:
id |name |task |adventure |attrs |facts |
---|---------------|-----|----------|------|-------------------|
1 |workspace |None |None |{...} |{u'backends': |
2 |unprovisioned |None |None |{...} |{u'parent_id': |
3 |support |None |None |{...} |{u'parent_id': |
4 |chef-server |None |None |{...} |{u'chef_server_pem'|
5 |controller |None |None |{...} |{u'osops_public': |
6 |compute |None |None |{...} |{u'osops_public': |
7 |Nova Cluster |None |None |{...} |{u'osops_public': |
8 |Infrastructure |None |None |{...} |{u'osops_public': |
9 |Compute |None |None |{...} |{u'osops_public': |
10 |AZ nova |None |None |{...} |{u'osops_public': |
11 |compute-2 |None |None |{...} |{u'osops_public': |
12 |controller-2 |None |None |{...} |{u'osops_public': |
This node will be turned into a Controller node by enabling HA on the infrastructure node and moving controller-2 into it.
First, you need to enable HA on the infrastructure container. In this example, the "Enable HA Infrastructure" adventure number is 4, and it will be run on the infrastructure node with an ID of 8.
$ opencentercli adventure execute 8 4
You will be prompted to enter three IP addresses which must be part of the Nova public network range:
Once this process is complete, move controller-2 into Infrastructure. This command triggers an adventure that changes the parent_id of controller-2 and applies the appropriate HA roles to both nodes that have the infrastructure node as a parent.
Execute the following command:
$ opencentercli node move 'controller-2' Infrastructure The installation can take up to 10-12 minutes, and you can monitor the progress as you did with the original Controller node.
The OpenCenter command line client includes online Help, which can be invoked with the --help flag.
The following example shows the results of the basic opencentercli --help command.
$opencentercli --help
usage: opencentercli [-h] [--debug] [--endpoint ENDPOINT]
{node,primitive,task,attr,adventure,fact} ...
OpenCenter CLI
positional arguments:
{node,primitive,task,attr,adventure,fact}
subcommands
adventure A predefined set of tasks for achieving a goal.
attr A non-inherritable attribute of a node
fact An inheritable property of a node
node An opencenter object, may represent a server or a
container for other nodes.
primitive A low level action that can be executed by OpenCenter
task An action that runs against a node
optional arguments:
-h, --help show this help message and exit
--debug Print debug information such as API requests
--endpoint ENDPOINT URL to opencenter endpoint. Should be of the form
http://host:8080 or https://user:pass@host:8443
The following example shows the arguments available for the opencentercli node command.
$opencentercli node --help usage: opencentercli node [-h] [--debug] [--endpoint ENDPOINT]
{show,create,move,list,update,filter,adventure,file,delete}
...
positional arguments:
{show,create,move,list,update,filter,adventure,file,delete}
Commands relating to node
adventure Adventure related commands for a node.
create Create a node
delete Delete a node
file list or retrieve files from a node that is running the
opencenter agent
filter list nodes that match filter-string. Example: id=4 or
name="workspace"
list List all nodes
move Move a node to a different container. This is an alias
for "fact create node parent_id new_parent". This
operation is not available if either the node to be
moved or current/destination container has the locked
attribute set.
show Show the properties of a node
update Modify a node
optional arguments:
-h, --help show this help message and exit
--debug Print debug information such as API requests
--endpoint ENDPOINT URL to opencenter endpoint. Should be of the form
http://host:8080 or https://user:pass@host:8443
The following example shows the arguments available for the opencentercli node create command.
$opencentercli node create --help usage: opencentercli node create [-h] [--debug] [--endpoint ENDPOINT] name
positional arguments:
name Name of the new node
optional arguments:
-h, --help show this help message and exit
--debug Print debug information such as API requests
--endpoint ENDPOINT URL to opencenter endpoint. Should be of the form
http://host:8080 or https://user:pass@host:8443
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

16 Comments
when install chef server
warring opencenter.static 403 post?
Hi. These topics at the
https://privatecloudforums.rackspace.com/viewtopic.php?f=4&t=401
https://privatecloudforums.rackspace.com/viewtopic.php?f=4&t=427
error upgrade on compute
dependency problems -leaving unconfigured
no apport report written because the error message indicates it a followup error from a previous failure
E: sub-process /usr/bin/dpkg returned an error code
on the status of the
All tasks are pending in opencenter daskboard
There are 13 tasks pending in opencenter. Could you please help me to restart the opencenter or stop all these tasks?
The status of opencenter is Warming
- Task: Idle
- Last task: Rollback
Thanks,
restarting OpenCenter
unable to execute endpoint command
-bash: admin: No such file or directory
Unable to login Opencenter private cloud UI
*******************Output*****************
You have installed Opencenter. WooHoo!!
Your OpenCenter dashboard is available at https://10.24.41.198
then
You have installed Opencenter. WooHoo!!
Agent username and password configurations are stored in
/etc/opencenter/agent.conf.d/opencenter-agent-endpoints.conf
root = https://<username>:<password>@<opencenter-server-ip>:8443
admin = https://<username>:<password>@<opencenter-server-ip>:8443/admin
If you change this you must also update the agent endpoint
configurations.
[user@redhat198 ~]$ opencli node list
-bash: opencli: command not found
[user@redhat198 ~]$ opencentercli node list
id |name |task |adventure |attrs |facts |
---|--------------|-----|----------|------------------------------|------------- -----------------|
1 |workspace |None |None |{u'display_name': u'Worksp... |{u'backends': [u'container... |
2 |unprovisioned |None |None |{u'display_name': u'Availa... |{u'parent_id' : 1, u'backen... |
3 |support |None |None |{u'display_name': u'Servic... |{u'parent_id' : 1, u'backen... |
4 |redhat198 |None |None |{u'opencenter_agent_action... |{u'parent_id' : 3, u'backen...
****************************---******************
But i am not able to login UI using admin/password
Can you please help me to solve this issue?
setting endpoint and using the GUI
Regarding the GUI access, this thread in the Private Cloud Forums may be related to your issue:
https://privatecloudforums.rackspace.com/viewtopic.php?f=4&t=419&hilit=access+gui
You can also post to the forums for more information and assistance.
Unable to Login UI
Kindly give your support to resolve the issue?
Thanks,
Karthi
Is the OpenCenter server also
Unable to login UI
*******************Output*****************
You have installed Opencenter. WooHoo!!
Your OpenCenter dashboard is available at https://10.24.41.198
then
You have installed Opencenter. WooHoo!!
Agent username and password configurations are stored in
/etc/opencenter/agent.conf.d/opencenter-agent-endpoints.conf
root = https://<username>:<password>@<opencenter-server-ip>:8443
admin = https://<username>:<password>@<opencenter-server-ip>:8443/admin
If you change this you must also update the agent endpoint
configurations.
[user@redhat198 ~]$ opencli node list
-bash: opencli: command not found
[user@redhat198 ~]$ opencentercli node list
id |name |task |adventure |attrs |facts |
---|--------------|-----|----------|------------------------------|------------- -----------------|
1 |workspace |None |None |{u'display_name': u'Worksp... |{u'backends': [u'container... |
2 |unprovisioned |None |None |{u'display_name': u'Availa... |{u'parent_id' : 1, u'backen... |
3 |support |None |None |{u'display_name': u'Servic... |{u'parent_id' : 1, u'backen... |
4 |redhat198 |None |None |{u'opencenter_agent_action... |{u'parent_id' : 3, u'backen...
****************************---******************
But i am not able to login UI using admin/password
Can you please help me to solve this issue?
Login successful but opencentercli node list error
"opencenter.endpoint - ERROR - [Errno 111] Connection refused
2013-05-21 23:09:52,904 - opencenter.endpoint - ERROR - Could not connect to endpoint http://localhost:8080/schema
'http://localhost:8080' is not a valid endpoint. Please specify a valid endpoint in environment variable OPENCENTER_ENDPOINT or using the command line option --endpoint. The endpoint string should follow one of these forms: http://host:8080 or https://user:pass@host:8443"
shall i peoceed with opencenter agent installation?
That sounds like the
export OPENCENTER_ENDPOINT=https://<admin>:<password>@localhost:8443
You may want to post your issues in the Rackspace Private Cloud Forums. The forums are monitored by Rackspace support staff and other users with a lot of technical information and experience, and are better suited for this kind of troubleshooting.
https://privatecloudforums.rackspace.com/
openstack_upload_images [done
/root/openrc does not exist and I cannot continue. Good bye.
Have you completed the entire
Add new comment