Professional Documents
Culture Documents
LX022 G1 Xstudhint
LX022 G1 Xstudhint
cover
Essentials of PowerKVM
Course code LX022G ERC 1.0
Student Exercises with hints
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide.
The following are trademarks of International Business Machines Corporation, registered in many
jurisdictions worldwide:
AIX® PartnerWorld® Power Architecture®
Power Systems™ Power® PowerVM®
POWER6® POWER7® PureFlex®
Redbooks® Storwize® WebSphere®
Intel is a trademark or registered trademark of Intel Corporation or its subsidiaries in the United
States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Other product and service names might be trademarks of IBM or other companies.
TOC Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
TMK
Trademarks
The reader should recognize that the following terms, which appear in the content of this training
document, are official trademarks of IBM or other companies:
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide.
The following are trademarks of International Business Machines Corporation, registered in many
jurisdictions worldwide:
AIX® PartnerWorld® Power Architecture®
Power Systems™ Power® PowerVM®
POWER6® POWER7® PureFlex®
Redbooks® Storwize® WebSphere®
Intel is a trademark or registered trademark of Intel Corporation or its subsidiaries in the United
States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Other product and service names might be trademarks of IBM or other companies.
pref
Exercises description
This course includes the following exercises:
• System preparation
• Installing PowerKVM host
• Navigating the basic PowerKVM environment
• Manage networks
• Storage operations
• Creating templates
• Define and install Guests
• Host management
In the exercise instructions you will see each step prefixed by a line. You
might want to check off each step as you complete it to keep track of your
progress.
Most exercises include required sections which should always be completed.
These might be required before performing later exercises. Some exercises
might also include optional sections that you might wish to perform if you
have sufficient time and want an additional challenge.
This course includes two versions of the course exercises, “with hints” and
“without hints”.
The standard “Exercise instructions” section provides high-level instructions
for the tasks you should perform. You need to apply the knowledge you
gained in the unit presentation to perform the exercise.
The “Exercise instructions with hints” provide more detailed instructions and
hints to help you perform the exercise steps.
EXempty
Exercise 1. System preparation
(with hints)
Introduction
Before you can begin working with PowerKVM, you need to make you
familiar with your lab environment. The following lab steps introduce you to
your systems that are used in the remainder of the lab assignments.
Requirements
• This workbook
• A workstation that is connected to a network
• Power server with OPAL firmware supporting PowerKVM
• Secondary system with IPMI utilities
• For virtual classroom a shared desktop solution
- IPMI sharing server
Preface
• All exercises of this unit depend on the availability of specific equipment in your
classroom. You need a computer system that is configured with a network connection to
your assigned host.
• Information provided for locating documentation on particular web pages was correct
when this course was written. However, web pages tend to change over time. Ask your
instructor if you have trouble navigating the websites.
• All hints are marked by a » sign.
Lab team 1
Power 8 server
Internet Citrix
Student 1 server
Student 2
Linux network server
(common platform for all lab teams)
Number of lab teams dependent
on VIOS instances
Note
In this procedure, the student uses the exercise data sheet, which is Appendix A in this guide (or in
a separate document provided by your instructor).
Important
If you have any trouble connecting to your lab system, or do not see the shared applications, notify
your instructor.
__ 1. Determine which team and student number you have been assigned. This information is
provided by instructor.
-h This help
-V Show version information
-v Verbose (can use multiple times)
-c Display output in comma separated format
-d N Specify a /dev/ipmiN device to use (default=0)
Note
In the event the console becomes unavailable. You need to be able to access the ASMI so you can
reset the system.
Lab team 1
Power 8 server
Internet Citrix
Student 1 server
Student 2
Linux network server
(common platform for all lab teams)
Number of lab teams dependent
on VIOS instances
» The menu option allows for changing passwords for various IDs. To use the ipmitool
later you will need to assign an IPMI password.
Important
You return to these menus in the Installing PowerKVM host exercise. For now, notify your instructor
you have completed these exercise steps.
End of exercise
EXempty
Exercise 2. Installing PowerKVM host
(with hints)
Introduction
PowerKVM uses a Linux kernel to provide virtualization. In this exercise, you
install the base host image.
Requirements
• This workbook
• A workstation that is connected to a network
• Power server with OPAL firmware supporting PowerKVM
• Secondary system with IPMI utilities
• For virtual classroom a shared desktop solution
- IPMI sharing server
Preface
• All exercises of this unit depend on the availability of specific equipment in your
classroom. You need a computer system that is configured with a network connection to
your assigned host.
• Information provided for locating documentation on particular web pages was correct
when this course was written. However, web pages tend to change over time. Ask your
instructor if you have trouble navigating the websites.
• All hints that are marked by a » sign.
Important
Terminology that is used in this exercise. Node refers to the physical system. When the word node
is used, you are dealing with the server, or the FSP (or ASMI). Host refers to the operating system
installed. So IP information for the node and host are two different values.
__ 2. So you can monitor activity, open the Real-time progress indicator from your ASMI.
» From the System Information group, select Real-time Progress Indicator. You should
see a browser window appear similar to the following example:
Information
IPMI tools are available as part of most Linux distributions. There is also a version that can be
installed on other platforms also.
Information
The term chassis, when used with ipmitool command, does not refer to a PureFlex chassis, it
refers to the Power8 server.
EXempty __ 9. Monitor your system console as it boots, watching for Petitboot menu. There is a timeout
value for this menu, and there is no guarantee that it is set high enough to pause for you to
interrupt the boot process (if there is a valid OS on the disk, it will boot), you should plan on
using the keyboard to stop at the Petitboot menu. To accomplish this, use the up-arrow key
to change from the default Exit to shell option.
Network interfaces
eth0:
MAC: 98:be:94:58:82:80
link: down
. . .
eth2:
MAC: 98:be:94:58:54:d0
link: up
eth3:
MAC: 98:be:94:58:54:d2
link: down
. . .
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
x=exit, h=help
EXempty » Use the X key to exit menu. You should then see a configuration menu similar to the
following example:
Petitboot System Configuration
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Boot Order (0) Any Network device
(1) Any Device:
[ Add Device: ]
[ Clear & Boot Any ]
[ Clear ]
[ OK ] [ Help ] [ Cancel ]
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
tab=next, shift+tab=previous, x=exit, h=help
__ 12. If your system has a fixed IP address, verify it matches your lab system assignment.
» Use the arrow keys to maneuver within the menu. The IP values can be adjusted by
typing in the required value.
__ 13. If not already set, change the timeout value to 999. Change the Autoboot value by removing
the * in the field.
» Use the arrow keys to maneuver within the menu. The time value can be adjusted by
typing in the required value. The * can be removed with the space bar.
__ 14. Return to main Petitboot menu.
__ 15. Select Exit to shell option.
__ 16. The shell prompt gives you some limited ability. For example, you can access network
functions, such as telnet or ping. These commands can be used to verify network
access, or authenticate through a firewall.
From the shell prompt, ping the gateway assigned to your lab. this will verify your network is
active.
» The ping command works the same within the shell as from any OS command prompt
you have worked with.
__ 17. Return to the main Petitboot menu.
__ 18. Create a new boot option, using the n key.
» When you type n, the following menu will appear:
Petitboot Option Editor
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Kernel:
Initrd:
Device tree:
Boot arguments:
[ OK ] [ Help ] [ Cancel ]
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
tab=next, shift+tab=previous, x=exit, h=help
__ 19. From the Petitboot Option Editor, fill in the information required.
» Use the information provided by instructor to complete these steps.
Kernel:_____________________________
Initrd:______________________________
Device tree: Not needed
Boot arguments:______________________
EXempty » The following example shows the format required. While you might reduce the amount
of information provided at this point in the process, it is more convenient to input all of
this at the beginning of the installation.
kernel http://YOUR-SERVER-IP/PATH-TO-FILE/vmlinuz
initrd http://YOUR-SERVER-IP/PATH-TO-FILE/initrd.img
append root=live:http://YOUR-SERVER-IP/PATH-TO-FILE/squash.img
repo=http://YOUR-SERVER-IP/PATH-TO-FILE/packages rd.dm=0 rd.md=0
console=hvc0 console=tty0 ifname=net0:MAC-ADDRESS
ip=POWERKVM-HOST-IP::GATEWAY:NETMASK:HOSTNAME-DNS-ADDRESS:net0:none
nameserver=NAMESERVER-IP
__ 20. Once the information has been provided, use the tab or arrow key to highlight the OK box.
» Your menu should look similar to the following example, though IP information might be
different:
Petitboot Option Editor
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Kernel: http://192.168.2.1/export/vmlinuz
Initrd: http://192.168.2.1/export/initrd.img
Device tree:
Boot arguments: root=live:http://192.168.2.1//export/squashfs.img repo
[ OK ] [ Help ] [ Cancel ]
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
tab=next, shift+tab=previous, x=exit, h=help
__ 21. When you select OK, you will be returned to the main Petitboot menu. From this location
you use the Enter key to accept your entry. The installation should start at this point.
Information
You are now moving into a series of menu screens to complete the installation. Follow the steps to
complete the exercise.
Note
The version of PowerKVM might be different in the following examples from what you install on your
system.
__ 22. The first menu option is Choose a language. You can choose whatever language you want,
however the remaining exercise steps will assume you select English.
» Your menu should look similar to the following:
You use a simple password in class. You know you use a more complex password in
production!
__ 29. Set timezone to New York, and select UTC option.
» You can use the Page down key on your keyboard to search for New York. Use the tab
key to move within the menu to select UTC setting with space bar. Your menu should
EXempty » Within each field, you use the up or down arrow keys to change these values.Your
menus should look similar to the following:
__ 32. Configure network adapter menu. View the contents of this list, and compare to what you
saw in Petitboot menu. Proceed with installation (you will configure bridge device in a later
exercise).
» Since you created a device net0 with the boot string, the device is already configured.
Use the tab key to select OK. Your menu should look similar to the following (depending
on the server model):
__ 35. If PowerKVM exists on your host, you have one more chance to verify changes.
__ 37. Once the installation completes, you have to select Reboot to complete the process.
» Your menu should look similar to the following:
End of exercise
EXempty
Exercise 3. Navigating the basic PowerKVM
environment
(with hints)
Introduction
In this exercise, you access the command line and Kimchi to perform basic
administrative operations. These tools will be used the remainder of class.
Requirements
• This workbook
• A workstation that is connected to a network
• Power server with OPAL firmware supporting PowerKVM
• Secondary system with IPMI utilities
• For virtual classroom a shared desktop solution
- IPMI sharing server
© Copyright IBM Corp. 2016 Exercise 3. Navigating the basic PowerKVM environment 3-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
Preface
• All exercises of this unit depend on the availability of specific equipment in your
classroom. You need a computer system that is configured with a network connection to
your assigned host.
• Information provided for locating documentation on particular web pages was correct
when this course was written. However, web pages tend to change over time. Ask your
instructor if you have trouble navigating the websites.
• All hints are marked by a » sign.
Important
You will be working on the console at times during this class. This is not always the proper way to
access any system. The purpose of this is two-fold. First, our goal is to make you more comfortable
with the IPMI tool. Second, some configuration steps are not yet complete, so you will need console
access.
© Copyright IBM Corp. 2016 Exercise 3. Navigating the basic PowerKVM environment 3-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
SYNOPSIS
echo [--shell] [--xml] [<string>]...
DESCRIPTION
Echo back arguments, possibly with quoting.
OPTIONS
--shell escape for shell use
--xml escape for XML use
<string> arguments to echo
__ 7. Run help command to see available commands.
» The help command will show all available commands.
virsh # help
Grouped commands:
EXempty
Note
The following steps deal with listing commands. You will perform configuration changes in later
exercises.
© Copyright IBM Corp. 2016 Exercise 3. Navigating the basic PowerKVM environment 3-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
» While the iface-list command shows physical interfaces, the net-list command
shows network devices available to be assigned to guest VMs. PowerKVM is built with
two networks pre-defined, which you can see in the following example.
virsh # net-list
Name State Autostart Persistent
----------------------------------------------------------
default active yes yes
kop active yes yes
__ 16. List all node devices on your host system.
» Device nodes correspond to resources that an operating system's kernel has already
allocated. The command nodedev-list will show all such devices known to your host.
The following example has been shortened to save space. Your results will be much
longer.
virsh # nodedev-list
block_sda_1IBM_IPR_0_6AA1740000000020
block_sdb_1IBM_IPR_0_6AA1740000000060
block_sdc_1IBM_IPR_0_6AA1740000000040
block_sdd_1IBM_IPR_0_6A9E1600000000C0
. . .
__ 17. Exist from virsh command line, and return to the root prompt.
EXempty __ 21. Access the top of the browser window should be the Kimchi banner, with the various tabs of
operations available. The following exercise steps look at each of these in their default state.
» This example shows the Kimchi banner.
__ 22. Your session should default to the Host tab. If it does not, select the Host tab from the
banner. You should see general statistics for your host. Select each of the sections, and look
at information provided.
» Your system will show system statistics when you select the tab.
© Copyright IBM Corp. 2016 Exercise 3. Navigating the basic PowerKVM environment 3-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
__ 24. From the banner, select the Templates tab. Are there any templates?
» You copied 1ISO file to your host at the beginning of the exercise, this will not show up
until you define them. So, you should see no templates defined.
__ 25. From the banner, select Storage tab. View the available storage on your host.
EXempty » Depending on the version of PowerKVM, you can see different storage options. There
should be at least a selection named default. Later in this exercise you create extra
storage.
__ 26. From the banner, select Network. What networks are configured?
» You should have two networks available, default and kop. At this point, you cannot
create a guest VM that would have full access to the outside network. Later in this
exercise you create a bridge network.
__ 27. From the banner, select Administration. View the options available from this menu.
© Copyright IBM Corp. 2016 Exercise 3. Navigating the basic PowerKVM environment 3-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
» The Administration tab provides basic operations tools, such as firmware updates,
device configuration, and power management.
__ 28. This completes all exercise steps. You will use these two methods (CLI and Kimchi) in all
remaining exercises. Notify your instructor you have completed this exercise.
End of exercise
© Copyright IBM Corp. 2016 Exercise 3. Navigating the basic PowerKVM environment 3-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
EXempty
Exercise 4. Managing networks
(with hints)
Introduction
In this exercise, you will navigate the PowerKVM host to gather information
about network resources, and configure a bridge device for use by guests.
Requirements
• This workbook
• A workstation that is connected to a network
• Power server with OPAL firmware supporting PowerKVM
• Secondary system with IPMI utilities
• For virtual classroom a shared desktop solution
- IPMI sharing server
Preface
• All exercises of this unit depend on the availability of specific equipment in your
classroom. You need a computer system that is configured with a network connection to
your assigned host.
• Information provided for locating documentation on particular web pages was correct
when this course was written. However, web pages tend to change over time. Ask your
instructor if you have trouble navigating the websites.
• All hints are marked by a » sign.
Important
As mentioned in previous exercises, we will be working form the console during this lab. This is
because you will be deactivating the network at times, so all connections outside of the console will
be turned off. Only use the console when necessary!
__ 2. In the previous exercise, you used the virsh command iface-list to find all physical
adapters. Use a different command to list physical Ethernet adapters on your system.
» Use the command lspci to search for Ethernet devices, as in the following example:
# lspci |grep Ethernet
0002:01:00.0 Ethernet controller: Emulex Corporation OneConnect NIC (Lancer) (rev 30)
0002:01:00.1 Ethernet controller: Emulex Corporation OneConnect NIC (Lancer) (rev 30)
0002:01:00.2 Ethernet controller: Emulex Corporation OneConnect NIC (Lancer) (rev 30)
0002:01:00.3 Ethernet controller: Emulex Corporation OneConnect NIC (Lancer) (rev 30)
0003:05:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet
PCIe (rev 01)
0003:05:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet
PCIe (rev 01)
0003:05:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet
PCIe (rev 01)
0003:05:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet
PCIe (rev 01)
» This example shows two 4-port adapters (Emulex and Broadcom). The information for
the second adapter is too long for our page, so the line feeds.
What is the MAC address to the first adapter on your system?
» A simple method is to use the find command to identify the address file, and then the
cat command to show the contents of the file .../net0/address.
# find / -name address
/sys/devices/pci0002:00/0002:00:00.0/0002:01:00.0/net/enP2p1s0f0/address
/sys/devices/pci0002:00/0002:00:00.0/0002:01:00.1/net/enP2p1s0f1/address
. . .
# cat
/sys/devices/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:09.0/0003:05:00.0/net/ne
t0/address
98:be:94:01:6d:58
Information
The iface-list command provided the same information in a single operation. These exercise
steps showed the under-lying file structure where the information resides.
Important
Since you will probably have more than 1 Ethernet adapter, it is important to understand how to find
the physical device you are working with. Refer to system documentation to match the location
code to the physical device.
EXempty » The configuration files for managing network adapters. There should be a ifcfg file for
each network adapter on your system.
# ls
ifcfg-enP2p1s0f0 ifdown-eth ifup ifup-post
ifcfg-enP2p1s0f1 ifdown-ib ifup-aliases ifup-ppp
ifcfg-enP2p1s0f2 ifdown-ippp ifup-bnep ifup-routes
ifcfg-enP2p1s0f3 ifdown-ipv6 ifup-eth ifup-sit
ifcfg-enP3p5s0f1 ifdown-isdn ifup-ib ifup-tunnel
ifcfg-enP3p5s0f2 ifdown-ovs ifup-ippp ifup-wireless
ifcfg-enP3p5s0f3 ifdown-post ifup-ipv6 init.ipv6-global
ifcfg-lo ifdown-ppp ifup-isdn network-functions
ifcfg-net0 ifdown-routes ifup-ovs network-functions-ipv6
ifdown ifdown-sit ifup-plip
. . .
__ 5. View the content of the net0 file. What information is located in this file?
» The example below is ifcfg-net0:
# cat ifcfg-net0
# Generated by dracut initrd -> System generated message
NAME="net0"
HWADDR="98:be:94:01:6d:58" -> MAC address
DEVICE="net0" -> Device name
ONBOOT=yes -> Adapter is activated at boot. (no or yes)
NETBOOT=yes
UUID="110bb7c3-dedd-4f57-aee1-34af9fe3a6b8"
BOOTPROTO=none -> Boot protocol option (none, bootp, or DHCP)
IPADDR="129.40.227.71"
NETMASK="255.255.252.0"
GATEWAY="129.40.227.254"
TYPE=Ethernet -> Adapter type
DNS1="129.40.106.1"
__ 6. Navigate to the directory /etc/libvirt/qemu/networks. What are the contents?
» These are network XML configuration files. Your system should have two active files,
default.xml and kop.xml.
__ 7. View contents of default.xml file. Are there any important messages?
<network>
<name>default</name>
<uuid>16be8de2-0b74-4716-85dd-293cff443018</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:7e:95:36'/>
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254'/>
</dhcp>
</ip>
</network>
__ 8. View contents of kop.xml file. Is there any significant difference in this file compared to the
default.xml file?
» Structurally they are the same, though each file provides unique information for the
network definition.
# cat kop.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made
using:
virsh net-edit kop
or other application using the libvirt API.
-->
<network>
<name>kop</name>
<uuid>123d4550-83b3-49a4-b487-8c1c8c16210e</uuid>
<bridge name='virbr1' stp='on' delay='0'/>
<mac address='52:54:00:04:e0:38'/>
<ip address='192.168.121.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.121.2' end='192.168.121.254'/>
</dhcp>
</ip>
</network>
Important
The following steps should be performed on your system to create a bridge device.
EXempty » Select the Actions button that is associated to the new device br0, and select Start
from sub-menu.
__ 23. The previous command gave a lot of information. Narrow your search for port 8001 (the port
KImchi uses to access the system).
» Use the same command as the previous step, add a grep search for 8001.
# iptables -L -v -n |grep 8001
12 624 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:8001
ctstate NEW
1+1
=2 Example
The next two sections create the same device via different methods. Since the system cannot have
multiple instances of a bridge on the same device, these are provided as examples only.
__ 26. From the root prompt, type configure-system. Your screen should look similar to the
following example:
__ 27. Select Configure Network option. Your menu should change to the Configure Network
menu, similar to the following:
+--------------+ Configure network +--------------+
| |
| Select the device on the list to be configured: |
| enP2p1s0f0 [ 00:90:fa:95:32:64 ] (DOWN) ^ |
| enP2p1s0f1 [ 00:90:fa:95:32:65 ] (DOWN) # |
| enP2p1s0f2 [ 00:90:fa:95:32:66 ] (UP) : |
| enP2p1s0f3 [ 00:90:fa:95:32:67 ] (UP) : |
| enP3p5s0f0 [ 98:be:94:01:6d:58 ] (UP) v |
| +----+ +------+ |
| | OK | | Back | |
| +----+ +------+ |
| |
| |
+-------------------------------------------------+
__ 28. When you installed the system, you selected the adapter that was active. Find the adapter
on this menu, and select. Using the arrow keys, move the selection to the appropriate line,
then use the Tab key to move the selection to OK. Press enter.
__ 29. Create a network bridge to that adapter. Our example shows the device enP3p5s0f0. Using
the Tab or Arrow key, move to the line Create a Network Bridge (brenP3p5s0f0) and use
the Space bar to activate the selection.
Information
If you are working in a larger environment, the best practice is not to create a bridge using this
method, as more advanced operations such as moving a guest to a difference physical server may
be impacted by the name of the bridge. If you are working in a smaller environment, then this
process will not create issues.
EXempty __ 30. From the main menu, scroll down, and select Exit. The Exit option will not show up until you
scroll down the menu.
1+1
=2 Example
This section continues the demonstration process of creating a network bridge. Since you already
created a bridge in the first section these steps cannot be performed on your lab system.
End of exercise
EXempty
Exercise 5. Storage operations
(with hints)
Introduction
In this exercise, you will define storage pools, and create volumes within that
defined space.
Requirements
• This workbook
• A workstation that is connected to a network
• Power server with OPAL firmware supporting PowerKVM
• Secondary system with IPMI utilities
• For virtual classroom a shared desktop solution
- IPMI sharing server
Preface
• All exercises of this unit depend on the availability of specific equipment in your
classroom. You need a computer system that is configured with a network connection to
your assigned host.
• Information provided for locating documentation on particular web pages was correct
when this course was written. However, web pages tend to change over time. Ask your
instructor if you have trouble navigating the websites.
• All hints are marked by a » sign.
» This information will show physical location code. As we discussed previously, this can
be critical information when dealing with Power servers.
# lscfg |grep sd
+ sdg U78CB.001.WZS0663-P1-C11-B0-T0-L0
+ sdh U78CB.001.WZS0663-P1-C11-B0-T0-L1
+ sdi U78CB.001.WZS0663-P1-C11-B0-T0-L0
+ sdj U78CB.001.WZS0663-P1-C11-B0-T0-L1
+ sda U78CB.001.WZS0663-P1-C14-B2-T0-L0
+ sdb U78CB.001.WZS0663-P1-C14-B2-T1-L0
+ sdc U78CB.001.WZS0663-P1-C14-B2-T2-L0
. . .
__ 4. List all storage pools on your system.
» Use the virsh command pool-list to show this information.
# virsh pool-list
Name State Autostart
-------------------------------------------
default active no
ISO active no
Information
There is no requirement that directory-based storage pools use the name of the directory. We are
using this for consistency, and convenience.
__ 6. Using the command line, create a new pool, named pool_1, with the backing device as
/pool_1.
» The virsh command pool-create-as with accomplish this.
# virsh pool-create-as pool_1 dir --target /pool_1
Pool pool_1 created
__ 7. List contents of /run/libvirt/storage directory.
» You should see an XML file for the new storage pool.
# ls /run/libvirt/storage
ISO.xml default.xml pool_1.xml
/run/libvirt/storage:
ISO.xml default.xml pool_1.xml
__ 11. Using the proper virsh command, list all pools on your system.
» Unlike the previous step of listing pools, run the command with --all as part of
command. In our example, you can see pool_1 is active, even though it is not a
“permanent” pool (rebooting the system will remove this entry). The pool_2 entry is not
yet active.
# virsh pool-list --all
Name State Autostart
-------------------------------------------
default active no
ISO active no
pool_1 active no
pool_2 inactive no
__ 12. Activate pool_2 from the command line.
» The virsh command pool-start will accomplish this. Start pool_2, and then list active
pools on your host.
# virsh pool-start pool_2
Pool pool_2 started
# virsh pool-list
Name State Autostart
-------------------------------------------
default active no
ISO active no
pool_1 active no
pool_2 active no
__ 13. Open a browser window to your host Kimchi session.
__ 14. From the Storage tab, show all active storage pools.
» You should see all four pools that the virsh command showed previously.
__ 15. Using Kimchi, create a new storage pool, pool_3, using the directory mount point /pool_3
as a location.
EXempty » Use the to create the new storage pool, as in the following example:
__ 16. Verify the new pool exists, and activate from Kimchi.
» Use the Actions option, and select Activate.
__ 17. Return to your terminal session. List the contents of the directories
/etc/libvirt/storage and /run/libvirt/storage. Is there any difference?
» Since you activated the new storage pool you just defined, it now appears in the run
directory tree.
# ls /etc/libvirt/storage /run/libvirt/storage
/etc/libvirt/storage:
ISO.xml default.xml pool_2.xml pool_3.xml
/run/libvirt/storage:
ISO.xml default.xml pool_1.xml pool_2.xml pool_3.xml
__ 18. View the XML configuration files for pool_3 in both /run/libvirt/storage and
/etc/libvirt/storage directories. What is different about the two files?
» The file in /run/libvirt/storage is the same file, but with the XML tag poolstate
wrapping the contents.
EXempty » The following example shows these two files. Your system should look similar.
# cat /etc/libvirt/storage/pool_3.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh pool-edit pool_3
or other application using the libvirt API.
-->
<pool type='dir'>
<name>pool_3</name>
<uuid>b1f0abae-6289-4242-92dd-d0ae217e1d5b</uuid>
<capacity unit='bytes'>0</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>0</available>
<source>
</source>
<target>
<path>/pool_3</path>
</target>
</pool>
# cat /run/libvirt/storage/pool_3.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh pool-edit pool_3
or other application using the libvirt API.
-->
<poolstate>
<pool type='dir'>
<name>pool_3</name>
<uuid>b1f0abae-6289-4242-92dd-d0ae217e1d5b</uuid>
<capacity unit='bytes'>0</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>0</available>
<source>
</source>
<target>
<path>/pool_3</path>
</target>
</pool>
</poolstate>
Note
If you are unsure of what local disks exist, you can use the lsblk command to find them.
» Confirm the operation. The warning reminds you that there might be some content on
the target disk.
EXempty » The Actions box provides an additional option with logical storage, Extend. In this case
you will simply use Activate.
» The box next to the Actions box should be clicked to expand the view. This will show all
volumes contained in the storage pool.
__ 26. Create another volume in pool_2, named class_vol_2. For this instance, specify the format
as qcow2, set allocation to 4 G, and name the file class_vol_2.qcow2.
» You will use the same command, with more details, as in the following example:
# virsh vol-create-as pool_2 class_vol_2.qcow2 --format qcow2 5G --allocation 4G
Note
When creating a volume, it is not a requirement to name the file with the extension matching the
volume type. As a simple way to identify the file as this type you can add the extension. We will see
later how to identify the volume type.
From the Kimchi session, is there any difference between the volumes shown?
» The new volume shows the same capacity, but a smaller allocation value.
__ 27. List the file types in the directory /pool_2 to see the new volumes.
EXempty » The virsh command vol-list will not show this information. One way to get this
information is to use the Linux command file.
# file /pool_2/*
/pool_2/class_vol_1: data
/pool_2/class_vol_2.qcow2: QEMU QCOW Image (v2), 5368709120 bytes
The virsh command vol-create-as requires arguments to complete. The command
vol-create requires an XML file for use to define what the volume will look like. What
does this XML file look like?
» When you create a volume, there is no XML file created with it (with the directory-backed
volumes we are working with in these examples). So, use the virsh command
vol-dumpxml to build an XML file as a sample you might use to create more volumes.
# virsh vol-dumpxml --vol class_vol_2.qcow2 --pool pool_2
<volume type='file'>
<name>class_vol_2.qcow2</name>
<key>/pool_2/class_vol_2.qcow2</key>
<source>
</source>
<capacity unit='bytes'>5368709120</capacity>
<allocation unit='bytes'>200704</allocation>
<target>
<path>/pool_2/class_vol_2.qcow2</path>
<format type='qcow2'/>
<permissions>
<mode>0600</mode>
<owner>0</owner>
<group>0</group>
<label>system_u:object_r:default_t:s0</label>
</permissions>
<timestamps>
<atime>1449694254.088109408</atime>
<mtime>1449694182.458102245</mtime>
<ctime>1449694182.468102246</ctime>
</timestamps>
</target>
</volume>
This concludes formal exercise steps. If time permits, and additional lab equipment is available,
continue to the optional exercise. If no SAN is attached, you can continue to experiment with the
storage resources.
End of exercise
Note
If your lab environment has SAN storage preconfigured for your system, these optional exercises
can be performed. Your instructor will notify you if this equipment is available.
__ 3. Using host2, create a new storage pool, named pool_FC, from your Kimchi session.
EXempty » Once you select the storage pool type of SCSI Fibre Channel, you will see a list of
adapters. You can only select one adapter from the list.
__ 4. Expand the view of the new storage pool. Are any volumes in place?
» If the lab environment is set up correctly, you should see at least one volume in place.
Our example has two volumes, each 5 G in size. The name is defined by the LUN value
associated to each device on the storage server side.
__ 5. View the contents of the XML configuration file for your new storage pool.
» The directory /etc/libvirt/storage contains the XML files. Look in this directory
for the file pool_FC.xml.
# cat /etc/libvirt/storage/pool_FC.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh pool-edit pool_FC
or other application using the libvirt API.
-->
<pool type='scsi'>
<name>pool_FC</name>
<uuid>435b40fa-5b71-472b-b711-0221a2c2a1e1</uuid>
<capacity unit='bytes'>0</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>0</available>
<source>
<adapter type='fc_host' wwnn='20000120fa89c09e' wwpn='10000090fa89c09e'/>
</source>
<target>
<path>/dev/disk/by-path</path>
</target>
</pool>
__ 6. Copy the file /etc/libvirt/storage/pool_VC.xml to
/etc/libvirt/storage/pool_FC_2.xml. Edit the new file, replacing the values for the
pool name, uuid (change any number in the string) and wwn (using host3 information for
the proper wwn).
» You can either use the systool command, or view the Kimchi session to get this
information.
__ 7. Define a new storage pool with the XML file you just created.
» The virsh command pool-define will accomplish this.
# virsh pool-define /etc/libvirt/storage/pool_FC_2.xml
Pool pool_FC_2 defined from /etc/libvirt/storage/pool_FC_2.xml
__ 8. List all storage pools on your system at this point.
EXempty » The virsh command pool list --all will show this information. If you do not use the
--all argument, you will not see inactive pools.
# virsh pool-list --all
Name State Autostart
-------------------------------------------
default active no
ISO active no
pool_1 active no
pool_2 active no
pool_3 active no
pool_4 active yes
pool_FC active yes
pool_FC_2 inactive no
__ 9. Run the command systool to gather information about your installed FC adapters
(fc_host).
» As shown during the unit discussion, the systool command is one of many ways to
find information about system resources, including FC adapters. Run the command as
in the following example (output truncated to save space).
# systool -c fc_host -v
Class = "fc_host"
» This command shows you what devices are connected “downstream”. If you get no
output, your host is not communicating with any system. In our example below, host2
sees the WWN 500507680200144b from the target device.
# systool -c fc_transport -v
Class = "fc_transport"
EXempty » Setup separately to your host is a storage server with iSCSI enabled. Select the storage
pool type, then you will be provided with a selection box for the iSCSI server. Enter the
IP address information, and then click the Target box. As the example below shows, a
storage server at IP address 129.40.224.47 has a iSCSI target
iqn.1986-03.com.ibm:2145.usse-v7000-5.node1. Your lab system will be different.
Troubleshooting
If the volume does not appear, you might have to restart the iSCSI daemon. Use the following steps
to accomplish this:
systemctl stop iscsid
systemctl stop iscsi
systemctl start iscsid
systemctl start iscsi
systemctl status iscsi
You might also have to force the PowerKVM host to acknowledge the iSCSI server:
iscsiadm --mode discovery --type sendtargets --portal <iSCSI_server_IP_Address>
__ 16. List the contents of the directory /etc/libvirt/storage. All the defined storage pools
are in place. View the file pool_iSCSI.xml to see the configuration.
__ 17. Notify your instructor that you have completed the optional exercise.
End of exercise
EXempty
Exercise 6. Creating templates
(with hints)
Introduction
In this exercise, you will create and edit template definitions.
Requirements
• This workbook
• A workstation that is connected to a network
• Power server with OPAL firmware supporting PowerKVM
• Secondary system with IPMI utilities
• For virtual classroom a shared desktop solution
- IPMI sharing server
Preface
• All exercises of this unit depend on the availability of specific equipment in your
classroom. You need a computer system that is configured with a network connection to
your assigned host.
• Information provided for locating documentation on particular web pages was correct
when this course was written. However, web pages tend to change over time. Ask your
instructor if you have trouble navigating the websites.
• All hints are marked by a » sign.
__ 6. Select the RedHat v7.1 BE ISO image you copied to your host previously.
» Click the selected image, and click the Create Template bar.
__ 7. From the Template window, select the new template, and from the Action bar, select Clone.
» This creates a duplicate of the original template.
__ 8. Your Templates menu should now have a new entry. The name will look the same as the
original, but it has the extension -clone1 added to the name. Hover your mouse over the
image to see this.
» The name is built from the source ISO. We will change this in the following step.
__ 9. Select the newly created template. Click Actions button, and select Edit.
» This brings up a new menu showing the configuration of the template.
__ 10. Set the name of the new template to rhel7.1-BE, double the memory value, and change the
network interface to the bridge network.
» From the General tab, set the name of the template to rhel7.1.BE, and the memory
from 2048 to 4096.
EXempty » Select the Interface tab, and change to the br0 bridge network.
__ 11. Create a new template using the other ISO image, RHEL7.1-LE. After creation, edit the
template, setting the name to rhel7.1-LE, memory to 4096, and interface to br0.
» At this point you will have three templates defined.
Important
If your lab environment does not have Internet access, the following steps will not work.
__ 13. From your Kimchi session, select Template tab, then Remote ISO Image option.
» The Remote ISO Image selection has a globe.
» Since this is being written well before you attend the class, we cannot guarantee what
images will be available. You will most likely see Fedora or Ubuntu ISO images
available.
__ 15. View all templates, can you see any difference between the local ISO templates and the
remote ISO templates?
» The remote templates have a globe ICON, while the local ISO templates have a file
drawer.
[main]
# Memory in MB
#memory = 1024
[storage]
# Storage pool used to handle the guest disk
#pool = default
. . .
__ 18. Notify your instructor that you have completed this exercise.
End of exercise
EXempty
Exercise 7. Define and install Guests
(with hints)
Introduction
In this exercise, you will define and install guest VM’s.
Requirements
• This workbook
• A workstation that is connected to a network
• Power server with OPAL firmware supporting PowerKVM
• Secondary system with IPMI utilities
• For virtual classroom a shared desktop solution
- IPMI sharing server
© Copyright IBM Corp. 2016 Exercise 7. Define and install Guests 7-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
Preface
• All exercises of this unit depend on the availability of specific equipment in your
classroom. You need a computer system that is configured with a network connection to
your assigned host.
• Information provided for locating documentation on particular web pages was correct
when this course was written. However, web pages tend to change over time. Ask your
instructor if you have trouble navigating the websites.
• All hints are marked by a » sign.
© Copyright IBM Corp. 2016 Exercise 7. Define and install Guests 7-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
» The warning message shows the new storage device will be cloned to the default
storage pool. Since the original guest was defined to use the default pool, this will not
make a big difference.
EXempty » In our example, you see the fulmer2 guest, and a new guest named fulmer2-clone-1.
(your guest name will be different).
__ 8. Return to your terminal session, and list the contents of the directory
/etc/libvirt/qemu.
» The XML configuration files exist in this space.
# ls -al /etc/libvirt/qemu
total 20
drwx------. 3 root root 4096 Dec 11 18:05 .
drwx------. 5 root root 4096 Dec 8 17:19 ..
-rw-------. 1 root root 3206 Dec 11 17:45 fulmer2-clone-1.xml
-rw-------. 1 root root 3190 Dec 11 17:15 fulmer2.xml
drwx------. 3 root root 4096 Dec 8 18:17 networks
__ 9. View the files, and then display the differences. What is the important message at the top of
the file?
© Copyright IBM Corp. 2016 Exercise 7. Define and install Guests 7-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
» The first line in each file is a warning to only edit the file with virsh edit command.
The differences can be seen easily with the Linux command diff.
# more fulmer2.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh edit fulmer2
or other application using the libvirt API.
Note
The next two topics deal with installing RedHat v7.1. The exercise steps do not require in-depth
knowledge of the installation process, and you will not perform advanced configuration steps. This
course is not designed as a Linux administration course. As a convenience, we have blocked out
the steps to install RedHat.
__ 15. Open the LiveTime window to view the guest console. Start the installation.
© Copyright IBM Corp. 2016 Exercise 7. Define and install Guests 7-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
__ 16. The RedHat menu will provide a marker telling you what items need to be modified before
the installation can continue. Select the required items to make adjustments.
» Our example shows the Installation Destination as the only required adjustment (just
scrolling off the bottom of the menu):
__ 17. Select the Installation Destination option, verify the correct target device exists,
EXempty » In our guest template, we have only configured a single device, so you should only see
that as an option. All you have to do is select Done to proceed. (If you click the target
disk in this case, you are actually reseting the selection.)
__ 18. While not required, select the Network & Hostname option.
» You can install the system without activating the network, though you will configure at
this point.
__ 19. From the Network & Hostname menu, configure the hostname, set a static address, and
activate the interface,
© Copyright IBM Corp. 2016 Exercise 7. Define and install Guests 7-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
» Our example shows these items as the default choices. Edit the hostname field (lower
left) select the On option (upper right), and select Configure box to set static address.
» Select IPv4 tab, change from DHCP to Manual, and set the IP address, netmask, and
gateway as required in your lab environment.
» When you return to the main menu, the Network & Host Name icon will show
connected.
__ 21. The next menu shows the installation process, and the status indicator line will continue to
update as the installation continues.
» Our example shows that the installation menu still expects passwords to be set.
» You will see a warning that the password is too simple. Select Done once again to
continue.
© Copyright IBM Corp. 2016 Exercise 7. Define and install Guests 7-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
EXempty
Note
This exercise is intended to show the virt-install command operation. If you are unable to
accomplish the installation (unsure of fields, or other errors reported), continue to next exercise
section.
Information
When using the virt-install command, you can use the automated installation options
provided by the distribution (such as kickstart for RedHat, or preseed for Ubuntu). Our lab step was
only focused on the conceptual aspect of the virt-install command.
End of exercise
© Copyright IBM Corp. 2016 Exercise 7. Define and install Guests 7-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises with hints
EXempty
Exercise 8. Host management
(with hints)
Introduction
In this exercise, you access the command line to perform basic
administrative operations, such as viewing log files, configuring guest
configuration, and managing other resources.
Requirements
• This workbook
• A workstation that is connected to a network
• Power server with Sapphire firmware supporting PowerKVM
• Secondary system with IPMI utilities
• For virtual classroom a shared desktop solution
- IPMI sharing server
Preface
• All exercises of this unit depend on the availability of specific equipment in your
classroom. You need a computer system that is configured with a network connection to
your assigned host.
• Information provided for locating documentation on particular web pages was correct
when this course was written. However, web pages tend to change over time. Ask your
instructor if you have trouble navigating the websites.
• All hints are marked by a » sign.
Information
The initial sections are intended to identify various key files and subdirectories. You will not make
any changes to the system configuration.
# uname -a
Linux host1.rtp.stglabs.ibm.com 3.10.42-2012.1.pkvm2_1_1.31.ppc64 #1 SMP Fri
Sep 19 11:45:18 CDT 2014 ppc64 ppc64 ppc64 GNU/Linux
__ 3. View the contents of the directory /var/lib/libvirt. What have you used from this
directory in class?
» The subdirectory images contains the ISO image you installed a guest from. While not
required to reside in this location, the directory tree provides a logical point for these ISO
files.
__ 4. Change your location to /etc/libvirt. View the contents of this subdirectory.
» Use the ls command to see the contents.
# ls
boot dnsmasq filesystems images lxc network qemu sanlock
__ 5. Follow the subdirectory tree to storage, then to autostart. What do you see?
» There should be an XML file for each storage pool that is defined on your host
# ls
ISO.xml default.xml pool_1.xml pool_2.xml
__ 6. Change your location to the /sys/fs/cgroup directory. From this location, do a search for
files named machine. What do you see?
» Each guest VM has information about their configuration that is located in this directory
tree. The subdirectory machine under each category contains configuration information
for that guest.
# find . -name machine
./perf_event/machine
./blkio/machine
./net_cls/machine
./freezer/machine
./devices/machine
./memory/machine
./cpu,cpuacct/machine
./cpuset/machine
./systemd/machine
EXempty » You should see an event message from your failed FW update.
# tail kimchi-error.log
rc: 10 error: serviceable event provider is not running
returned from cmd: /opt/ibm/seprovider/bin/sepcli status
serviceable event provider is not running
__ 16. The names provided are files located in your current directory. Select the first file in your
current directory, and use the opal-elog-parse command to view the contents.
# opal-elog-parse -a 1410975695-0x50dc3253 |more
|------------------------------------------------------------------------------
|
| Private Header |
|------------------------------------------------------------------------------
|
| Section Version : 1 (PH) |
| Sub-section type : 0x0 |
| Section Length : 0x30 |
| Component ID : 9500 |
| Created at : 2014-09-17 | 17:23:34 |
| Committed at : 2014-09-17 | 17:23:34 |
| Created by : Service Processor |
. . .
EXempty
Important
In order to run PowerKVM on the IBM Power Systems, the SMT option needs to be turned off in the
hypervisor. The SMT feature will only be visible inside the guests, other than on the hypervisor.
» Depending on the number of processors in your lab system, your results will vary. Our
example shows 8 cores available to the host. The “*” in the first column shows enabled
threads.
# ppc64_cpu --info
Core 0: 0* 1 2 3
Core 1: 4* 5 6 7
Core 2: 8* 9 10 11
Core 3: 12* 13 14 15
Core 4: 16* 17 18 19
Core 5: 20* 21 22 23
Core 6: 24* 25 26 27
Core 7: 28* 29 30 31
# ppc64_cpu --frequency
min: 3.304 GHz (cpu 24)
max: 3.304 GHz (cpu 8)
avg: 3.304 GHz
__ 19. Display the contents of the file /proc/meminfo to see available memory resources.
» Are sample system has 64 GB of RAM installed.
# cat meminfo
MemTotal: 65899840 kB
MemFree: 56807104 kB
Buffers: 208896 kB
Cached: 5510720 kB
SwapCached: 0 kB
Active: 4081664 kB
Inactive: 4076288 kB
__ 20. View the contents of the file /proc/cpuinfo.
processor : 4
cpu : POWER7 (raw), altivec supported
clock : 3304.000000MHz
revision : 2.3 (pvr 003f 0203)
. . .
__ 21. Use the top command to show host performance.
» The top command output is screen based, just as it is with other Linux distributions.
top - 17:48:42 up 1 day, 3:57, 2 users, load average: 0.15, 0.16, 0.14
Tasks: 339 total, 73 running, 264 sleeping, 0 stopped, 2 zombie
%Cpu(s): 0.1 us, 0.2 sy, 0.0 ni, 99.5 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 65899840 total, 9087936 used, 56811904 free, 203904 buffers
KiB Swap: 8384448 total, 0 used, 8384448 free, 5508992 cached
. . .
__ 22. Use the mpstat command to show performance information over 8 seconds, every 2
second intervals.
» Our example shows the first two lines of a sample output.
# mpstat 2 8
Linux 3.10.42-2012.1.pkvm2_1_1.27.ppc64 (unode44-1.rtp.stglabs.ibm.com)
09/18/14 _ppc64_ (32 CPU)
17:49:07 CPU %usr %nice %sys %iowait %irq %soft %steal %guest
%gnice %idle
17:49:09 all 0.19 0.00 0.12 0.00 0.00 0.00 0.00 0.00
0.00 99.69
17:49:11 all 0.12 0.00 0.19 0.25 0.00 0.00 0.00 0.00
0.00 99.44
Average: all 0.16 0.00 0.16 0.12 0.00 0.00 0.00 0.00
0.00 99.56
__ 23. Use the pidstat command to look at process ID activity.
EXempty » Just as with other performance related commands, you can see performance
information about the host.
# pidstat
Linux 3.10.42-2012.1.pkvm2_1_1.27.ppc64 (unode44-1.rtp.stglabs.ibm.com)
09/18/14 _ppc64_ (32 CPU)
Information
This topic deals with guest VM configuration. You will make changes to your guest VM to see what
affects they have.
virsh # list
Id Name State
----------------------------------------------------
4 hostname-2 running
7 hostname-3 running
9 hostname-4 running
__ 26. Open a console session to the last guest you installed (guest #4).
__ 27. View the contents of the file /proc/cpuinfo, what do you see?
» You should see two processors configured.
# cat /proc/cpuinfo
processor : 0
cpu : POWER7 (architected), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
processor : 1
cpu : POWER7 (architected), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
timebase : 512000000
platform : pSeries
model : IBM pSeries (emulated by qemu)
machine : CHRP IBM pSeries (emulated by qemu)
__ 28. From the second terminal session, set the CPU shares for the last guest VM you configured
(guest 4) to 256.
EXempty » From the virsh prompt, use the edit command. Move to the bottom of the file, just
before the last line, and add the following three lines:
<cputune>
<shares>256</shares>
</cputune>
» Close the file, and then re-open. Where is the cputune element now? The XML editor
has placed it in the first part of the file.
<vcpu placement='static'>2</vcpu>
<cputune>
<shares>256</shares>
</cputune>
<os>
<type arch='ppc64' machine='pseries-2.2'>hvm</type>
__ 29. Set the CPU compatibility to POWER6 mode.
» Edit the guest VM XML file, and add the text as follows:
<cpu mode=’custom’>
<model>power6</model>
</cpu>
» Close the file, and then re-open. You should see the cpu compatibility element has been
positioned correctly.
<apic/>
</features>
<cpu mode='custom' match='exact'>
<model fallback='allow'>power6</model>
</cpu>
<clock offset='utc'/>
__ 30. Return to the first terminal session, reboot the guest (shutdown -r now). Once the
system reboots, look at the contents of /proc/cpuinfo. Has it changed?
» No, the XML file will only be read if the guest is completely shutdown.
__ 31. Shutdown the last guest completely. Once the shutdown is complete, return to the second
terminal session and start the guest.
» From the virsh prompt, start guest-4 (use the correct guest name).
__ 32. When the guest restarts, return to the first terminal session and login to console. View the
contents of the file /proc/cpuinfo. What do you see?
processor : 1
cpu : POWER6 (architected), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
timebase : 512000000
platform : pSeries
model : IBM pSeries (emulated by qemu)
machine : CHRP IBM pSeries (emulated by qemu)
__ 33. Change the SMT setting using the following text:
<vcpu placement=’static’>4</vcpu>
<cpu>
<model>power7</model>
<topology sockets’1’ cores=’2’ threads=’4’/>
</cpu>
What happens?
» The text string is incorrect, and the editor will warn you of the failure.
Failed. Try again? [y,n,f,?]:
error: (domain_definition):68: Specification mandate value for attribute sockets
<topology sockets'1' cores='2' threads='2'/>
-----------------^
Failed. Try again? [y,n,f,?]:
» Fix the error by adding a “=” after sockets.
__ 34. On PowerKVM host, issue command virsh dominfo hostname-4 (replace correct value
for hostname-4).
EXempty » Our example shows the active guest running with 4 GB memory maximum.
# virsh dominfo hostname-4
Id: 7
Name: hostname-4
UUID: ec6a3e0f-9d94-427b-8b41-a47c9a3ccc65
OS Type: hvm
State: running
CPU(s): 2
CPU time: 27.4s
Max memory: 4194304 KiB
Used memory: 4194304 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c232,c460 (enforcing)
__ 35. Set the maximum memory for guest 4 to double the current value. What happens when you
try this?
» This command can only work when the domain is inactive.
# virsh setmaxmem hostname-4 8388608 --config --live
error: Unable to change MaxMemorySize
error: Requested operation is not valid: cannot resize the maximum memory
on an active domain
__ 36. Shut down the guest 4 domain.
» Use the destroy option to the virsh command.
# virsh destroy hostname-4
Domain hostname-4 destroyed
__ 37. Try the setmaxmem command again (without the “live” option).
» The command should work now that the domain is inactive.
__ 38. View the domain information, what has changed?
» The Max memory value should have changed to match the new assignment.
# virsh dominfo hostname-4
Id: -
Name: hostname-4
UUID: ec6a3e0f-9d94-427b-8b41-a47c9a3ccc65
OS Type: hvm
State: shut off
CPU(s): 2
Max memory: 8388608 KiB
Used memory: 4194304 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
__ 39. The domain still only has 4 GB of memory used at this point. Use the virsh command to
use the full memory available.
» The setmem option to the virsh command will perform this operation, as in the
example below.
# virsh setmem hostname-4 8388608 --config --live
__ 40. View the domain settings again for your guest 4 domain. Has the memory values changed?
» You should now see both Max and Used memory values as the same.
# virsh dominfo hostname-4
Id: 14
Name: hostname-4
UUID: ec6a3e0f-9d94-427b-8b41-a47c9a3ccc65
OS Type: hvm
State: running
CPU(s): 2
CPU time: 18.7s
Max memory: 8388608 KiB
Used memory: 8388608 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: system_u:system_r:svirt_t:s0:c307,c686 (enforcing)
__ 41. Notify instructor you have completed this exercise.
End of exercise
EXempty
Appendix A. Exercise data sheet
The following information is required to complete exercises:
The following information is required to complete the Installing PowerKVM host exercise:
Web server IP
Kernel
Initrd
Boot args
Storage server IP
iSCSI initiator name
backpg
Back page