Installation/configuration iscsi and multipath on RHEL7

Lab envirement:
OS Verson: RHEL7.4 , kernel 3.10.0-693.21.1.el7.x86_64
LAB1:Install and config iscsi-target and iscsi-initator
LAB2:Install and config Multipath
We are going to start the LAB1:iSCSI
1.we have two server, listed as below:
  • rhel7-iscsi-target 192.168.1.204
    • /dev/sdb <— here is our block device
  • rhel7-iscsi-initator 192.168.1.206
2.start to install iscsi packages in rhel7-iscsi-target
[root@rhel7-iscci-target ~]# yum install targetcli
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
–> Running transaction check
—> Package targetcli.noarch 0:2.1.fb46-1.el7 will be installed
–> Processing Dependency: python-rtslib >= 2.1.fb41 for package: targetcli-2.1.fb46-1.el7.noarch
–> Processing Dependency: python-configshell for package: targetcli-2.1.fb46-1.el7.noarch
–> Running transaction check
—> Package python-configshell.noarch 1:1.1.fb23-3.el7 will be installed
–> Processing Dependency: pyparsing for package: 1:python-configshell-1.1.fb23-3.el7.noarch
–> Processing Dependency: python-six for package: 1:python-configshell-1.1.fb23-3.el7.noarch
–> Processing Dependency: python-urwid for package: 1:python-configshell-1.1.fb23-3.el7.noarch
—> Package python-rtslib.noarch 0:2.1.fb63-2.el7 will be installed
–> Processing Dependency: python-kmod for package: python-rtslib-2.1.fb63-2.el7.noarch
–> Running transaction check
—> Package pyparsing.noarch 0:1.5.6-9.el7 will be installed
—> Package python-kmod.x86_64 0:0.9-4.el7 will be installed
—> Package python-six.noarch 0:1.9.0-2.el7 will be installed
—> Package python-urwid.x86_64 0:1.1.1-3.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================
Package                             Arch                    Version                              Repository                           Size
============================================================================================================================================
Installing:
targetcli                           noarch                  2.1.fb46-1.el7                       rhel-7-server-rpms                   64 k
Installing for dependencies:
pyparsing                           noarch                  1.5.6-9.el7                          rhel-7-server-rpms                   94 k
python-configshell                  noarch                  1:1.1.fb23-3.el7                     rhel-7-server-rpms                   67 k
python-kmod                         x86_64                  0.9-4.el7                            rhel-7-server-rpms                   57 k
python-rtslib                       noarch                  2.1.fb63-2.el7                       rhel-7-server-rpms                   97 k
python-six                          noarch                  1.9.0-2.el7                          rhel-7-server-rpms                   29 k
python-urwid                        x86_64                  1.1.1-3.el7                          rhel-7-server-rpms                  654 k
Transaction Summary
============================================================================================================================================
Install  1 Package (+6 Dependent packages)
Total download size: 1.0 M
Installed size: 4.7 M
Is this ok [y/d/N]: y
3.load the target modules
[root@rhel7-iscci-target ~]# systemctl start target
[root@rhel7-iscci-target ~]# systemctl enable target
Created symlink from /etc/systemd/system/multi-user.target.wants/target.service to /usr/lib/systemd/system/target.service.
4.ours block device is /dev/sdb
[root@rhel7-iscci-target ~]# fdisk -l /dev/sdb
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
5.Enter the targetcli shell.
[root@rhel7-iscci-target ~]# targetcli
Warning: Could not load preferences file /root/.targetcli/prefs.bin.
targetcli shell version 2.1.fb46
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type ‘help’.
/>
6.Start by add your device under /backsstores/block. I’m using the lu0 for my already existing blockdevice(/dev/sda):
/> cd /backstores/block
/backstores/block> create lun0 /dev/sdb
Created block storage object lun0 using /dev/sdb.
/backstores/block>
7.Switch to the /iscsi and create a new iqn. The iqn will be create4d randomly if you do not specify one.
/backstores/block> cd /iscsi
/iscsi> create
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.
/iscsi>
8.Change to your iqn directory and then to the tpg1 directory
/iscsi> ls
o- iscsi ……………………………………………………………………………………………….. [Targets: 1]
  o- iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804 ………………………………………… [TPGs: 1]
    o- tpg1 ……………………………………………………………………………………. [no-gen-acls, no-auth]
      o- acls ……………………………………………………………………………………………… [ACLs: 0]
      o- luns ……………………………………………………………………………………………… [LUNs: 0]
      o- portals ………………………………………………………………………………………… [Portals: 1]
        o- 0.0.0.0:3260 …………………………………………………………………………………………. [OK]
/iscsi> cd iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804/tpg1/
/iscsi/iqn.20…e813c804/tpg1>
9.Obtian you initator name from client (rhel7-iscsi-initator)
  9.1 login to your rhel7-iscsi-initator and install iscsi-initiator-utils package
[root@rhel7-iscsi-initator ~]# yum install iscsi-initiator-utils
Dependencies Resolved
============================================================================================================================================
Package                                       Arch                  Version                        Repository                         Size
============================================================================================================================================
Installing:
iscsi-initiator-utils                         x86_64                6.2.0.874-4.el7                rhel-7-server-rpms                420 k
Installing for dependencies:
iscsi-initiator-utils-iscsiuio                x86_64                6.2.0.874-4.el7                rhel-7-server-rpms                 90 k
Transaction Summary
============================================================================================================================================
Install  1 Package (+1 Dependent package)
Total download size: 510 k
Installed size: 2.5 M
Is this ok [y/d/N]:
 9.2 Obtian you initator name from client (rhel7-iscsi-initator)
[root@rhel7-iscsi-initator ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.1994-05.com.redhat:466722ae5ba
[root@rhel7-iscsi-initator ~]#
 9.3 start and enable iscsid
[root@rhel7-iscsi-initator ~]# systemctl enable iscsid.service
Created symlink from /etc/systemd/system/multi-user.target.wants/iscsid.service to /usr/lib/systemd/system/iscsid.service.
[root@rhel7-iscsi-initator ~]# systemctl start iscsid.service
10.setup acls for the hosts that can login to this portal under /acls, go back to the “rhel7-iscsi-target”
/iscsi/iqn.20…e813c804/tpg1> cd acls
/iscsi/iqn.20…804/tpg1/acls> create iqn.1994-05.com.redhat:466722ae5ba
Created Node ACL for iqn.1994-05.com.redhat:466722ae5ba
/iscsi/iqn.20…804/tpg1/acls>
11.Create a portal. This will be the IP address that we will listen on,go back to the “rhel7-iscsi-target”
/iscsi/iqn.20…804/tpg1/acls> cd ../portals/
/iscsi/iqn.20…/tpg1/portals> create
Using default IP port 3260
Binding to INADDR_ANY (0.0.0.0)
This NetworkPortal already exists in configFS
/iscsi/iqn.20…/tpg1/portals> delete 0.0.0.0 3260
Deleted network portal 0.0.0.0:3260
/iscsi/iqn.20…/tpg1/portals> create
Using default IP port 3260
Binding to INADDR_ANY (0.0.0.0)
Created network portal 0.0.0.0:3260.
/iscsi/iqn.20…/tpg1/portals>
12.Add the lun we reated in step 6 to this target
/iscsi/iqn.20…/tpg1/portals> cd ..
/iscsi/iqn.20…e813c804/tpg1> cd luns
/iscsi/iqn.20…804/tpg1/luns> ls
o- luns …………………………………………………………………………………………………… [LUNs: 0]
/iscsi/iqn.20…804/tpg1/luns> create /backstores/block/lun0
Created LUN 0.
Created LUN 0->0 mapping in node ACL iqn.1994-05.com.redhat:466722ae5ba
/iscsi/iqn.20…804/tpg1/luns>
13.Check your configuration
/iscsi/iqn.20…804/tpg1/luns> cd ../..
/iscsi/iqn.20….b4ebe813c804> ls
o- iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804 ………………………………………….. [TPGs: 1]
  o- tpg1 ……………………………………………………………………………………… [no-gen-acls, no-auth]
    o- acls ……………………………………………………………………………………………….. [ACLs: 1]
    | o- iqn.1994-05.com.redhat:466722ae5ba …………………………………………………………….. [Mapped LUNs: 1]
    |   o- mapped_lun0 ………………………………………………………………………….. [lun0 block/lun0 (rw)]
    o- luns ……………………………………………………………………………………………….. [LUNs: 1]
    | o- lun0 ………………………………………………………………… [block/lun0 (/dev/sdb) (default_tg_pt_gp)]
    o- portals ………………………………………………………………………………………….. [Portals: 1]
      o- 0.0.0.0:3260 …………………………………………………………………………………………… [OK]
/iscsi/iqn.20….b4ebe813c804>
14.Finally, save your configurations and exit
/iscsi/iqn.20….b4ebe813c804> cd /
/> saveconfig
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
/> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
[root@rhel7-iscci-target ~]#
15.Now, we change to iscsi-initator to run a discobery against the target to verify your iqn is available.
[root@rhel7-iscsi-initator ~]# iscsiadm –mode discoverydb –type sendtargets –portal 192.168.1.204 –discover 192.168.1.204:3261,1 iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804
192.168.1.204:3260,1 iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804
16.Login to this target
[root@rhel7-iscsi-initator ~]# iscsiadm –mode node –targetname iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804 –portal 192.168.1.204 –login
Logging in to [iface: default, target: iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804, portal: 192.168.1.204,3260] (multiple)
Login to [iface: default, target: iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804, portal: 192.168.1.204,3260] successful.
17.Verify your new device is available
[root@rhel7-iscsi-initator ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 2.0
  Type:   Direct-Access                    ANSI  SCSI revision: 06
Host: scsi33 Channel: 00 Id: 00 Lun: 00
  Vendor: LIO-ORG  Model: lun0             Rev: 4.0
  Type:   Direct-Access                    ANSI  SCSI revision: 05
[root@rhel7-iscsi-initator ~]# fdisk -l
Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00008d56
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    83886079    40893440   8e  Linux LVM
Disk /dev/mapper/rhel-root: 39.7 GB, 39720058880 bytes, 77578240 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/rhel-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33550336 bytes
19.another job, because we want to demo multipath so that I need create another iscsi path, the IP is 192.168.1.205
[root@rhel7-iscsi-initator ~]# iscsiadm –mode discoverydb –type sendtargets –portal 192.168.1.205 –discover 192.168.1.205:3261,1 iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804
192.168.1.205:3260,1 iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804
[root@rhel7-iscsi-initator ~]# iscsiadm –mode node –targetname iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804 –portal 192.168.1.205 –login
Logging in to [iface: default, target: iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804, portal: 192.168.1.205,3260] (multiple)
Login to [iface: default, target: iqn.2003-01.org.linux-iscsi.rhel7-iscci-target.x8664:sn.b4ebe813c804, portal: 192.168.1.205,3260] successful.
20.Verify your device is available again, you will see two disk in same lun0
[root@rhel7-iscsi-initator ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 2.0
  Type:   Direct-Access                    ANSI  SCSI revision: 06
Host: scsi33 Channel: 00 Id: 00 Lun: 00
  Vendor: LIO-ORG  Model: lun0             Rev: 4.0
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi34 Channel: 00 Id: 00 Lun: 00
  Vendor: LIO-ORG  Model: lun0             Rev: 4.0
  Type:   Direct-Access                    ANSI  SCSI revision: 05
[root@rhel7-iscsi-initator ~]# fdisk -l
Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00008d56
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    83886079    40893440   8e  Linux LVM
Disk /dev/mapper/rhel-root: 39.7 GB, 39720058880 bytes, 77578240 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/rhel-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33550336 bytes
 
 
Disk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33550336 bytes
[root@rhel7-iscsi-initator ~]#
—For now, we already create two path for iscsi-initator. Next we will start to install multipath and config multipath in rhel-iscsi-initator server.—
We are going to start the LAB2:Multipath
1.install Device-mapper-multipath (DM multipath) package
[root@rhel7-iscsi-initator ~]# yum install device-mapper-multipath
============================================================================================================================================
Package                                     Arch                  Version                          Repository                         Size
============================================================================================================================================
Installing:
device-mapper-multipath                     x86_64                0.4.9-111.el7_4.2                rhel-7-server-rpms                134 k
Installing for dependencies:
boost-system                                x86_64                1.53.0-27.el7                    rhel-7-server-rpms                 40 k
boost-thread                                x86_64                1.53.0-27.el7                    rhel-7-server-rpms                 57 k
device-mapper-multipath-libs                x86_64                0.4.9-111.el7_4.2                rhel-7-server-rpms                252 k
librados2                                   x86_64                1:0.94.5-2.el7                   rhel-7-server-rpms                1.7 M
Transaction Summary
============================================================================================================================================
Install  1 Package (+4 Dependent packages)
Total download size: 2.1 M
Installed size: 6.0 M
Is this ok [y/d/N]:
2.Create multipath.conf, we have two way to create multipath.conf
 2.1#mpathconf —enable —with_multipathd y
 2.2cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/multipath.conf
3.we need find out wwid like as below:
use lsscsi -i
[root@rhel7-iscsi-initator ~]# lsscsi -i
[0:0:0:0]    disk    VMware   Virtual disk     2.0   /dev/sda   –
[33:0:0:0]   disk    LIO-ORG  lun0             4.0   /dev/sdb   36001405e01a53e31a2a4705bff8630bc
[34:0:0:0]   disk    LIO-ORG  lun0             4.0   /dev/sdc   36001405e01a53e31a2a4705bff8630bc
fdisk -l
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33550336 bytes
Disk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33550336 bytes
Disk /dev/mapper/mpatha: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33550336 bytes
lsblk
[root@rhel7-iscsi-initator ~]# lsblk
NAME          MAJ:MIN RM SIZE RO TYPE  MOUNTPOINT
sda             8:0    0  40G  0 disk
├─sda1          8:1    0   1G  0 part  /boot
└─sda2          8:2    0  39G  0 part
  ├─rhel-root 253:0    0  37G  0 lvm   /
  └─rhel-swap 253:1    0   2G  0 lvm   [SWAP]
sdb             8:16   0  20G  0 disk
└─mpatha      253:2    0  20G  0 mpath
sdc             8:32   0  20G  0 disk
└─mpatha      253:2    0  20G  0 mpath
[root@rhel7-iscsi-initator ~]# cat /sys/block/sda/device/vendor
VMware
[root@rhel7-iscsi-initator ~]# cat /sys/block/sdb/device/vendor
LIO-ORG
[root@rhel7-iscsi-initator ~]#
To view all attached SCSI devices
[root@rhel7-iscsi-initator ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 2.0
  Type:   Direct-Access                    ANSI  SCSI revision: 06
Host: scsi33 Channel: 00 Id: 00 Lun: 00
  Vendor: LIO-ORG  Model: lun0             Rev: 4.0
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi34 Channel: 00 Id: 00 Lun: 00
  Vendor: LIO-ORG  Model: lun0             Rev: 4.0
  Type:   Direct-Access                    ANSI  SCSI revision: 05
To determine vendor and model (product) strings for a specific SCSI disk device (replace sda with the device in question):
[root@rhel7-iscsi-initator ~]# cat /sys/block/sda/device/vendor
VMware
[root@rhel7-iscsi-initator ~]# cat /sys/block/sda/device/model
Virtual disk
[root@rhel7-iscsi-initator ~]# cat /sys/block/sdb/device/vendor
LIO-ORG
[root@rhel7-iscsi-initator ~]# cat /sys/block/sdb/device/model
lun0
4.we can use vim/vi to edit /etc/multipath.conf you want.
defaults {
    polling_interval     10
    path_selector        “round-robin 0″
    path_grouping_policy    multibus
    uid_attribute        ID_SERIAL
    prio            alua
    rr_min_io        100
    max_fds            8192
    rr_weight        priorities
    failback        immediate
    no_path_retry        fail
    user_friendly_names    yes
}
blacklist {
    devnode “^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
    devnode “^hd[a-z]"
}
multipaths {
    multipath {
        wwid            36001405e01a53e31a2a4705bff8630bc
        alias            iscsilab
    }
}
5.Check multipath status. to use multipath -ll
root@rhel7-iscsi-initator ~]# multipath -ll
iscsilab (36001405e01a53e31a2a4705bff8630bc) dm-2 LIO-ORG ,lun0
size=20G features=’0′ hwhandler=’0′ wp=rw
`-+- policy=’round-robin 0′ prio=50 status=active
  |- 33:0:0:0 sdb 8:16 active ready running
  `- 34:0:0:0 sdc 8:32 active ready running
*If you have previously created a multipath device without using the find_multipaths parameter and then you later set the parameter to yes, you may need to remove the WWIDs of any device you do not want created as a multipath device from the /etc/multipath/wwids file. The following shows a sample /etc/multipath/wwids file. The WWIDs are enclosed by slashes (/):
[root@rhel7-iscsi-initator ~]# cat /etc/multipath/wwids
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/36001405e01a53e31a2a4705bff8630bc/
6.to mount the multipath disk
[root@rhel7-iscsi-initator ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Oct 31 22:44:37 2017
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk’
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rhel-root   /                       xfs     defaults        0 0
UUID=994ab371-55a5-48bc-a6bc-7d1fbc547021 /boot                   xfs     defaults        0 0
/dev/mapper/rhel-swap   swap                    swap    defaults        0 0
/dev/mapper/iscsilab     /multipath_lab         xfs     defaults        0 0
[root@rhel7-iscsi-initator ~]# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   37G  1.5G   36G   4% /
devtmpfs               910M     0  910M   0% /dev
tmpfs                  920M     0  920M   0% /dev/shm
tmpfs                  920M  8.6M  912M   1% /run
tmpfs                  920M     0  920M   0% /sys/fs/cgroup
/dev/sda1             1014M  185M  830M  19% /boot
tmpfs                  184M     0  184M   0% /run/user/0
/dev/mapper/iscsilab    20G   33M   20G   1% /multipath_lab
7.Check Command
 multipathd -k
>show config
>list paths
>list|show status
>show topology

 

Ansible Install

1.Install Ansible need the python2 version over 2.4
  • Python 2.4
  • if ansbile client install python2 before 2.5 version, need install python-simplejson
  • if enable SELinux, need install libselinux-python packages then it can copy function something like it .
  • if use dnf module, you need install python-dnf packages
2.Strart to install
  • yum list installed python
  • yum install -y ansible

NFS Automounter Configuration by SuSE 11.2

Automounter Configuration

When you use the method described in “NFS Client Configuration" on page 27 to mount home directories, all home directories on the server are visible on the client machines. This can make it quite hard for a user to find his own home directory. With the automounter, only the directory needed by a user is mounted.

Another advantage of the automounter is the reduced number of actual mounts on the server, as only those directories get mounted by clients that are actually needed.

Unlike with a static configuration in the /etc/fstab file, with the automounter,

directories are mounted automatically when needed and unmounted automatically

when not in use for some time.

The kernel-based automounter is contained in the autofs package which is part of the

default installation.

In the past, the automounter was also used to mount and unmount CD-ROMs;

however, this functionality is now integrated into the KDE or Gnome desktop

environments. The automounter remains very useful to mount and unmount

directories that are exported by file servers.

The automounter configuration consists of the general /etc/auto.master file

and files that are referenced within /etc/auto.master, such as /etc/

auto.home.

To mount the home directories exported from another server, you need the following

entry in the /etc/auto.master file:

/home /etc/auto.home

The first column lists the mount point and the second column lists the file that

contains the configuration details for this mount point.

The /etc/auto.home file could look like the following (for NFSv4 the fstype

would be nfs4):

geeko -fstype=nfs,rw da1.digitalairlines.com:/home/geeko

As soon as some process accesses the local /home/geeko directory (the entry in

the first column, geeko, is appended to the directory given in the first column in the

/etc/auto.master file, /home), the local /home/geeko directory is created

and the /home/geeko directory from the server (last column) is mounted. After

some time or when the automounter is stopped, the remote directory is unmounted

and the mount point (/home/geeko in the example above) is deleted.

With several users, you would need an entry for each user. This is cumbersome, but

might be your only choice if home directories reside on several servers.

As long as all users have their home directories on one server, the automounter allows

you to simplify the configuration with the use of wildcards, as shown in the

following:

* -fstype=nfs,rw da1.digitalairlines.com:/home/&

The “*" in the first column denotes any directory below /home. The “&" in the last

column is replaced by whatever directory is accessed.

When the automounter configuration is complete, you start the automounter with

rcautofs start. To stop the automounter, use rcautofs stop. The

chkconfig autofs on command ensures the automounter is started

automatically when the system boots.

The following commands highlight how the automounter works:

When using NFS to import home directories, it is advisable to also use a networkbased

user database, like NIS or LDAP. This ensures that a user has the same UID no

matter where he logs in within the network.

Instead of local map files, it is also possible to use NIS (Network Information

System) or LDAP to distribute the automounter information

Config dump log in NPUM Agent

1.Go to the"npum\config" folder and edit unifi.xml


 

2.Add entry look like below <Dump log="1″ />, save the file and restart agent

 


 

PS: try to open unifi.xml with IE for testing.

 

3.if agent start work , we can see the dump log in the log folder

 


 

 

4.Open the debug mode in thle nupum manager host console.

 



 

RDP for SLES

可以在SLES安裝RDP套件,就可以使用Windows RDP Client連線到SLES上囉!!

參考網址:http://scn.sap.com/docs/DOC-52045

SuSE Manager 1.7

一、Install SuSE-Manager 1.7

You can download SuSE Manager Appliance ISO from http://www.suse.com

  1. Start the installation by booting from SuSE Manager Appliance installation medium and select Install/Restore SuSE-Manager-Server-pg


2. Select “YES" and press “Enter"



3. Select Language in “English" and Keyboard Layout in “Ensglish"


4. License Agreement


5. Type root password


6. Select Change to configure your network interfaces



7. Configure Customer Center



8. Finish Installation


  1. SuSE Manager Setup
  2. Login to the SuSe Manager Console


2. Execute command: Yast2 susemanager_setup


3.Fllow the Wizard to setup SuSE Manager










Finish

二、Login to the Web Console

1. Open the browser to connect the SuSE Manager Web Console: “https:// ip address "

First time connect, you need to create SuSE manager administrator


SuSE Subscription Management Tool (SMT)

一、簡介:

SuSE Subscription Management Tool(SMT)是提供SuSE Enterprise Linux(SLES) 線上更新服務的工具。一般安裝SLES時需要向SuSE 公司註冊以取得最新的線上套件更新。但若是我們今天有大量的SLES需要更新時將佔用的大量頻寬及時間。因此SuSE公司提供一套SMT管理工具,利用SMT幫我們預先下載SLES的Patches而我們只要將內部SLES指向SMT即可快速的更新SLES了。

二、安裝SMT

1.登入系統後開啟YAST (SLES 管理工具)


2.選擇Add-on Product


3.進入Add-On Product介面後,選擇add,加入SMT產品光碟資訊


4.選擇DVD,同時將SMT光碟放入DVD光碟機中,選擇Continue後載入SMT安裝資訊


5.選擇同意License Agreement


6.在pattern中會看SMT安裝資訊,點選Accept


7.顯示相依套件安裝資訊,點選continue即可開始安裝


8.安裝過程中會需要更換SLES11SP3原安裝光碟


9.再放入SMT光碟


10.安裝完成後即會開啟Configuration Wizard,請填入相關資訊,若開啟Firewall請勾選open port in Firewall


11.輸入Database User的密碼


12.註冊Novell Customer Center 資訊,依Wizard註冊即可。




13.安裝完成後,會再建主一次mysql root 的password



PS:若又出現Novell Customer Center註冊畫面,按"Next" 即可。



安裝完成

三、組態SMT

1.登入系統後執行YASTàNetwork Service àSMT Server Configureation


2.選擇Database and Reporting,在E-Mail Addresses加入欲收到report的E-Mail。

PS: Configuration: /etc/smt.conf


3.SMT 排程 YASTàNetwork Service àSMT Server Configuration

有五種Job排程:

  • Synchronization of Updates:Synchronizes with Novell Customer Center, updates repositories, and downloads new updates.
  • Generation of Reports:Generates and sends SMT Subscription Reports to addresses
  • NCC Registration:Registers all clients to Novell Customer Center that are not already registered or that changed their data since the last registration
  • Job Queue Cleanup:Cleans up queued jobs. It will remove finished or failed jobs from the job queue that are older than 8 days and remove job artifacts that remained in the database as result of an error
  • Uploading Support Configs:Uploading support configs is only available, when the SMT-support package is installed and manually added. To add it, click Add then select Uploading Support Configs from the Job to Run list.


4.設定欲 mirror repo : YASTàNetwork Service àSMT Server Managerment

在Repositories中選擇要Mirror的產品後點選Toggle Mirroring再點選Mirror Now即可



5.SLES Client 註冊

a.wget http://smt.site/repo/tools/clientSetup4SMT.sh

b. ./clientSetup4SMT.sh https://smt.site/center/regsvc

回答yes後即可註冊完成

6.QA

PS1:註冊時若有出現

ERROR: SSL peer certificate or SSH remote key was not OK: (51)(2)

ERROR: SSL peer certificate or SSH remote key was not OK: (51)(2)

應是輸入網址時沒有輸入完整的FQDN 名稱。如./clientSetup4SMT.sh https://smt/center/regsvc 導致憑證資訊不對。

因為在安裝我們使用的FQDN為smt.site因此建立憑證時為smt.site建立的。

PS2:另外也可重建CA,請參考: http://www.novell.com/support/kb/doc.php?id=7006024

PS3:利用zypper ref –s重新整理repo,若有出現Error請檢查SMT Server的Repo是否Download完成

Finished


SLE11 SP1 System freezes after more than 208 days uptime

Please reference : http://www.novell.com/support/kb/doc.php?id=7009834

Date 昨天,上個月表示法

昨天

data -d ‘ 1 days ago’ +%Y-%m-%d’

上個月

data -d ‘1 months ago’ +%Y-%m-%d’

 

 

用passwd直接改密碼-example

echo “12345″ l passwd –stdin useraccount