Showing posts with label Red Hat. Show all posts
Showing posts with label Red Hat. Show all posts

Friday, January 23, 2015

Linux : mount.nfs: Input/output error

Problem:

Red Hat 5

# mount /u00
mount.nfs: Input/output error

Solution :
service portmap start
chkconfig portmap on
chkconfig nfs on
chkconfig netfs on

Linux : mount.nfs: rpc.statd is not running but is required for remote locking

Problem:

# mount -t nfs 10.10.100.20:/vol/test1/NFSDS01 /mnt
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

But rpc.statd is running
$ ps -ef | grep rpc.statd
rpcuser 2578 1 0 16:18 ? 00:00:00 rpc.statd
rpcuser 4824 1 0 16:21 ? 00:00:00 rpc.statd --no-notify
rpcuser 4867 1 0 16:22 ? 00:00:00 rpc.statd --no-notify
rpcuser 9287 1 0 17:05 ? 00:00:00 rpc.statd --no-notify
rpcuser 10235 1 0 17:15 ? 00:00:00 rpc.statd --no-notify

Solution:

vi /etc/hosts.allow

rpcbind portmap nfsd statd mountd lockd: 127.0.0.1 10.10.100.20 : ALLOW

Thursday, January 22, 2015

Linux : Create a 1G empty file

# dd if=/dev/zero of=1g.img bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 54.018 s, 19.9 MB/s

# ll 1g.img
-rw-r----- 1 root root 1073741824 Jan 22 14:03 1g.img

# stat 1g.img
  File: `1g.img'
  Size: 1073741824      Blocks: 2105424    IO Block: 65536  regular file
Device: 13h/19d Inode: 97          Links: 1
Access: (0640/-rw-r-----)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-01-22 14:03:05.231563000 -0500
Modify: 2015-01-22 14:03:59.115150000 -0500
Change: 2015-01-22 14:03:59.115150000 -0500

Thursday, October 23, 2014

Linux : NFS : Some NFS file systems are not mounted after reboot

Problem : Some NFS file systems are not mounted after reboot

Solution : Add options to /etc/fstab

Original fstab :

10.11.200.101:/test /test           nfs     rw      0 0

After :
10.11.200.101:/test /test           nfs     rw,bg,hard,rsize=32768,wsize=32768,vers=3      0 0

Also the following services need to be turned on

chkconfig nfs on
chkconfig portmap on
chkconfig netfs on



Tuesday, September 30, 2014

Linux : Multipath

Server A :

# multipath -ll
3600a098044316b37365d436b476e564f dm-2 NETAPP,LUN C-Mode
size=15G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:0:2 sdd 8:48   active ready running
| |- 1:0:1:2 sdg 8:96   active ready running
| |- 2:0:0:2 sdp 8:240  active ready running
| `- 2:0:1:2 sds 65:32  active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 1:0:2:2 sdj 8:144  active ready running
  |- 1:0:3:2 sdm 8:192  active ready running
  |- 2:0:2:2 sdv 65:80  active ready running
  `- 2:0:3:2 sdy 65:128 active ready running
3600a098044316b37305d44353075674e dm-1 NETAPP,LUN C-Mode
size=500G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:2:1 sdi 8:128  active ready running
| |- 1:0:3:1 sdl 8:176  active ready running
| |- 2:0:2:1 sdu 65:64  active ready running
| `- 2:0:3:1 sdx 65:112 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 1:0:0:1 sdc 8:32   active ready running
  |- 1:0:1:1 sdf 8:80   active ready running
  |- 2:0:0:1 sdo 8:224  active ready running
  `- 2:0:1:1 sdr 65:16  active ready running
3600a098044316b37305d44353075674d dm-0 NETAPP,LUN C-Mode
size=500G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:2:0 sdh 8:112  active ready running
| |- 1:0:3:0 sdk 8:160  active ready running
| |- 2:0:2:0 sdt 65:48  active ready running
| `- 2:0:3:0 sdw 65:96  active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 1:0:0:0 sdb 8:16   active ready running
  |- 1:0:1:0 sde 8:64   active ready running
  |- 2:0:0:0 sdn 8:208  active ready running
  `- 2:0:1:0 sdq 65:0   active ready running

Server B:
# multipath -ll
3600a098044316b37365d436b476e564f dm-2 NETAPP,LUN C-Mode
size=15G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:0:2 sdd 8:48   active ready running
| |- 1:0:1:2 sdg 8:96   active ready running
| |- 2:0:0:2 sdp 8:240  active ready running
| `- 2:0:1:2 sds 65:32  active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 1:0:2:2 sdj 8:144  active ready running
  |- 1:0:3:2 sdm 8:192  active ready running
  |- 2:0:2:2 sdv 65:80  active ready running
  `- 2:0:3:2 sdy 65:128 active ready running
3600a098044316b37305d44353075674e dm-1 NETAPP,LUN C-Mode
size=500G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:2:1 sdi 8:128  active ready running
| |- 1:0:3:1 sdl 8:176  active ready running
| |- 2:0:2:1 sdu 65:64  active ready running
| `- 2:0:3:1 sdx 65:112 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 1:0:0:1 sdc 8:32   active ready running
  |- 1:0:1:1 sdf 8:80   active ready running
  |- 2:0:0:1 sdo 8:224  active ready running
  `- 2:0:1:1 sdr 65:16  active ready running
3600a098044316b37305d44353075674d dm-0 NETAPP,LUN C-Mode
size=500G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:2:0 sdh 8:112  active ready running
| |- 1:0:3:0 sdk 8:160  active ready running
| |- 2:0:2:0 sdt 65:48  active ready running
| `- 2:0:3:0 sdw 65:96  active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 1:0:0:0 sdb 8:16   active ready running
  |- 1:0:1:0 sde 8:64   active ready running
  |- 2:0:0:0 sdn 8:208  active ready running
  `- 2:0:1:0 sdq 65:0   active ready running


Linux : Bash Code Injection Vulnerability via Specially Crafted Environment Variables (CVE-2014-6271, CVE-2014-7169)

https://access.redhat.com/articles/1200223

Diagnostic Steps:

If your system is not vulnerable, you will see output similar to:

$ env 'x=() { :;}; echo vulnerable' 'BASH_FUNC_x()=() { :;}; echo vulnerable' bash -c "echo test"
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `BASH_FUNC_x'
test

If your system is vulnerable, you will see output similar to:

$ env 'x=() { :;}; echo vulnerable' 'BASH_FUNC_x()=() { :;}; echo vulnerable' bash -c "echo test"
vulnerable
bash: BASH_FUNC_x(): line 0: syntax error near unexpected token `)'
bash: BASH_FUNC_x(): line 0: `BASH_FUNC_x() () { :;}; echo vulnerable'
bash: error importing function definition for `BASH_FUNC_x'
test

If the output of the above command contains a line containing only the word vulnerable you are using a vulnerable version of Bash. The patch used to fix this issue ensures that no code is allowed after the end of a Bash function

If your system is not vulnerable, you will see output similar to:

$ cd /tmp; rm -f /tmp/echo; env 'x=() { (a)=>\' bash -c "echo date"; cat /tmp/echo
date
cat: /tmp/echo: No such file or directory

If your system is vulnerable, the time and date information will be output on the screen and a file called /tmp/echo will be created.

$ cd /tmp; rm -f /tmp/echo; env 'x=() { (a)=>\' bash -c "echo date"; cat /tmp/echo
bash: x: line 1: syntax error near unexpected token `='
bash: x: line 1: `'
bash: error importing function definition for `x'
Tue Sep 30 09:57:39 EDT 2014
$ ls -ld /tmp/echo
-rw-rw-r-- 1 abcd abcd 29 Sep 30 09:57 /tmp/echo


 Solution :
If your system is vulnerable, you can fix these issues by updating to the most recent version of the Bash package by running the following command:

# yum update bash 

Wednesday, September 24, 2014

Linux : ssh not working due to wrong key file permission

Problem: ssh not working due to wrong key file permission

In /var/log/messages

Sep 15 05:21:51 localhost sshd[21043]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Sep 15 05:21:51 localhost sshd[21043]: error: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
Sep 15 05:21:51 localhost sshd[21043]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Sep 15 05:21:51 localhost sshd[21043]: error: Permissions 0777 for '/etc/ssh/ssh_host_rsa_key' are too open.
Sep 15 05:21:51 localhost sshd[21043]: error: It is required that your private key files are NOT accessible by others.
Sep 15 05:21:51 localhost sshd[21043]: error: This private key will be ignored.
Sep 15 05:21:51 localhost sshd[21043]: error: bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key
Sep 15 05:21:51 localhost sshd[21043]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key


Solution : change the file permission back to read-able by root only

Friday, September 12, 2014

Linux : SAN : How to find out the shared SAN LUN

Problem : We have LUN presented to 2 Red Hat servers, how can we verify which device file is shared device ?

Solution : Find out the LUN with same serial number by running sq_inq

In server A :

# fdisk -l

Disk /dev/mapper/3600a098044316b37305d44353075674d: 537.0 GB, 536952700928 bytes
255 heads, 63 sectors/track, 65280 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 65536 bytes
Disk identifier: 0x00000000

# sg_inq /dev/mapper/3600a098044316b37305d44353075674d
standard INQUIRY:
  PQual=0  Device_type=0  RMB=0  version=0x05  [SPC-3]
  [AERC=0]  [TrmTsk=0]  NormACA=1  HiSUP=1  Resp_data_format=2
  SCCS=0  ACC=0  TPGS=1  3PC=1  Protect=0  BQue=0
  EncServ=0  MultiP=1 (VS=0)  [MChngr=0]  [ACKREQQ=0]  Addr16=0
  [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
  [SPI: Clocking=0x0  QAS=0  IUS=0]
    length=117 (0x75)   Peripheral device type: disk
 Vendor identification: NETAPP
 Product identification: LUN C-Mode
 Product revision level: 8200
 Unit serial number: D1k70]D50ugM

In Server B :

# fdisk -l

Disk /dev/mapper/3600a098044316b37305d44353075674e: 537.0 GB, 536952700928 bytes
255 heads, 63 sectors/track, 65280 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 65536 bytes
Disk identifier: 0x00000000



# sg_inq /dev/mapper/3600a098044316b37305d44353075674e
standard INQUIRY:
  PQual=0  Device_type=0  RMB=0  version=0x05  [SPC-3]
  [AERC=0]  [TrmTsk=0]  NormACA=1  HiSUP=1  Resp_data_format=2
  SCCS=0  ACC=0  TPGS=1  3PC=1  Protect=0  BQue=0
  EncServ=0  MultiP=1 (VS=0)  [MChngr=0]  [ACKREQQ=0]  Addr16=0
  [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
  [SPI: Clocking=0x0  QAS=0  IUS=0]
    length=117 (0x75)   Peripheral device type: disk
 Vendor identification: NETAPP
 Product identification: LUN C-Mode
 Product revision level: 8200
 Unit serial number: D1k70]D50ugN

Tuesday, September 9, 2014

Linux : How To Find Fiber Host Bus Adapter (Fiber HBA) WWN

# systool -c fc_host -v
Class = "fc_host"

  Class Device = "host1"
  Class Device path = "/sys/devices/pci0000:00/0000:00:1c.0/0000:0a:00.0/host1/fc_host/host1"
    dev_loss_tmo        = "16"
    fabric_name         = "0x2001000dec90e501"
    issue_lip           = <store method only>
    max_npiv_vports     = "254"
    node_name           = "0x5001438026697eaf"
    npiv_vports_inuse   = "0"
    port_id             = "0x2104c0"
    port_name           = "0x5001438026697eae" 
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "8 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "HPAK344A FW:v7.01.00 DVR:v8.06.00.14.39.0-k1"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = <store method only>
    vport_delete        = <store method only>

    Device = "host1"
    Device path = "/sys/devices/pci0000:00/0000:00:1c.0/0000:0a:00.0/host1"
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      sfp                 = ""
      uevent              = "DEVTYPE=scsi_host"
      vpd                 = "▒&"


  Class Device = "host2"
  Class Device path = "/sys/devices/pci0000:20/0000:20:02.0/0000:27:00.0/host2/fc_host/host2"
    dev_loss_tmo        = "16"
    fabric_name         = "0x2001000dec90e501"
    issue_lip           = <store method only>
    max_npiv_vports     = "254"
    node_name           = "0x5001438026697e81"
    npiv_vports_inuse   = "0"
    port_id             = "0x210540"
    port_name           = "0x5001438026697e80"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "8 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "HPAK344A FW:v7.01.00 DVR:v8.06.00.14.39.0-k1"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = <store method only>
    vport_delete        = <store method only>

    Device = "host2"
    Device path = "/sys/devices/pci0000:20/0000:20:02.0/0000:27:00.0/host2"
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      sfp                 = ""
      uevent              = "DEVTYPE=scsi_host"
      vpd                 = "▒&"

# cat /sys/class/scsi_host/host*/device/fc_host/host*/port_name
0x5001438026697eae
0x5001438026697e80


WWN – In Fibre Channel there’s a special term for a port identifier, specifically WWN or World Wide Name.  Just as every network card as a unique MAC address for each NIC port, every single FC port has a unique 64bit port WWN.  For example, a FC port WWN might look like this: 20:00:00:81:23:45:ac:01 and though I’ve used the colon (:) as a separator/delimiter it’s just as common to see the 16 hex digits separated by hyphens (-).
source : http://blog.osnexus.com/2012/03/20/understanding-fc-fabric-configuration-5-paragraphs/

On the VMs, it can be shown in the following path
# cat /sys/class/fc_host/host*/port_name
0x5001438000c4e0dc
0x5001438003ad4c84

# rpm -q -f /usr/bin/systool
sysfsutils-2.1.0-7.el6.x86_64


http://www.theunixway.com/2013/11/how-to-find-hba-and-add-new-lun-in.html

Thursday, August 28, 2014

Linux : Configuring Network Interface Bonding



For more information see /usr/share/doc/iputils-*/README.bonding

Source:
http://www.tecmint.com/create-nic-channel-bonding-in-redhat-centos-fedora/

Step 1: Creating Bonding Channel

As a root, create a new file name bonding.conf in the /etc/modprobe.d/ directory. Name can be anything you like as long as it ends with a .conf extension. Insert the following line in this new file.
alias bond0 bonding
For each configured channel bonding interface, there must be a corresponding entry in your new /etc/modprobe.d/bonding.conf file.

Step 2: Creating Channle Bonding Interface

To create a channel bonding interface, create a file in the /etc/sysconfig/network-scripts/ directory called ifcfg-bond0. The following is a sample channel bonding configuration file. (Note : IP Address may differ in your environment.)
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.1.8
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no

Step 3: Configuring Channel Bonding Interface

After the channel bonding interface is created, the network interfaces to be bound together must be configured by adding the MASTER and SLAVE directives to their configuration files. The configuration files for each of the channel-bonded interfaces can be nearly identical. For example, if two Ethernet interfaces are being channel bonded, both eth0 and eth1 may look like the following example. Edit physical interface card details as under.

For eth0

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

For eth1

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
The above directives are self explanatory for many system admin, however, let me explain to newbie.
  1. DEVICE: Indicates what is the device name
  2. USERCTL: Indicates that can user control this device(here its no)
  3. ONBOOT:  Indicates that at the boot time do this device should be up?
  4. MASTER: Is this device has master? Then what it is(here its bond0)
  5. SLAVE: Is this device acting as slave?
  6. BOOTPROTO: What about getting IP Address from DHCP? It’s set to none which indicate it’s a static IP)

Step 4: Restarting Network Service

Restart the network service and see the output of ifconfig.
# service network restart
[root@tecmint network-scripts]# ifconfig

bond0     Link encap:Ethernet  HWaddr 00:0C:21:60:30:C4
          inet addr:192.168.1.8  Bcast:172.16.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe69:31c4/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
          RX packets:19676 errors:0 dropped:0 overruns:0 frame:0
          TX packets:342 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1623240 (1.5 MiB)  TX bytes:42250 (41.2 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0C:21:60:30:C4
          UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
          RX packets:10057 errors:0 dropped:0 overruns:0 frame:0
          TX packets:171 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:832257 (812.7 KiB)  TX bytes:22751 (22.2 KiB)
          Interrupt:19 Base address:0x2000

eth1      Link encap:Ethernet  HWaddr 00:0C:21:60:30:C4
          UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
          RX packets:9620 errors:0 dropped:0 overruns:0 frame:0
          TX packets:173 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:791043 (772.5 KiB)  TX bytes:20207 (19.7 KiB)
          Interrupt:19 Base address:0x2080

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:104 (104.0 b)  TX bytes:104 (104.0 b)
 
 
 Changing a Bond's Configuration
-------------------------------
        Each bond may be configured individually by manipulating the
files located in /sys/class/net/<bond name>/bonding


# pwd
/sys/class/net/bond0/bonding
# ls
active_slave    all_slaves_active  miimon        primary_reselect
ad_actor_key    arp_interval       mii_status    queue_id
ad_aggregator   arp_ip_target      min_links     resend_igmp
ad_num_ports    arp_validate       mode          slaves
ad_partner_key  downdelay          num_grat_arp  updelay
ad_partner_mac  fail_over_mac      num_unsol_na  use_carrier
ad_select       lacp_rate          primary       xmit_hash_policy
# cat mode
active-backup 1
# cat miimon
1000
 
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.100.4.162
NETMASK=255.255.240.0
BONDING_OPTS="mode=1 miimon=1000"
 
 

# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 1000
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: a0:d3:c1:f3:49:81
Slave queue ID: 0

Slave Interface: eth2
MII Status: down
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: a0:d3:c1:f3:49:82
Slave queue ID: 0
 
If BONDING_OPTS is not specified, bonding mode will show as :
# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: a0:d3:c1:f3:49:fd
Slave queue ID: 0

Slave Interface: eth2
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: a0:d3:c1:f3:49:fe
Slave queue ID: 0

# cat mode
balance-rr 0
# cat miimon
0
 

Linux command : router configuration

Command to add a router : (lost after reboot)

ip route add 135.0.0.0/8 via 135.25.224.1 dev eth3

To use a configuration file to store the router information :

# cat /etc/sysconfig/network-scripts/route-eth3
135.0.0.0/8 via 135.25.224.1 dev eth3

With this file configured, we can setup the router information by running :

# ifup eth3

Command to delete a router :

ip route del 135.0.0.0/8

Default gateway information are stored in /etc/sysconfig/network
GATEWAY=x.x.x.x


Friday, May 23, 2014

Running an instance in Openstack

I have to delete the "demo" "private" subnet that came with openstack-packstack to make the following steps work.

# login as openstack ID

# Source credentials file
source keystonerc_admin

# Create private network
neutron net-create private

# Associate subnet
neutron subnet-create --name private_subnet private 10.0.0.0/24

# create router
neutron router-create myrouter

# uplink router to the public internet
neutron router-gateway-set myrouter public


# uplink subnet to router
neutron  router-interface-add myrouter private_subnet


# create security profile for jump host
 neutron  security-group-create jumphost

# Add rule to allow icmp in
neutron  security-group-rule-create  --protocol icmp jumphost

# Add rule to allow ssh in
neutron  security-group-rule-create  --protocol tcp --port-range-min 22 --port-range-max 22  jumphost

# find out net id
neutron net-list

# Launch jump host:
nova boot --image cirros --flavor 1 jumphost --security_groups jumphost  --nic net-id=<net id of "private">

# Determine port-id attached to jump host
neutron port-list -- --device_id=<instance_id>

# create floatingip
neutron floatingip-create public --port-id <port-id>

# test ping/ssh




Tuesday, May 20, 2014

Install Openstack via RDO packstack

Please also refer here

These instructions are to install the current ("Icehouse") release.

Please name the host with a fully qualified domain name rather than a short-form name to avoid DNS issues with Packstack. 

Step 0: Prerequisites

Software: Red Hat Enterprise Linux (RHEL) 6.5 is the minimum recommended version, or the equivalent version of one of the RHEL-based Linux distributions such as CentOS, Scientific Linux, etc., or Fedora 20 or later.

Step 1: Software repositories


Update your current packages: 


sudo yum update -y
 
Setup the RDO repositories: 


sudo yum install -y http://rdo.fedorapeople.org/rdo-release.rpm
 
 
Step 2: Install Packstack Installer

sudo yum install -y openstack-packstack

Step 3: Run Packstack to install OpenStack

Packstack takes the work out of manually setting up OpenStack. For a single node OpenStack deployment, run the following command.

packstack --allinone

The installer will ask you to enter the root password for each host node you are installing on the network, to enable remote configuration of the host so it can remotely configure each node using Puppet.


The following is the output from my test server

# sudo yum install -y http://rdo.fedorapeople.org/rdo-release.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors-pa.sioru.com
 * epel: mirror.umd.edu
 * extras: mirror.us.leaseweb.net
 * updates: mirrors-pa.sioru.com
Setting up Install Process
rdo-release.rpm                                          |  12 kB     00:00    
Examining /var/tmp/yum-root-IaRbXv/rdo-release.rpm: rdo-release-icehouse-3.noarch
Marking /var/tmp/yum-root-IaRbXv/rdo-release.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rdo-release.noarch 0:icehouse-3 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch          Version             Repository           Size
================================================================================
Installing:
 rdo-release        noarch        icehouse-3          /rdo-release        8.7 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total size: 8.7 k
Installed size: 8.7 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : rdo-release-icehouse-3.noarch                                1/1
  Verifying  : rdo-release-icehouse-3.noarch                                1/1

Installed:
  rdo-release.noarch 0:icehouse-3                                              

Complete!


#  sudo yum install -y openstack-packstack
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.seas.harvard.edu
 * epel: mirror.umd.edu
 * extras: mirror.millry.co
 * updates: mirrors-pa.sioru.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package openstack-packstack.noarch 0:2014.1.1-0.12.dev1068.el6 will be installed
--> Processing Dependency: openstack-packstack-puppet = 2014.1.1-0.12.dev1068.el6 for package: openstack-packstack-2014.1.1-0.12.dev1068.el6.noarch
--> Processing Dependency: openstack-puppet-modules for package: openstack-packstack-2014.1.1-0.12.dev1068.el6.noarch
--> Running transaction check
---> Package openstack-packstack-puppet.noarch 0:2014.1.1-0.12.dev1068.el6 will be installed
---> Package openstack-puppet-modules.noarch 0:2014.1-11.1.el6 will be installed
--> Processing Dependency: rubygem-json for package: openstack-puppet-modules-2014.1-11.1.el6.noarch
--> Running transaction check
---> Package rubygem-json.x86_64 0:1.5.5-1.el6 will be installed
--> Processing Dependency: ruby(abi) = 1.8 for package: rubygem-json-1.5.5-1.el6.x86_64
--> Processing Dependency: rubygems for package: rubygem-json-1.5.5-1.el6.x86_64
--> Processing Dependency: /usr/bin/ruby for package: rubygem-json-1.5.5-1.el6.x86_64
--> Processing Dependency: libruby.so.1.8()(64bit) for package: rubygem-json-1.5.5-1.el6.x86_64
--> Running transaction check
---> Package ruby.x86_64 0:1.8.7.352-13.el6 will be installed
---> Package ruby-libs.x86_64 0:1.8.7.352-13.el6 will be installed
--> Processing Dependency: libreadline.so.5()(64bit) for package: ruby-libs-1.8.7.352-13.el6.x86_64
---> Package rubygems.noarch 0:1.3.7-5.el6 will be installed
--> Processing Dependency: ruby-rdoc for package: rubygems-1.3.7-5.el6.noarch
--> Running transaction check
---> Package compat-readline5.x86_64 0:5.2-17.1.el6 will be installed
---> Package ruby-rdoc.x86_64 0:1.8.7.352-13.el6 will be installed
--> Processing Dependency: ruby-irb = 1.8.7.352-13.el6 for package: ruby-rdoc-1.8.7.352-13.el6.x86_64
--> Running transaction check
---> Package ruby-irb.x86_64 0:1.8.7.352-13.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch   Version                   Repository          Size
================================================================================
Installing:
 openstack-packstack  noarch 2014.1.1-0.12.dev1068.el6 openstack-icehouse 197 k
Installing for dependencies:
 compat-readline5     x86_64 5.2-17.1.el6              base               130 k
 openstack-packstack-puppet
                      noarch 2014.1.1-0.12.dev1068.el6 openstack-icehouse  33 k
 openstack-puppet-modules
                      noarch 2014.1-11.1.el6           openstack-icehouse 1.5 M
 ruby                 x86_64 1.8.7.352-13.el6          updates            534 k
 ruby-irb             x86_64 1.8.7.352-13.el6          updates            314 k
 ruby-libs            x86_64 1.8.7.352-13.el6          updates            1.6 M
 ruby-rdoc            x86_64 1.8.7.352-13.el6          updates            377 k
 rubygem-json         x86_64 1.5.5-1.el6               puppetlabs-deps    763 k
 rubygems             noarch 1.3.7-5.el6               base               207 k

Transaction Summary
================================================================================
Install      10 Package(s)

Total download size: 5.7 M
Installed size: 16 M
Downloading Packages:
(1/10): compat-readline5-5.2-17.1.el6.x86_64.rpm         | 130 kB     00:00    
(2/10): openstack-packstack-2014.1.1-0.12.dev1068.el6.no | 197 kB     00:00    
(3/10): openstack-packstack-puppet-2014.1.1-0.12.dev1068 |  33 kB     00:00    
(4/10): openstack-puppet-modules-2014.1-11.1.el6.noarch. | 1.5 MB     00:01    
(5/10): ruby-1.8.7.352-13.el6.x86_64.rpm                 | 534 kB     00:00    
(6/10): ruby-irb-1.8.7.352-13.el6.x86_64.rpm             | 314 kB     00:00    
(7/10): ruby-libs-1.8.7.352-13.el6.x86_64.rpm            | 1.6 MB     00:01    
(8/10): ruby-rdoc-1.8.7.352-13.el6.x86_64.rpm            | 377 kB     00:00    
(9/10): rubygem-json-1.5.5-1.el6.x86_64.rpm              | 763 kB     00:00    
(10/10): rubygems-1.3.7-5.el6.noarch.rpm                 | 207 kB     00:00    
--------------------------------------------------------------------------------
Total                                           737 kB/s | 5.7 MB     00:07    
warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID 0e4fbd28: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Icehouse
Importing GPG key 0x0E4FBD28:
 Userid : rdo-icehouse-sign <rdo-info@redhat.com>
 Package: rdo-release-icehouse-3.noarch (@/rdo-release)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Icehouse
warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID 4bd6ec30: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
Importing GPG key 0x4BD6EC30:
 Userid : Puppet Labs Release Key (Puppet Labs Release Key) <info@puppetlabs.com>
 Package: rdo-release-icehouse-3.noarch (@/rdo-release)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : openstack-packstack-puppet-2014.1.1-0.12.dev1068.el6.noa    1/10
  Installing : compat-readline5-5.2-17.1.el6.x86_64                        2/10
  Installing : ruby-libs-1.8.7.352-13.el6.x86_64                           3/10
  Installing : ruby-1.8.7.352-13.el6.x86_64                                4/10
  Installing : ruby-irb-1.8.7.352-13.el6.x86_64                            5/10
  Installing : ruby-rdoc-1.8.7.352-13.el6.x86_64                           6/10
  Installing : rubygems-1.3.7-5.el6.noarch                                 7/10
  Installing : rubygem-json-1.5.5-1.el6.x86_64                             8/10
  Installing : openstack-puppet-modules-2014.1-11.1.el6.noarch             9/10
  Installing : openstack-packstack-2014.1.1-0.12.dev1068.el6.noarch       10/10
  Verifying  : ruby-irb-1.8.7.352-13.el6.x86_64                            1/10
  Verifying  : ruby-libs-1.8.7.352-13.el6.x86_64                           2/10
  Verifying  : compat-readline5-5.2-17.1.el6.x86_64                        3/10
  Verifying  : openstack-puppet-modules-2014.1-11.1.el6.noarch             4/10
  Verifying  : openstack-packstack-puppet-2014.1.1-0.12.dev1068.el6.noa    5/10
  Verifying  : ruby-rdoc-1.8.7.352-13.el6.x86_64                           6/10
  Verifying  : openstack-packstack-2014.1.1-0.12.dev1068.el6.noarch        7/10
  Verifying  : rubygems-1.3.7-5.el6.noarch                                 8/10
  Verifying  : ruby-1.8.7.352-13.el6.x86_64                                9/10
  Verifying  : rubygem-json-1.5.5-1.el6.x86_64                            10/10

Installed:
  openstack-packstack.noarch 0:2014.1.1-0.12.dev1068.el6                       

Dependency Installed:
  compat-readline5.x86_64 0:5.2-17.1.el6                                       
  openstack-packstack-puppet.noarch 0:2014.1.1-0.12.dev1068.el6                
  openstack-puppet-modules.noarch 0:2014.1-11.1.el6                            
  ruby.x86_64 0:1.8.7.352-13.el6                                               
  ruby-irb.x86_64 0:1.8.7.352-13.el6                                           
  ruby-libs.x86_64 0:1.8.7.352-13.el6                                          
  ruby-rdoc.x86_64 0:1.8.7.352-13.el6                                          
  rubygem-json.x86_64 0:1.5.5-1.el6                                            
  rubygems.noarch 0:1.3.7-5.el6                                                

Complete!


# sudo useradd -U -G wheel -s /bin/bash -m openstack



Now login as openstack user

[openstack@novo ~]$ packstack --allinone
Welcome to Installer setup utility
Packstack changed given value  to required value /home/openstack/.ssh/id_rsa.pub

Installing:
Clean Up                                             [ DONE ]
root@192.168.1.188's password:
Setting up ssh keys                               [ ERROR ]

ERROR : Failed to run remote script, stdout:
stderr: Warning: Permanently added '192.168.1.188' (RSA) to the list of known hosts.
Connection closed by UNKNOWN

The above error is caused by hostname not in FQDN format

# vi /etc/hosts

The following line is added :

192.168.1.188    novo.test.com novo

# hostname novo
# hostname
novo
# hostname -f (this is to verify FQDN format is showned)
novo.test.com

After fixing the problem,re-run packstack with option --answer-file followed by the answer file : packstack-answers-20140520-175735.txt


[openstack@novo ~]$ packstack --answer-file packstack-answers-20140520-175735.txt
Welcome to Installer setup utility

Installing:
Clean Up                                             [ DONE ]
Setting up ssh keys                                  [ DONE ]
Discovering hosts' details                           [ DONE ]
Adding pre install manifest entries                  [ DONE ]
Adding MySQL manifest entries                        [ DONE ]
Adding AMQP manifest entries                         [ DONE ]
Adding Keystone manifest entries                     [ DONE ]
Adding Glance Keystone manifest entries              [ DONE ]
Adding Glance manifest entries                       [ DONE ]
Installing dependencies for Cinder                   [ DONE ]
Adding Cinder Keystone manifest entries              [ DONE ]
Adding Cinder manifest entries                       [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Adding Nova API manifest entries                     [ DONE ]
Adding Nova Keystone manifest entries                [ DONE ]
Adding Nova Cert manifest entries                    [ DONE ]
Adding Nova Conductor manifest entries               [ DONE ]
Creating ssh keys for Nova migration                 [ DONE ]
Gathering ssh host keys for Nova migration           [ DONE ]
Adding Nova Compute manifest entries                 [ DONE ]
Adding Nova Scheduler manifest entries               [ DONE ]
Adding Nova VNC Proxy manifest entries               [ DONE ]
Adding Nova Common manifest entries                  [ DONE ]
Adding Openstack Network-related Nova manifest entries[ DONE ]
Adding Neutron API manifest entries                  [ DONE ]
Adding Neutron Keystone manifest entries             [ DONE ]
Adding Neutron L3 manifest entries                   [ DONE ]
Adding Neutron L2 Agent manifest entries             [ DONE ]
Adding Neutron DHCP Agent manifest entries           [ DONE ]
Adding Neutron LBaaS Agent manifest entries          [ DONE ]
Adding Neutron Metadata Agent manifest entries       [ DONE ]
Adding OpenStack Client manifest entries             [ DONE ]
Adding Horizon manifest entries                      [ DONE ]
Adding Swift Keystone manifest entries               [ DONE ]
Adding Swift builder manifest entries                [ DONE ]
Adding Swift proxy manifest entries                  [ DONE ]
Adding Swift storage manifest entries                [ DONE ]
Adding Swift common manifest entries                 [ DONE ]
Adding Provisioning manifest entries                 [ DONE ]
Adding MongoDB manifest entries                      [ DONE ]
Adding Ceilometer manifest entries                   [ DONE ]
Adding Ceilometer Keystone manifest entries          [ DONE ]
Adding Nagios server manifest entries                [ DONE ]
Adding Nagios host manifest entries                  [ DONE ]
Adding post install manifest entries                 [ DONE ]
Preparing servers                                    [ DONE ]
Installing Dependencies                              [ DONE ]
Copying Puppet modules and manifests                 [ DONE ]
Applying 192.168.1.188_prescript.pp
192.168.1.188_prescript.pp:                          [ DONE ]        
Applying 192.168.1.188_mysql.pp
Applying 192.168.1.188_amqp.pp
192.168.1.188_mysql.pp:                              [ DONE ]    
192.168.1.188_amqp.pp:                               [ DONE ]    
Applying 192.168.1.188_keystone.pp
Applying 192.168.1.188_glance.pp
Applying 192.168.1.188_cinder.pp
192.168.1.188_keystone.pp:                           [ DONE ]       
192.168.1.188_glance.pp:                             [ DONE ]       
192.168.1.188_cinder.pp:                             [ DONE ]       
Applying 192.168.1.188_api_nova.pp
192.168.1.188_api_nova.pp:                           [ DONE ]       
Applying 192.168.1.188_nova.pp
192.168.1.188_nova.pp:                               [ DONE ]   
Applying 192.168.1.188_neutron.pp
192.168.1.188_neutron.pp:                            [ DONE ]      
Applying 192.168.1.188_osclient.pp
Applying 192.168.1.188_horizon.pp
192.168.1.188_osclient.pp:                           [ DONE ]       
192.168.1.188_horizon.pp:                            [ DONE ]       
Applying 192.168.1.188_ring_swift.pp
192.168.1.188_ring_swift.pp:                         [ DONE ]         
Applying 192.168.1.188_swift.pp
Applying 192.168.1.188_provision.pp
192.168.1.188_swift.pp:                              [ DONE ]        
192.168.1.188_provision.pp:                          [ DONE ]        
Applying 192.168.1.188_mongodb.pp
192.168.1.188_mongodb.pp:                            [ DONE ]      
Applying 192.168.1.188_ceilometer.pp
Applying 192.168.1.188_nagios.pp
Applying 192.168.1.188_nagios_nrpe.pp
192.168.1.188_ceilometer.pp:                         [ DONE ]          
192.168.1.188_nagios.pp:                             [ DONE ]          
192.168.1.188_nagios_nrpe.pp:                        [ DONE ]          
Applying 192.168.1.188_postscript.pp
192.168.1.188_postscript.pp:                         [ DONE ]         
Applying Puppet manifests                            [ DONE ]
Finalizing                                           [ DONE ]

 **** Installation completed successfully ******


Additional information:
 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
 * Did not create a cinder volume group, one already existed
 * File /root/keystonerc_admin has been created on OpenStack client host 192.168.1.188. To use the command line tools you need to source the file.
 * Copy of keystonerc_admin file has been created for non-root user in /home/openstack.
 * To access the OpenStack Dashboard browse to http://192.168.1.188/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
 * To use Nagios, browse to http://192.168.1.188/nagios username : nagiosadmin, password : 30856dbf515e42ee
 * The installation log file is available at: /var/tmp/packstack/20140520-190707-JWMGRW/openstack-setup.log
 * The generated manifests are available at: /var/tmp/packstack/20140520-190707-JWMGRW/manifests


[openstack@novo ~]$ cat keystonerc_admin
export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_PASSWORD=6af8187b6ef64c40
export OS_AUTH_URL=http://192.168.1.188:5000/v2.0/
export PS1='[\u@\h \W(keystone_admin)]\$ '





[openstack@novo ~]$ pstree
init─┬─NetworkManager─┬─dhclient
     │                └─{NetworkManager}
     ├─abrtd
     ├─acpid
     ├─atd
     ├─auditd───{auditd}
     ├─automount───4*[{automount}]
     ├─bluetoothd
     ├─bonobo-activati───{bonobo-activat}
     ├─2*[ceilometer-agen]
     ├─ceilometer-agen───ceilometer-agen
     ├─2*[ceilometer-alar]
     ├─ceilometer-api
     ├─ceilometer-coll───ceilometer-coll
     ├─certmonger
     ├─cinder-api───cinder-api
     ├─cinder-backup
     ├─cinder-schedule
     ├─cinder-volume───cinder-volume
     ├─clock-applet
     ├─console-kit-dae───63*[{console-kit-da}]
     ├─crond
     ├─cupsd
     ├─2*[dbus-daemon───{dbus-daemon}]
     ├─2*[dbus-launch]
     ├─devkit-power-da
     ├─e-calendar-fact───{e-calendar-fac}
     ├─epmd
     ├─firefox───43*[{firefox}]
     ├─gconf-im-settin
     ├─gconfd-2
     ├─gdm-binary─┬─gdm-simple-slav─┬─Xorg
     │            │                 ├─gdm-session-wor─┬─gnome-session─┬─abrt-ap+
     │            │                 │                 │               ├─bluetoo+
     │            │                 │                 │               ├─evoluti+
     │            │                 │                 │               ├─gdu-not+
     │            │                 │                 │               ├─gnome-p+
     │            │                 │                 │               ├─gnome-p+
     │            │                 │                 │               ├─gnome-v+
     │            │                 │                 │               ├─gpk-upd+
     │            │                 │                 │               ├─metacit+
     │            │                 │                 │               ├─nautilus
     │            │                 │                 │               ├─nm-appl+
     │            │                 │                 │               ├─polkit-+
     │            │                 │                 │               ├─python
     │            │                 │                 │               ├─restore+
     │            │                 │                 │               └─{gnome-+
     │            │                 │                 └─{gdm-session-wo}
     │            │                 └─{gdm-simple-sla}
     │            └─{gdm-binary}
     ├─gdm-user-switch
     ├─gedit
     ├─glance-api───8*[glance-api]
     ├─glance-registry───glance-registry
     ├─gnome-keyring-d───2*[{gnome-keyring-}]
     ├─gnome-screensav
     ├─gnome-settings-───{gnome-settings}
     ├─gnome-terminal─┬─bash
     │                ├─4*[bash───su───bash]
     │                ├─bash───su───bash───pstree
     │                ├─bash───su───bash───mysqld_safe───mysqld───49*[{mysqld}]
     │                ├─gnome-pty-helpe
     │                └─{gnome-terminal}
     ├─gnote
     ├─gvfs-afc-volume───{gvfs-afc-volum}
     ├─gvfs-gdu-volume
     ├─gvfs-gphoto2-vo
     ├─gvfsd
     ├─gvfsd-burn
     ├─gvfsd-metadata
     ├─gvfsd-trash
     ├─hald─┬─hald-runner─┬─hald-addon-acpi
     │      │             ├─2*[hald-addon-gene]
     │      │             ├─hald-addon-inpu
     │      │             └─hald-addon-rfki
     │      └─{hald}
     ├─httpd─┬─httpd───17*[{httpd}]
     │       └─8*[httpd]
     ├─im-settings-dae
     ├─irqbalance
     ├─keystone-all
     ├─ksmtuned───sleep
     ├─libvirtd───10*[{libvirtd}]
     ├─master─┬─pickup
     │        └─qmgr
     ├─memcached───9*[{memcached}]
     ├─5*[mingetty]
     ├─modem-manager
     ├─mongod───20*[{mongod}]
     ├─nagios───{nagios}
     ├─neutron-dhcp-ag
     ├─neutron-l3-agen
     ├─neutron-metadat
     ├─neutron-ns-meta
     ├─neutron-openvsw───sudo───neutron-rootwra───ovsdb-client
     ├─neutron-server
     ├─notification-ar
     ├─nova-api───24*[nova-api]
     ├─nova-cert
     ├─nova-compute───21*[{nova-compute}]
     ├─nova-conductor───8*[nova-conductor]
     ├─nova-consoleaut
     ├─nova-novncproxy
     ├─nova-scheduler
     ├─nrpe
     ├─ovs-vswitchd───ovs-vswitchd───ovs-vswitchd
     ├─ovsdb-server───ovsdb-server
     ├─packagekitd
     ├─polkitd
     ├─pulseaudio─┬─gconf-helper
     │            └─3*[{pulseaudio}]
     ├─rabbitmq-server───bash───rabbitmq-server───su───beam.smp─┬─inet_gethost─+
     │                                                          └─42*[{beam.smp+
     ├─rpc.statd
     ├─rpcbind
     ├─rsyslogd───3*[{rsyslogd}]
     ├─rtkit-daemon───2*[{rtkit-daemon}]
     ├─seahorse-daemon
     ├─sshd
     ├─swift-account-a
     ├─2*[swift-account-r]
     ├─swift-account-s───swift-account-s
     ├─3*[swift-container]
     ├─swift-container───swift-container
     ├─swift-object-au
     ├─swift-object-re
     ├─swift-object-se───swift-object-se
     ├─swift-object-up
     ├─swift-proxy-ser───8*[swift-proxy-ser]
     ├─tgtd───tgtd
     ├─trashapplet
     ├─tuned
     ├─udevd───2*[udevd]
     ├─udisks-daemon─┬─udisks-daemon
     │               └─{udisks-daemon}
     ├─wnck-applet
     ├─wpa_supplicant
     └─xinetd



Monday, May 12, 2014

Installing virtualization packages on Red Hat Enterprise Linux



To use virtualization on Red Hat Enterprise Linux you require at least the qemu-kvm and qemu-img packages. These packages provide the user-level KVM emulator and disk image manager on the host Red Hat Enterprise Linux system.
To install the qemu-kvm and qemu-img packages, run the following command: 
 
# yum install qemu-kvm qemu-img
 
Several additional virtualization management packages are also available:
Recommended virtualization packages
python-virtinst
Provides the virt-install command for creating virtual machines.
libvirt
The libvirt package provides the server and host side libraries for interacting with hypervisors and host systems. The libvirt package provides the libvirtd daemon that handles the library calls, manages virtual machines and controls the hypervisor.
libvirt-python
The libvirt-python package contains a module that permits applications written in the Python programming language to use the interface supplied by the libvirt API.
virt-manager
virt-manager, also known as Virtual Machine Manager, provides a graphical tool for administering virtual machines. It uses libvirt-client library as the management API.
libvirt-client
The libvirt-client package provides the client-side APIs and libraries for accessing libvirt servers. The libvirt-client package includes the virsh command line tool to manage and control virtual machines and hypervisors from the command line or a special virtualization shell.
Install all of these recommended virtualization packages with the following command: 
 
# yum install virt-manager libvirt libvirt-python python-virtinst libvirt-client
 
Installing Virtualization package groups
The virtualization packages can also be installed from package groups. The following table describes the virtualization package groups and what they provide.

Table 5.1. Virtualization Package Groups
Package Group Description Mandatory Packages Optional Packages
Virtualization Provides an environment for hosting virtual machines qemu-kvm qemu-guest-agent, qemu-kvm-tools
Virtualization Client Clients for installing and managing virtualization instances python-virtinst, virt-manager, virt-viewer virt-top
Virtualization Platform Provides an interface for accessing and controlling virtual machines and containers libvirt, libvirt-client, virt-who, virt-what fence-virtd-libvirt, fence-virtd-multicast, fence-virtd-serial, libvirt-cim, libvirt-java, libvirt-qmf, libvirt-snmp, perl-Sys-Virt
Virtualization Tools Tools for offline virtual image management libguestfs libguestfs-java, libguestfs-tools, virt-v2v

To install a package group, run the yum groupinstall <groupname> command. For instance, to install the Virtualization Tools package group, run the yum groupinstall "Virtualization Tools" command. 
 
 

KVM and virtualization in Red Hat Enterprise Linux

What is KVM?
KVM (Kernel-based Virtual Machine) is a full virtualization solution for Linux on AMD64 and Intel 64 hardware that is built into the standard Red Hat Enterprise Linux 6 kernel. It can run multiple, unmodified Windows and Linux guest operating systems. The KVM hypervisor in Red Hat Enterprise Linux is managed with the libvirt API and tools built for libvirt (such as virt-manager and virsh). Virtual machines are executed and run as multi-threaded Linux processes controlled by these tools.
Overcommitting
The KVM hypervisor supports overcommitting of system resources. Overcommitting means allocating more virtualized CPUs or memory than the available resources on the system. Memory overcommitting allows hosts to utilize memory and virtual memory to increase guest densities.
Thin provisioning
Thin provisioning allows the allocation of flexible storage and optimizes the available space for every guest virtual machine. It gives the appearance that there is more physical storage on the guest than is actually available. This is not the same as overcommitting as this only pertains to storage and not CPUs or memory allocations. However, like overcommitting, the same warning applies.
KSM
Kernel SamePage Merging (KSM), used by the KVM hypervisor, allows KVM guests to share identical memory pages. These shared pages are usually common libraries or other identical, high-use data. KSM allows for greater guest density of identical or similar guest operating systems by avoiding memory duplication.
QEMU Guest Agent
The QEMU Guest Agent runs on the guest operating system and allows the host machine to issue commands to the guest operating system.
Disk I/O throttling
When several virtual machines are running simultaneously, they can interfere with system performance by using excessive disk I/O. Disk I/O throttling in KVM provides the ability to set a limit on disk I/O requests sent from virtual machines to the host machine. This can prevent a virtual machine from over utilizing shared resources, and impacting the performance of other virtual machines.
The libvirt package provides:
  • A common, generic, and stable layer to securely manage virtual machines on a host.
  • A common interface for managing local systems and networked hosts.
  • All of the APIs required to provision, create, modify, monitor, control, migrate, and stop virtual machines, but only if the hypervisor supports these operations. Although multiple hosts may be accessed with libvirt simultaneously, the APIs are limited to single node operations.
The libvirt package is designed as a building block for higher level management tools and applications, for example, virt-manager and the virsh command-line management tools. 
virsh
The virsh command-line tool is built on the libvirt management API and operates as an alternative to the graphical virt-manager application. The virsh command can be used in read-only mode by unprivileged users or, with root access, full administration functionality. The virsh command is ideal for scripting virtualization administration.
virt-manager
virt-manager is a graphical desktop tool for managing virtual machines. It allows access to graphical guest consoles and can be used to perform virtualization administration, virtual machine creation, migration, and configuration tasks. The ability to view virtual machines, host statistics, device information and performance graphs is also provided. The local hypervisor and remote hypervisors can be managed through a single interface.