在OpenStack里如何用Ironic管理IBM Power8裸机

来源:互联网 发布:java框架的作用 编辑:程序博客网 时间:2024/05/17 08:19
Introduction

The purpose of this document is to provide steps on using OpenStack Ironic for baremetal provisioning of scale-out Power servers. 

 
Setup Ironic

We have used Ironic with devstack. A very good reference to deploy Ironic with Devstack can be foundhere. Follow the instructions to setup devstack with Ironic.

Our test setup looks like this

Devstack and Ironic Server with two network ports (eth0 , eth1)

Baremetal hosts with two network ports (eth0, eth1) 

where,

eth0 – is the data network

eth1 – is the management network (for doing baremetal install, Out-of-Band management and other management activities)
 

Network Setup for Baremetal Deployment

We have used flat network for baremetal provisioning. 

Create a network bridge on the interface which is part of network connecting the physical server.

$sudo ovs-vsctl add-br br-eth1

$sudo ovs-vsctl add-port br-eth1 eth1
 

Create Flat Network for Ironic

Go to the devstack screen sessions and stop the neutron-openvswitch-agent service. Edit /etc/neutron/plugins/ml2/ml2_conf.ini with the following values
 
[ml2]
type_drivers = flat
tenant_network_types = flat
mechanism_drivers = openvswitch
[ml2_type_flat]
flat_networks = physnet1
[ml2_type_vlan]
network_vlan_ranges = physnet1
[ovs]
bridge_mappings = physnet1:br-eth1
 
Restart neutron-openvswitch-agent by going to the devstack screen session.
 
Create neutron network

neutron net-create --tenant-id $TENANT_ID sharednet1 –shared --provider:network_type flat --provider:physical_network physnet1

Create subnet

Create a subnet with required range with dhcp disabled since  we'll be using external DHCP server instead of neutron DHCP server.

neutron subnet-create sharednet1 10.0.1.0/24 --ip-version=4 --disable-dhcp

 
Add the subnet to the router

neutron router-interface-add router1 c61b8214-d04d-487a-8996-cd497ce45f79

 
Enable pxe_ipmitool driver

Edit /etc/ironic/ironic.conf and add pxe_ipmitool to enabled_drivers 

enabled_drivers = fake,agent_ssh,agent_ipmitool,pxe_ipmitool
 
Enable host console

Edit  /etc/ironic/ironic.conf specify the 'terminal' option

[console] 
# Options defined in ironic.drivers.modules.console_utils 
# Path to serial console terminal program (string value) 
terminal=shellinaboxd 
 
 
Restart Ironic services by going to devstack screen service.
 
 
Create deploy and user images

diskimage-builder is used to create images. Latest version of diskimage-build has all the required patches to create images for Power architecture.

Download the latest diskimage-builder source from github and use the same for creating images.
 
 
Create  base image
 
disk-image-create ubuntu baremetal -o my-image
 
For Fedora a local image has to be used, since currently Fedora doesn't provide any cloud images for Power like Ubuntu. Path of the local image can be specified by using DIB_LOCAL_IMAGE environment variable.  The local image is expected to have only PPC PreP boot partition and root parititon.
 
DIB_LOCAL_IMAGE=/tmp/fedora.qcow2 disk-image-create fedora baremetal -o my-image
 
 
Create deploy image
 
ramdisk-image-create ubuntu deploy-ironic -o my-deploy-ramdisk
 
 
Upload images to Glance
 
glance image-create --name my-kernel --is-public True --disk-format aki  < my-image.vmlinuz
 
Store the image uuid obtained from the above step as $MY_VMLINUZ_UUID.
 
glance image-create --name my-image.initrd --is-public True --disk-format ari  < my-image.initrd
 
Store the image UUID obtained from the above step as $MY_INITRD_UUID.
 
vmlinuz and initramfs from installation dvd iso can be used for cases when the vmlinuz and initramfs obtained from disk-image builder process does not have the required drivers.
 
glance image-create --name my-image --is-public True --disk-format qcow2 --container-format bare –property kernel_id=$MY_VMLINUZ_UUID --property
ramdisk_id=$MY_INITRD_UUID < my-image.qcow2
 
glance image-create --name deploy-vmlinuz --is-public True --disk-format aki < my-deploy-ramdisk.kernel
 
Store the image UUID obtained from the above step as $DEPLOY_VMLINUZ_UUID.
 
glance image-create --name deploy-initrd --is-public True --disk-format ari < my-deploy-ramdisk.initramfs
 
Store the image UUID obtained from the above step as $DEPLOY_INITRD_UUID.
 

Create Nova Flavor

Create nova flavors based on your hardware configuration
 
 
nova flavor-create powerpc_baremetal auto 25600 100 10

where 25600 is RAM in MB, 100 is Disk capacity in GB, and 10 is the number of CPUs 

Set the cpu architecture accordingly
 
nova flavor-key powerpc_baremetal set cpu_arch=ppc64
 

Add the node to Ironic

ironic node-create -d pxe_ipmitool -i pxe_deploy_kernel=$DEPLOY_VMLINUZ_UUID
 -i pxe_deploy_ramdisk=$DEPLOY_INITRD_UUID -i ipmi_address=<ipmiaddress> -i ipmi_username=<ipmi user> -i ipmi_password=<ipmi password>  -p cpus=$CPU -p memory_mb=$RAM_MB -p local_gb=$DISK_GB -p cpu_arch=$ARCH
 
Save the node uuid in NODE_UUID to be used in the next step
 
ironic port-create -n $NODE_UUID -a $MAC_ADDRESS
 
Set the port to be used for host console
 
ironic node-update $NODE_UUID add driver_info/ipmi_terminal_port=9000
ironic node-set-console-mode $NODE_UUID true
 
 
Configure external DHCP server
 
In our setup we have used the DHCP architecture identifier 0x0e to distinguish requests from scale-out Power servers. This allows for managing x86 and petitboot based Power servers together. A very detailed writeup on petitboot network based booting can be found here.
 
 
Below is sample dhcp configuration that was used.
 
ddns-update-style none; 
default-lease-time 600; 
max-lease-time 7200; 
option subnet-mask 255.255.255.0; 
option broadcast-address 10.0.1.255; 
option conf-file code 209 = text; 
option path-prefix code 210 = text; 
option arch code 93 = unsigned integer 16; 
next-server 10.0.1.248; 
if option arch = 00:0e {
        option path-prefix "/opt/stack/data/ironic/tftpboot/"; 
} else { 
        filename "pxelinux.0"; 
subnet 10.0.1.0 netmask 255.255.255.0 { 
range 10.0.1.10 10.0.1.100; 
range 10.0.1.150 10.0.1.200; 
}
 
Above configuration serves both x86 and PowerPC systems.
 
 
Configure PXE options in Ironic
 
Edit  /etc/ironic/ironic.conf and add boot_server=<ironic_server_IP> to pxe_append_params 
example:
 
pxe_append_params = nofb nomodeset vga=normal console=ttyS0 boot_server=192.168.122.58 
 
It is also possible to use a custom PXE configuration template with Ironic. This can be specified by setting “pxe_config_template”  in /etc/ironic/ironic.conf 
 
Update the tftp map file based on the 'prefix' value in the DHCP server configuration. For the dhcp configuration mentioned above, since “/opt/stack/data/ironic/tftpboot/” is used as prefix in dhcp configuration file, update the tftp map file with the entry shown below so that the tftp client in petitboot is able to resolve the path for kernel and initrd.
 
r (/opt/stack/data/ironic/tftpboot/opt/stack/data/ironic/tftpboot/) /opt/stack/data/ironic/tftpboot/\2
 
 
Deploy the node
 
nova boot --flavor powerpc_baremetal --image $image --key-name default testing
 
 
This will result in starting the OS deployment process.
 
Access node console
 
If you want to access the serial console of the node then the same can be accessed from a web browser with the url returned from the “node-get-console”
 
ironic node-get-console $NODE_UUID 
 

Hope this will help you to manage your scale-out Power servers by leveraging OpenStack Ironic.


0 0
原创粉丝点击