Custom Search

Thursday, November 26, 2015

How to git cherry-pick fix conflicts and edit commit message

1)
* -e --> to edit commit message
$ git cherry-pick -e ffed960e08b1aa340e020decc7cb5a735e7185ce
error: could not apply ffed960... update to working version of contrail module
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add ' or 'git rm '
hint: and commit the result with 'git commit'

2)
$git diff
Fix conflict

3)
$ git add Puppetfile

4)
$ git status
On branch kilo_multinode_contv2
You are currently cherry-picking commit ffed960.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:

    modified:   Puppetfile
    modified:   manifests/neutron/contrail/fip_pool.pp

5)
$ git cherry-pick -e --continue
[kilo_multinode_contv2 ba0dd5a] [bode] update to working version of contrail module
 Author: Dan Bode
 2 files changed, 7 insertions(+), 2 deletions(-)

6)
abort cherry-pick which has conflict and not required.
$ git cherry-pick --abort



Monday, November 23, 2015

under cloud neutron dnsmasq-dhcp debugging

* Here "40:ea:a7:33:7f:0e" is the MAC address of bare-metal node to be provisioned. We have enabled network boot (PXE boot) for the interface which has MAC address "40:ea:a7:33:7f:0e". So UC will get DHCP request from that interface of bare-metal node.

* Here "10.140.15.31" is the IP allocated by dnsmasq-dhcp server running in UC to bare-metal node.

* So we should able to capture following data while running "#nova boot" from UC and confirm that UC getting dhcp request from provisioned node.

1)
In UC:

root@uc1:~# tail -f /var/log/syslog | grep 40:ea:a7:33:7f:0e
Nov 23 02:15:50 uc1 dnsmasq-dhcp[42934]: DHCPDISCOVER(tapbe2e899a-38) 40:ea:a7:33:7f:0e
Nov 23 02:15:50 uc1 dnsmasq-dhcp[42934]: DHCPOFFER(tapbe2e899a-38) 10.140.15.31 40:ea:a7:33:7f:0e
Nov 23 02:15:54 uc1 dnsmasq-dhcp[42934]: DHCPREQUEST(tapbe2e899a-38) 10.140.15.31 40:ea:a7:33:7f:0e
Nov 23 02:15:54 uc1 dnsmasq-dhcp[42934]: DHCPACK(tapbe2e899a-38) 10.140.15.31 40:ea:a7:33:7f:0e host-10-140-15-31

2)
In UC:

a)
root@uc1:~# ip netns
exec qdhcp-f6e86850-32e9-4366-a03b-2b2a9ac481f0

b)
root@uc1:~# ip netns exec qdhcp-f6e86850-32e9-4366-a03b-2b2a9ac481f0 ifconfig
tapbe2e899a-38

c)
root@uc1:~# ip netns exec qdhcp-f6e86850-32e9-4366-a03b-2b2a9ac481f0 tcpdump -vv -i tapbe2e899a-38 | grep 40:ea:a7:33:7f:0e

    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 40:ea:a7:33:7f:0e (oui Unknown), length 548, xid 0xa7117f0d, secs 4, Flags [Broadcast] (0x8000)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 40:ea:a7:33:7f:0e (oui Unknown), length 548, xid 0xa7117f0d, secs 4, Flags [Broadcast] (0x8000)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
      source link-address option (1), length 8 (1): 40:ea:a7:33:7f:0e
      source link-address option (1), length 8 (1): 40:ea:a7:33:7f:0e
     
3)
In UC:

root@uc1:~# tcpdump -vv -i br-ctlplane | grep 40:ea:a7:33:7f:0e

tcpdump: listening on br-ctlplane, link-type EN10MB (Ethernet), capture size 65535 bytes
    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 40:ea:a7:33:7f:0e (oui Unknown), length 548, xid 0xa7117f0d, secs 4, Flags [Broadcast] (0x8000)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 40:ea:a7:33:7f:0e (oui Unknown), length 548, xid 0xa7117f0d, secs 4, Flags [Broadcast] (0x8000)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
      source link-address option (1), length 8 (1): 40:ea:a7:33:7f:0e
20:46:27.592585 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.140.15.31 is-at 40:ea:a7:33:7f:0e (oui Unknown), length 46
      source link-address option (1), length 8 (1): 40:ea:a7:33:7f:0e

4)
In UC:

root@uc1:~# tcpdump -vv -i phy-br-ctlplane | grep 40:ea:a7:33:7f:0e

tcpdump: WARNING: phy-br-ctlplane: no IPv4 address assigned
tcpdump: listening on phy-br-ctlplane, link-type EN10MB (Ethernet), capture size 65535 bytes

    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 40:ea:a7:33:7f:0e (oui Unknown), length 548, xid 0xa7117f0d, secs 4, Flags [Broadcast] (0x8000)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 40:ea:a7:33:7f:0e (oui Unknown), length 548, xid 0xa7117f0d, secs 4, Flags [Broadcast] (0x8000)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
      Client-Ethernet-Address 40:ea:a7:33:7f:0e (oui Unknown)
      source link-address option (1), length 8 (1): 40:ea:a7:33:7f:0e
      source link-address option (1), length 8 (1): 40:ea:a7:33:7f:0e

Sunday, November 22, 2015

find IP and MAC addresses allocated by neutron dnsmasq-dhcp server

1)
# ip netns
qdhcp-f6e86850-32e9-4366-a03b-2b2a9ac481f0

2)
# ip netns exec qdhcp-f6e86850-32e9-4366-a03b-2b2a9ac481f0 ifconfig

tapbe2e899a-38 Link encap:Ethernet  HWaddr fb:14:3e:41:56:c1

3)
# ip netns exec qdhcp-f6e86850-32e9-4366-a03b-2b2a9ac481f0 arp-scan --interface tapbe2e899a-38 10.140.15.255/24




ironic how to delete node faster

1)
First set provision-state to deleted

$nova delete [vm-id]
$ironic node-set-provision-state [node-id] deleted

Example:
$ironic node-set-provision-state 2d32d1dd-5363-47d4-a5d6-dc3a1fe7f496 deleted

2)
Then delete the node
$ironic node-delete  [node-id]

* This help us to delete node faster


ironic find all compute and storage nodes

# for x in $(ironic node-list | awk '{ print $2 }'); do ironic node-show $x | grep -E 'cpu_arch|ipmi_address';echo ""; done

Result:
-----------

| properties             | {u'memory_mb': 131072, u'cpu_arch': u'x86_64.g1.compute', u'local_gb': |
|                        | u'provisioner', u'ipmi_address': u'100.214.122.81', u'ipmi_password':   |

| properties             | {u'memory_mb': 131072, u'cpu_arch': u'x86_64.g1.compute', u'local_gb': |
|                        | u'provisioner', u'ipmi_address': u'100.214.122.82', u'ipmi_password':   |



ironic find ipmi address of all ironic nodes

1)
$for x in $(ironic node-list | awk '{ print $2 }'); do ironic node-show $x | grep ipmi_address; done

OR

$for x in $(ironic node-list | awk '{ print $2 }');
do
ironic node-show $x | grep ipmi_address;
done


Friday, November 20, 2015

ipmitool find Serial Number of all servers in a network

1)
for ip in $(nmap -sP 192.204.122.64/27 | grep "Nmap scan report for" | awk '{print $5}')
do
echo "IP: "$ip
echo "SNO: "$(ipmitool -I lanplus -H  $ip -U username -P password fru | grep "Product Serial")
echo "--------"
done

2)

ipmitool example

1)
Print system infos

fru - Field-replaceable unit
fru - Print built-in FRU and scan SDR for FRU locators
$ipmitool -I lanplus -H  192.204.122.80 -U username -P mypassword fru

2)
Find Product Serial

$ipmitool -I lanplus -H  192.204.122.80 -U username -P mypassword fru | grep “Product Serial”

3)
mc - Management Controller status and global enables

$ipmitool -I lanplus -H  192.204.122.80 -U username -P mypassword mc

4)
warm or cold system Reset/Restart

$ipmitool -I lanplus -H  192.204.122.80 -U username -P mypassword mc reset warm
$ipmitool -I lanplus -H 
192.204.122.80 -U username -P mypassword mc reset cold

5)
List all users

$ipmitool -I lanplus -H  15.200.122.80 -U username -P mypassword user list

6)
Launch interactive IPMI shell

$ipmitool -I lanplus -H  15.200.122.80 -U username -P mypassword shell

7)
Commands:
    raw           Send a RAW IPMI request and print response
    i2c           Send an I2C Master Write-Read command and print response
    spd           Print SPD info from remote I2C device
    lan           Configure LAN Channels
    chassis       Get chassis status and set power state
    power         Shortcut to chassis power commands
    event         Send pre-defined events to MC
    mc            Management Controller status and global enables
    sdr           Print Sensor Data Repository entries and readings
    sensor        Print detailed sensor information
    fru           Print built-in FRU and scan SDR for FRU locators
    gendev        Read/Write Device associated with Generic Device locators sdr
    sel           Print System Event Log (SEL)
    pef           Configure Platform Event Filtering (PEF)
    sol           Configure and connect IPMIv2.0 Serial-over-LAN
    tsol          Configure and connect with Tyan IPMIv1.5 Serial-over-LAN
    isol          Configure IPMIv1.5 Serial-over-LAN
    user          Configure Management Controller users
    channel       Configure Management Controller channels
    session       Print session information
    dcmi          Data Center Management Interface
    sunoem        OEM Commands for Sun servers
    kontronoem    OEM Commands for Kontron devices
    picmg         Run a PICMG/ATCA extended cmd
    fwum          Update IPMC using Kontron OEM Firmware Update Manager
    firewall      Configure Firmware Firewall
    delloem       OEM Commands for Dell systems
    shell         Launch interactive IPMI shell
    exec          Run list of commands from file
    set           Set runtime variable for shell and exec
    hpm           Update HPM components using PICMG HPM.1 file
    ekanalyzer    run FRU-Ekeying analyzer using FRU files
    ime           Update Intel Manageability Engine Firmware

8)











Wednesday, November 18, 2015

nmap and arp-scan

1)
nmap
$nmap -sP 15.200.122.64/27

2)
arp-scan
$arp-scan --interface em2 15.200.122.64/27



Friday, November 13, 2015

How to postgresql find and kill a hanging query

1)
Login as superuser
$ sudo -u postgres psql

2)
Find "procpid" of your problematic query by running
postgres=# select * from pg_stat_activity;

3)
Kill your problematic query
postgres=# select pg_terminate_backend(procpid);

Tuesday, November 10, 2015

How to enable tray icons bar Ubuntu 16.04 15.04 14.04 (Taskbar)


https://extensions.gnome.org/extension/615/appindicator-support/


https://extensions.gnome.org/extension/495/topicons/


Sunday, November 8, 2015

Probability Density (PDF) and Cumulative Distribution (CDF) Functions


https://www.youtube.com/watch?v=Q0auB05R3Vs

https://www.youtube.com/watch?v=1xQ4r2gcW3c

https://www.youtube.com/watch?v=S4r3J-nXlOA


Thursday, November 5, 2015

quanta node RAID and BIOS Access

1)
How to reboot quanta node.
Open ILO Web UI --> Remote Control --> Server Power Control -->  Reset Server --> Perform Action

2)
Press "F2 or F11 or F12", then "Ctrl+I" to Create/Delete RAID Volume

3)
Press "F11 or F12", then "Ctrl + S" to enter into setup menu (Bios)
Some time we need to press only F11.

a)
Enable PXE boot (Network boot)
"Advanced" --> "OnBoard Device Configuration" --> "Onboard LAN Port" --> "Enable with PXE"

4)
Press "F2" to enter into setup menu (Advanced Bios)

5)
Press "F11 or F12", then "Ctrl + C" to enter into LSI Corporation Utility

6)
How to Enable DHCP for ILO interface
Goto --> http://100.224.222.92 (u/p:admin) --> Configuration --> Network --> IPv4 Configuration --> Use DHC.

7)
How to install OS from ISO file

Remote console --> media --> virtual media wizard --> ISO Image (browse iso file) --> Click on "connect" button.
Then reboot quanta node.

8)