devstack

  • Git clone openstack requirements fail

Error :

git clone git://git.openstack.org/openstack/requirements.git /opt/stack/requirements
 Cloning into '/opt/stack/requirements'...
 fatal: unable to connect to git.openstack.org:

Solution: add below to local.conf.

GIT_BASE=${GIT_BASE:-https://git.openstack.org}
  • generate-subunit: command not found

Error: /opt/stack/devstack/functions-common:538:git_timed
/opt/stack/devstack/functions-common:602:die
[ERROR] /opt/stack/devstack/functions-common:602 git call failed: [git clone git://git.openstack.org/openstack/requirements.git /opt/stack/requirements –branch master]
Error on exit
./stack.sh: line 506: generate-subunit: command not found

Solution:

sudo apt-get install python-pip

sudo pip install –upgrade pip

sudo pip install -U os-testr

  • server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

export GIT_SSL_NO_VERIFY=1
#or
git config --global http.sslverify false

Debug NTP Client with no server suitable for synchronization found error

  • Test UDP port:

nmap -p 123 -sU -P0 ntp.server

  • ntpdate -vd ntp.server

transmit(ntp.server)
receive(ntp.server)
…………
ntp.server: Server dropped: strata too high
server ntp.server, port 123
stratum 16, precision -23, leap 11, trust 000
refid [ntp.server], delay 0.02596, dispersion 0.00002
transmitted 4, in filter 4
reference time: 00000000.00000000 Mon, Jan 1 1900 8:05:43.000

  • Check st status. As it’s 16 , Seems NTP server failed sync up

# ntpq -p
remote                      refid st t when poll reach delay offset jitter
============================================================================
ntp.server01               .INIT. 16 u – 1024 0 0.000 0.000 0.000
ntp.server02               .INIT. 16 u – 1024 0 0.000 0.000 0.000
ntp.server03               .INIT. 16 u – 1024 0 0.000 0.000 0.000
ntp.server04               .INIT. 16 u – 1024 0 0.000 0.000 0.000

  • In NTP Server , check it stratam status, if still equip 16, then change NTP server configuration in NTP server with top level and restart NTP service.

XRDP Server in Linux

SLES12

  • Install XRDP Server

rpm -ivh xrdp vncmanager libboost_iostreams1 libboost_program_options1 vncmanager-greeter

  • Open firewall port for xrdp (3389)
  • systemctl start xrdp && systemctl enable xrdp
  • For Connecting from Windows, Start “remote Desktop connection”.

NIS master and slave server in CentOS7

  • NIS Master Server
#yum install nfs-utils rpcbind ypserv yp-tools -y

#ypdomainname lab
#vim /etc/sysconfig/network
NISDOMAIN=lab
HOSTNAME=nis-master.lab.xxx.com
#vim /etc/hosts
127.0.0.1   nis-master nis-master.lab.xxx.com
xxx.xxx.xxx.xxx        nis-slave    nis-slave.lab.xxx.com

#systemctl start rpcbind ypserv ypxfrd yppasswdd
#systemctl enable rpcbind ypserv ypxfrd yppasswdd

# vim /etc/passwd
+::::::
+@labops::::::
# vim /etc/shadow
+::::::::
# vim /etc/group
+:::
# vim /etc/nsswitch.conf
passwd: compat
shadow: files
group: files nis
hosts: files dns
bootparams: files nis
ethers: files nis
netmasks: files nis
networks: files nis
protocols: files nis
rpc: files nis
services: files nis
netgroup: files nis
publickey: files nis
automount: files
aliases: files nis
#vim /etc/netgroup 
labops (-,admin1,) (-,admin2,) (-,admin3,)
labdev (-,dev01,)

#systemctl restart rpcbind ypserv ypxfrd yppasswdd

# /usr/lib64/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS
servers. nis-master is in the list of NIS server hosts. Please continue to add
the names for the other hosts, one per line. When you are done with the
list, type a <control D>.
 next host to add: nis-master
 next host to add: nis-slave 
 next host to add: 
The current list of NIS servers looks like this:

nis-master
nis-slave

Is this correct? [y/n: y] y
We need a few minutes to build the databases...
Building /var/yp/bjlab/ypservers...
Running /var/yp/Makefile...
 ake[1]: Entering directory `/var/yp/bjlab'
鈻[6ning passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
Updating hosts.byname...
Updating hosts.byaddr...
Updating rpc.byname...
Updating rpc.bynumber...
Updating services.byname...
Updating services.byservicename...
Updating netid.byname...
Updating protocols.bynumber...
Updating protocols.byname...
Updating mail.aliases...
gmake[1]: Leaving directory `/var/yp/bjlab'

nis-master has been set up as a NIS master server.

Now you can run ypinit -s nis-master on all slave server


#systemctl start ypxfrd yppasswdd autofs
#cd /var/yp/
make

#vim /etc/exports
/nfs 10.10.10.0/24(rw,sync,no_root_squash,no_subtree_check) 10.10.20.0/24(rw,sync,no_root_squash,no_subtree_check)
#vim /etc/auto.nfs
admin1 -rw,intr,nosuid nfs.domain:/nfs/admin1
admin2 -rw,intr,nosuid nfs.domain:/nfs/admin2
admin3 -rw,intr,nosuid nfs.domain:/nfs/admin3 
#systemctl start rpcbind nfs-server autofs
#firewall-cmd --add-service=nfs --permanent
#firewall-cmd --reload

  • NIS Slave Server
#yum install rpcbind  ypserv ypbind vim-enhanced -y
#systemctl enable rpcbind ypserv nfs-utils yp-tools
#systemctl start rpcbind ypserv
#ypdomainname lab
#vim /etc/sysconfig/network
NISDOMAIN=lab
HOSTNAME=nis-slave.lab.xxx.com
#vim /etc/hosts
127.0.0.1   nis-slave nis-slave.lab.xxx.com
xxx.xxx.xxx.xxx        nis-master    nis-master.lab.xxx.com
# vim /etc/passwd
+::::::
+@labops::::::
# vim /etc/shadow
+::::::::
# vim /etc/group
+:::
# vim /etc/nsswitch.conf
passwd: compat
shadow: files
group: files nis
hosts: files dns
bootparams: files nis
ethers: files nis
netmasks: files nis
networks: files nis
protocols: files nis
rpc: files nis
services: files nis
netgroup: files nis
publickey: files nis
automount: files
aliases: files nis
#vim /etc/netgroup 
labops (-,admin1,) (-,admin2,) (-,admin3,)
labdev (-,dev01,)
#/usr/lib64/yp/ypinit -s nis-master
#
  • NIS Client
#yum install ypbind autofs -y
#ypdomainname lab
#vim /etc/sysconfig/network
NISDOMAIN=lab
HOSTNAME=nis-client.lab.xxx.com

# vim /etc/passwd
+::::::
+@labops::::::
# vim /etc/shadow
+::::::::
# vim /etc/group
+:::
# vim /etc/nsswitch.conf
passwd: compat
shadow: files
group: files nis
hosts: files dns
bootparams: files nis
ethers: files nis
netmasks: files nis
networks: files nis
protocols: files nis
rpc: files nis
services: files nis
netgroup: files nis
publickey: files nis
automount: files
aliases: files nis
#vim /etc/auto.master
/nfs    yp:auto.nfs     -nobrowse
#systemctl enable ypbind autofs
#systemctl start ypbind autofs
#ypcat passwd

Rescan new storage in VM without reboot

Linux, when adding a new disc

First find your host bus number

grep mpt /sys/class/scsi_host/host?/proc_name

Which should return a line like

/sys/class/scsi_host/hostX/proc_name:mptspi

use this to rescan the bus with the following command

echo "- - -" > /sys/class/scsi_host/hostX/scan

In the above command the the hyphens represent controller,channel,lun, so – – – indicates all controllers, all channels and all luns should be scanned.

iSCSI and Multipath in CentOS7

  • Install iSCSI Package

#yum install -y device-mapper-multipath iscsi-initiator-utils

  • Check iSCSI initiator name and register it in Storage system

# more /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.1994-05.com.redhat:58889c0d19b

  • Discovery and Login iSCSI storage

# iscsiadm -m discovery -t st -p 10.62.50.241

# iscsiadm -m node -o show

# iscsiadm -m node –login

# iscsiadm -m session -o show

  • Multipath Configuration

# systemctl start multipathd

# systemctl enable multipathd

# cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/

# multipath -F

# multipath -v2

# multipath -ll
mpathb (360060160dc613c0049eb4a6e1f4fe611) dm-4 DGC ,VRAID
size=100G features=’2 queue_if_no_path retain_attached_hw_handler’ hwhandler=’1 alua’ wp=rw
|-+- policy=’service-time 0′ prio=50 status=active
| `- 6:0:0:1 sdf 8:80 active ready running
`-+- policy=’service-time 0′ prio=10 status=enabled
`- 7:0:0:1 sdg 8:96 active ready running
mpatha (360060160dc613c0047eb4a6e1f4fe611) dm-3 DGC ,VRAID
size=100G features=’2 queue_if_no_path retain_attached_hw_handler’ hwhandler=’1 alua’ wp=rw
|-+- policy=’service-time 0′ prio=50 status=active
| `- 7:0:0:0 sde 8:64 active ready running
`-+- policy=’service-time 0′ prio=10 status=enabled
`- 6:0:0:0 sdd 8:48 active ready running

# grep -v ^# /etc/multipath.conf|grep -v ^$
defaults {
polling_interval 10
path_selector “round-robin 0”
path_grouping_policy multibus
uid_attribute ID_SERIAL
prio alua
path_checker readsector0
rr_min_io 100
max_fds 8192
rr_weight priorities
failback immediate
no_path_retry fail
user_friendly_names yes
find_multipaths yes
}
blacklist {
devnode “^cciss!c[0-9]d[0-9]*”
devnode “^vg*”
}
devices {
device {
vendor “EMC ”
product “VNX 5800”
path_grouping_policy multibus
path_checker readsector0
path_selector “round-robin 0”
hardware_handler “0”
failback 5
rr_weight priorities
no_path_retry queue
}
device {
vendor “COMPAQ ”
product “MSA1000 ”
path_grouping_policy multibus
}
}
multipaths {
multipath {
wwid 360060160dc613c0047eb4a6e1f4fe611
alias LUN5
}
multipath {
wwid 360060160dc613c0049eb4a6e1f4fe611
alias LUN6
}
}

# multipath -F

# multipath -ll
LUN6 (360060160dc613c0049eb4a6e1f4fe611) dm-4 DGC ,VRAID
size=100G features=’2 queue_if_no_path retain_attached_hw_handler’ hwhandler=’1 alua’ wp=rw
|-+- policy=’round-robin 0′ prio=50 status=active
| `- 6:0:0:1 sdf 8:80 active ready running
`-+- policy=’round-robin 0′ prio=10 status=enabled
`- 7:0:0:1 sdg 8:96 active ready running
LUN5 (360060160dc613c0047eb4a6e1f4fe611) dm-3 DGC ,VRAID
size=100G features=’2 queue_if_no_path retain_attached_hw_handler’ hwhandler=’1 alua’ wp=rw
|-+- policy=’round-robin 0′ prio=50 status=active
| `- 7:0:0:0 sde 8:64 active ready running
`-+- policy=’round-robin 0′ prio=10 status=enabled
`- 6:0:0:0 sdd 8:48 active ready running

# lsblk

# ls /dev/mapper/ -rlta
total 0
crw——-. 1 root root 10, 236 Jul 27 17:24 control
lrwxrwxrwx. 1 root root 7 Jul 27 17:24 centos-swap -> ../dm-1
lrwxrwxrwx. 1 root root 7 Jul 27 17:24 centos-root -> ../dm-0
lrwxrwxrwx. 1 root root 7 Jul 27 17:24 centos-home -> ../dm-2
drwxr-xr-x. 20 root root 3660 Jul 28 10:49 ..
lrwxrwxrwx. 1 root root 7 Jul 28 10:49 LUN5 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Jul 28 10:49 LUN6 -> ../dm-4

# fdisk /dev/mapper/LUN5

# fdisk /dev/mapper/LUN6

 

Ubuntu Recovery mode

  1. Console on your computer.
  2. Wait until the BIOS has finished loading, or has almost finished. (During this time you will probably see a logo of your computer manufacturer.)
  3. Quickly press and hold the Shift key (or Escape key on some computers), which will bring up the GNU GRUB menu. (If you see the Ubuntu logo, you’ve missed the point where you can enter the GRUB menu.) **
  4. Select the line which starts with “Advanced options”. *
  5. Select the line ending with “(recovery mode)”, probably the second line, something like:

    Ubuntu GNU/Linux, with Linux 3.8.0-26-generic (recovery mode)

  6. Press Return and your machine will begin the boot process.
  7. After a few moments, your workstation should display a menu with a number of options. One of the options (you may need to scroll down to the bottom of the list) will be “Drop to root shell prompt”. Press Return with this option highlighted.
  8. The root partition is mounted read-only. To mount it read/write, enter the command
    mount -o remount,rw /

Free Up and Release the Unused/Cached Memory in Linux

Monitor memory usage

  • watch -n 3 cat /proc/meminfo
  • watch -n 3 free -m

Releasing the Memory

1. Freeing Up the Page Cache

echo 1 > /proc/sys/vm/drop_caches

2. Freeing Up the Dentries and Inodes

echo 2 > /proc/sys/vm/drop_caches

3. Freeing Up the Page Cache, Dentries and Inodes

echo 3 > /proc/sys/vm/drop_caches

4. Flushing the File System Buffers

sync

Clear Swap Memory

  • Free memory should be over swap usage before this command
    swapoff -a
    swapon -a

CISCO 6500 Upgrade IOS

  • Copy IOS file into bootflash or sup-bootdisk

copy tftp sup-bootdisk:s3223-adventerprise_wan-mz.122-33.SXI13.bin

  • Verify IOS file

dir sup-bootdisk:

dir bootflash:

dir disk0:

verify /md5 sup-bootdisk:s3223-adventerprise_wan-mz.122-33.SXI13.bin

show bootvar

  • Set boot variable

boot system flash bootflash:s3223-adventerprise_wan-mz.122-33.SXI13.bin prepend

boot system flash sup-bootdisk:s3223-adventerprise_wan-mz.122-33.SXI13.bin
wr

reload

  • verify access