Deploy PowerKVM using xCAT

This blog shows how to install powerkvm & managing powerkvm node using xCAT.  Increasing need for dynamics re-provisioning , need a management tool to install PowerKVM on Power8 servers.

PS: powerkvm support is added in xcat-2.9 ( which is in development version)

Use  http://sourceforge.net/projects/xcat/files/yum/devel/core-rpms-snap.tar.bz2 and also download latest xcat-dep package from  sourceforge.net/projects/xcat/files/xcat-dep/2.x_Linux/

1. Use copycds to copy powerkvm ISO to install deploy

[root@xcat]# copycds -n pkvm2.1 ibm-powerkvm-201410101243.iso

Copying media to /install/pkvm2.1/ppc64                                                                                         Media copy operational successful

[root@xcat]

2. verify copycds using lsdef to list data objects definitions.

[root@xcat] lsdef -t osimage

pkvm2.1-ppc64-install-compute (osimage)

ubuntu14.04-ppc64-install-compute (osimage)

ubuntu14.04-ppc64-install-kvm (osimage)

[root@xcat]

3. Define a new node “n1” using mkdef, to modify existing node chdef can be used

[root@xcat] chdef n1 groups=all,kvm cons=ipmi mgt=ipmi

1 object definitions have been created or modified.

4.  Configure IPMI IP and password by setting “bmc” and “bmcpassword

[root@xcat] chdef n1 bmc=10.10.10.11 bmcpassword=pkvm1234

1 object definitions have been created or modified.

5. Configure mac address for node “n1” by setting “mac

[root@xcat] chdef n1 mac=6c:ae:8b:6a:d7:a0

1 object definitions have been created or modified.

6. Configure tftp and console server IP by setting “tftpserver” and “conserver

[root@xcat] chdef n1 tftpserver=10.10.10.12 conserver=10.10.10.12 nfsserver=10.10.10.12

1 object definitions have been created or modified.

7. Configure domain for node “n1” by setting “domain

[root@xcat] chdef -t site domain=example.com

1 object definitions have been created or modified.

8.  Configure IP for the node “n1” by setting “IP

[root@xcat] chdef n1 ip=10.10.10.14

1 object definitions have been created or modified.

9. Sets up /etc/hosts from the xCAT hosts table using “makehosts

[root@xcat] makehosts n1

10. set network boot type to “petotboot” by setting “netboot”

[root@xcat] chdef n1 netboot=petitboot

1 object definitions have been created or modified.

11. Use “nodeset” command to start installation on node “n1”, next time it boots up

[root@xcat] nodeset n1 osimagpkvm2.1-ppc64-install-compute

n1: install pkvm2.1-ppc64-compute

12. Reboot the node “n1” using “rpower

[root@xcat] rpower n1 reset

n1: reset

13. Monitor installation through the IPMI serial console using “rcons

[root@xcat] rcons n1

[Enter ‘^Ec?” for help]

[SOL session operational. Use ~? for help]

Pettitboot bootloader automatically boots the “xCAT” entry obtained from dhcp server

Figure 2: Petitboot

14. nodestat can be used to get status of machine. Status of node changed to sshd once install is complete

Commands can be run on installed node using psh

[root@xcat] nodestat n1

n1: sshd

[root@xcat] psh n1 uptime

n1: 6c:ae:8b:6a:d7:a0, 1 user, load average: 0.14, 0.07, 0.0.6

Advertisements

Setup Chef on standalone PowerKVM Environment

1) What it is?

Chef simplifies the way you perform infrastructure automation and configuration management tasks. The standalone installation of the Chef  creates a working installation on a single server.   This setup is on  standalone environment on PowerKVM node. (No separate chef server is configured.)

2) How to install on powerkvm node.

yum search chef
============================================================================== N/S matched: chef ===============================================================================
chef.ppc64 : The full stack of chef

yum install chef.ppc64

3) Configuration files:

web.json:   This is a pointer to recipe, which user would like to run.

solo.rb: only sets two paths for Chef Solo.

default.rb: sample recipe which user would like to run. User need to keep adding recipes  as per his/her requirements

3.1) Example Cookbook  to start kimchid service on powerkvm.

cat /root/chef-repo/cookbooks/demo/recipes/default.rb

#
# Cookbook Name:: demo
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved – Do Not Redistribute
#

package ‘kimchi’ do
action :install
end

service ‘kimchid’ do
action [  :enable, :start ]
end

3.2) chef.solo

cat chef-repo/solo.rb
file_cache_path “/root/chef-solo”
cookbook_path “/root/chef-repo/cookbooks”

3.3) web.json

cat web.json
{
“run_list”: [ “recipe[demo]” ]
}

4) How to run

chef-solo  -c chef-repo/solo.rb -j web.json
[2014-09-16T13:42:49+01:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.

To fix this issue add an entry like this to your configuration file:

“`
# Verify all HTTPS connections (recommended)
ssl_verify_mode :verify_peer

# OR, Verify only connections to chef-server
verify_api_cert true
“`

To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:

“`
knife ssl check -c chef-repo/solo.rb
“`

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Starting Chef Client, version 11.12.8
Compiling Cookbooks…
Converging 2 resources
Recipe: demo::default
* package[kimchi] action install (up to date)
* service[kimchid] action enable
   – enable service service[kimchid]

* service[kimchid] action start (up to date)

Running handlers:
Running handlers complete

Chef Client finished, 1/3 resources updated in 4.874421085 seconds