Jump to: navigation, search

Difference between revisions of "Ironic/TripleO"

(copied from /Ironic)
 
(Using Ironic with TripleO: updated link to TripleO readme file)
 
(4 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
In this section, we will go over how to set up Ironic within the TripleO enviroment.
 
In this section, we will go over how to set up Ironic within the TripleO enviroment.
  
: '''Note''': TripleO is under rapid development and may invalidate this walk thru.
+
: '''Note''': TripleO is under rapid development and may invalidate this walk-through.
  
 
If not familiar with TripleO and / or have not used the DiskImage-Builder (DIB) tool before, please read and familiarize yourself with the TripleO story. Here are some good starting points:
 
If not familiar with TripleO and / or have not used the DiskImage-Builder (DIB) tool before, please read and familiarize yourself with the TripleO story. Here are some good starting points:
:* [https://github.com/openstack/tripleo-incubator/blob/master/README.md TripleO-ReadMe]
+
:* [https://github.com/openstack/tripleo-incubator/blob/master/README.rst TripleO-ReadMe]
 
:* [http://docs.openstack.org/developer/tripleo-incubator/deploying.html Deploying-Doc]
 
:* [http://docs.openstack.org/developer/tripleo-incubator/deploying.html Deploying-Doc]
 
:* [http://docs.openstack.org/developer/tripleo-incubator/devtest.html Devtest-Doc]
 
:* [http://docs.openstack.org/developer/tripleo-incubator/devtest.html Devtest-Doc]
  
Please follow TripleO's [http://docs.openstack.org/developer/tripleo-incubator/devtest.html Devtest-Doc] up to the [http://docs.openstack.org/developer/tripleo-incubator/devtest_undercloud.html devtest_undercloud] section.
+
Check out tripleo-incubator master.
  
 +
Switch the undercloud to build with Ironic by doing:
  
==== Build undercloud containing Ironic ====
+
  export USE_IRONIC=1
We need to modify step #1 of [http://docs.openstack.org/developer/tripleo-incubator/devtest_undercloud.html devtest_undercloud-walkthru] to include the Ironic services, and to switch Nova from using the nova.virt.baremetal driver to instead use the nova.virt.ironic driver.
 
  
# Note that rev 21 was current at the time of this writing. You may need to update this revision number
+
Then, follow TripleO's [http://docs.openstack.org/developer/tripleo-incubator/devtest.html Devtest-Doc].
NOVA_PATCH_REV=21
 
cd $TRIPLEO_ROOT
 
export UNDERCLOUD_DIB_EXTRA_ARGS="nova-ironic"
 
export DIB_REPOLOCATION_nova=https://review.openstack.org/openstack/nova
 
export DIB_REPOREF_nova=refs/changes/28/51328/$NOVA_PATCH_REV
 
  
Proceed until step #3 of [http://docs.openstack.org/developer/tripleo-incubator/devtest_undercloud.html devtest_undercloud-walkthru].
+
After setup-baremetal is called in both the seed and undercloud stages you can use
 +
ironic node-list
  
==== Heat template ====
+
to list nodes and
Instead of building the undercloud-vm.yaml file, we want to build the undercloud-vm-ironic.yaml file:
 
 
 
make -C $TRIPLEO_ROOT/tripleo-heat-templates undercloud-vm-ironic.yaml
 
 
 
This template requires slightly different parameters, so use this command to deploy your undercloud:
 
 
 
heat stack-create '''-f $TRIPLEO_ROOT/tripleo-heat-templates/undercloud-vm-ironic.yaml''' \
 
-P "AdminToken=${UNDERCLOUD_ADMIN_TOKEN};\
 
AdminPassword=${UNDERCLOUD_ADMIN_PASSWORD};\
 
GlancePassword=${UNDERCLOUD_GLANCE_PASSWORD};\
 
HeatPassword=${UNDERCLOUD_HEAT_PASSWORD};\
 
NeutronPassword=${UNDERCLOUD_NEUTRON_PASSWORD};\
 
NovaPassword=${UNDERCLOUD_NOVA_PASSWORD};\
 
BaremetalArch=${NODE_ARCH};\
 
IronicPassword=${UNDERCLOUD_IRONIC_PASSWORD}" \
 
undercloud
 
 
 
==== Continue  [http://docs.openstack.org/developer/tripleo-incubator/devtest_undercloud.html devtest_undercloud-walkthru] ====
 
Continue to follow the [http://docs.openstack.org/developer/tripleo-incubator/devtest_undercloud.html devtest_undercloud-walkthru] up through step #9.
 
 
 
==== Register the Ironic service ====
 
After step #9, register the Ironic service with keystone.
 
PASSWORD=$UNDERCLOUD_IRONIC_PASSWORD register-endpoint -r "regionOne" -d "Ironic Service" ironic baremetal http://$UNDERCLOUD_IP:6385
 
 
 
In [http://docs.openstack.org/developer/tripleo-incubator/devtest_undercloud.html devtest_undercloud-walkthru's] step #10, nodes are registered to the undercloud's nova-baremetal and not Ironic. Instead of that, we'll create a 'baremetal' node and register it with ironic, via the undercloud.
 
 
 
Allow Ironic's SSH driver to connect to your local machine:
 
ssh heat-admin@$UNDERCLOUD_IP "cat /opt/stack/boot-stack/ironic-ssh-power-key.pub" >> ~/.ssh/authorized_keys
 
 
 
Copy the Ironic API credentials to your local machine:
 
ssh heat-admin@$UNDERCLOUD_IP -- 'sudo cat /root/stackrc' > $TRIPLEO_ROOT/tripleo-incubator/ironicrc
 
sed -i "s/localhost/$UNDERCLOUD_IP/" $TRIPLEO_ROOT/tripleo-incubator/ironicrc
 
source $TRIPLEO_ROOT/tripleo-incubator/ironicrc
 
 
 
==== Create an emulated baremetal node ====
 
 
 
This will create a 'baremetal' node:
 
export UNDERCLOUD_MAC=$(create-nodes $NODE_CPU $NODE_MEM $NODE_DISK $NODE_ARCH 1)
 
 
 
Use the ''ironic'' client to enroll the baremetal node:
 
HOST_IP=$(ip addr show virbr0 | grep inet | awk '{print $2}' | sed 's/\/[0-9]*//')
 
CHASSIS=$(ironic chassis-create -d TestChassis | grep uuid | awk '{print $4}')
 
NODE=$(ironic node-create -c $CHASSIS -d pxe_ssh | grep ' uuid ' | awk '{print $4}')
 
ironic port-create -n $NODE -a $UNDERCLOUD_MAC
 
ironic node-update $NODE add \
 
  driver_info/ssh_virt_type=virsh \
 
  driver_info/ssh_address=$HOST_IP \
 
  driver_info/ssh_key_filename=/opt/stack/boot-stack/ironic-ssh-power-key \
 
  driver_info/ssh_username=$(whoami)
 
 
 
Confirm everything is enrolled and correct:
 
 
  ironic node-show $NODE
 
  ironic node-show $NODE
 +
to view nodes.
  
 
You can now control the power state of this node with this command:
 
You can now control the power state of this node with this command:
 
  ironic node-set-power-state $NODE [on|off|reboot]
 
  ironic node-set-power-state $NODE [on|off|reboot]

Latest revision as of 12:24, 11 February 2015

Using Ironic with TripleO

In this section, we will go over how to set up Ironic within the TripleO enviroment.

Note: TripleO is under rapid development and may invalidate this walk-through.

If not familiar with TripleO and / or have not used the DiskImage-Builder (DIB) tool before, please read and familiarize yourself with the TripleO story. Here are some good starting points:

Check out tripleo-incubator master.

Switch the undercloud to build with Ironic by doing:

 export USE_IRONIC=1

Then, follow TripleO's Devtest-Doc.

After setup-baremetal is called in both the seed and undercloud stages you can use

ironic node-list

to list nodes and

ironic node-show $NODE

to view nodes.

You can now control the power state of this node with this command:

ironic node-set-power-state $NODE [on|off|reboot]