“Smartphy”的版本间的差异

来自qingwei personal wiki
跳转至: 导航搜索
看log
 
(未显示同一用户的5个中间版本)
第129行: 第129行:
 
=== 启动 ===
 
=== 启动 ===
 
<source lang="shell">
 
<source lang="shell">
BASE_URL=10.74.54.185 BASE_PORT=9000 HOST=10.74.54.185 npm start
+
干 -- BASE_URL=10.74.54.185 BASE_PORT=9000 HOST=10.74.54.185 npm start
 +
HOST=10.79.196.189 npm start
  
 
# 如何kill
 
# 如何kill
第135行: 第136行:
 
qingwyan  9392  9376 15 22:40 pts/21  00:00:48 node /home/qingwyan/workspace/robot-ui/node_modules/.bin/webpack-dev-server --inline --progress
 
qingwyan  9392  9376 15 22:40 pts/21  00:00:48 node /home/qingwyan/workspace/robot-ui/node_modules/.bin/webpack-dev-server --inline --progress
 
</source>
 
</source>
 +
 
=== build UI container ===
 
=== build UI container ===
 
<source lang="shell">
 
<source lang="shell">
第234行: 第236行:
 
* 1.6.6 version(robot)
 
* 1.6.6 version(robot)
 
https://10.74.54.185:30604/rpd-service-manager/swagger-ui.html#<br />
 
https://10.74.54.185:30604/rpd-service-manager/swagger-ui.html#<br />
== rpd container ==
 
=== debug ===
 
<source lang="shell">
 
# 查看日志
 
tail -f /var/log/robot/rpd-service-manager_stdout.log
 
 
# 拉debug image
 
docker pull "dockerhub.cisco.com/cabu-cmts-orch-docker/rpd-service-manager:debug"
 
 
# copy debug image
 
scp qingwyan@10.75.12.21:/home/qingwyan/workspace3/rpd-service-manager/spring/target/rpd-service-manager-0.1-SNAPSHOT.jar .
 
# run debug image
 
java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 rpd-service-manager-0.1-SNAPSHOT.jar
 
</source>
 
=== container里stop process ===
 
<source lang="shell">
 
supervisorctl start rpd-service-manager
 
supervisorctl stop rpd-service-manager
 
</source>
 
 
== nso ==
 
=== docker run ===
 
<source lang="shell" line start="1">
 
sudo docker run --publish 8083:8080 -itd dockerhub.cisco.com/robot-docker-v2/robot-cfgsvc
 
</source>
 
=== 常用命令 ===
 
<source lang="shell" line start="1">
 
# 进入CLI
 
bash-4.2# ncs_cli -u admin -C
 
 
</source>
 
==== traces ====
 
<source lang="shell" line start="1">
 
bash-4.2# ncs_cli -u admin
 
admin@ncs> configure
 
admin@ncs% set devices global-settings trace raw
 
# 保存位置
 
/var/log/robot/ncs-logs/xxx.trace
 
</source>
 
==== 手动添加一个device ====
 
<source lang="shell">
 
ncs_cli -u admin
 
configure
 
 
set devices authgroups group lab default-map
 
set devices authgroups group lab default-map remote-name admin
 
set devices authgroups group lab default-map remote-password lab
 
 
set devices device E09 address 20.6.6.2
 
set devices device E09 port 22
 
set devices device E09 authgroup lab
 
set devices device E09 device-type cli
 
set devices device E09 device-type cli ned-id cisco-ios
 
set devices device E09 state admin-state unlocked
 
 
commit
 
request devices device E09 sync-from
 
</source>
 
==== rollback 配置 ====
 
<source lang="shell">
 
cd ncs-run/
 
vi ncs.conf
 
<rollback>
 
    <enabled>true</enabled>
 
    <directory>/var/log/robot/ncs-logs</directory>
 
    <history-size>500</history-size>
 
  </rollback>
 
</source>
 
==== 重启NSO ====
 
<source lang="shell">
 
bash-4.2# pwd
 
/mnt/datafs/ncs-run
 
bash-4.2# cd ncs-run/
 
bash-4.2# ls
 
README.ncs  ncs-cdb  ncs.conf  ncs.conf.bak  packages  scripts state  target
 
bash-4.2# ncs --stop
 
bash-4.2# ncs
 
</source>
 
 
=== 读配置 ===
 
==== curl 命令读配置 ====
 
<source lang="shell">
 
# 读的是集合
 
curl -i -u admin:admin -H "Accept:application/vnd.yang.collection+json" -s http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:cable/virtual-service-group
 
 
# 读 RPD
 
curl -i -u admin:admin -H "Accept:application/vnd.yang.data+xml" -s http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:cable/rpd/node0955?deep
 
</source>
 
 
==== show 命令读配置 ====
 
<source lang="shell">
 
# 从NSO上读配置
 
admin@ncs# show running-config devices device f0bf1cdf-bee1-3525-817c-b593fcb8c8bb config ios:cable virtual-service-group
 
devices device f0bf1cdf-bee1-3525-817c-b593fcb8c8bb
 
config
 
  ios:cable virtual-service-group sg-6-0-3 downstream-cable 6/0/2 profile 68
 
  ios:cable virtual-service-group sg-7-0-2-d downstream-cable 7/0/2 profile 67
 
  ios:cable virtual-service-group sg-7-0-8 downstream-cable 7/0/8 profile 68
 
  ios:cable virtual-service-group test_sg downstream-cable 7/0/5 profile 67
 
  ios:cable virtual-service-group video-service-group downstream-cable 7/0/1 profile 68
 
!
 
!
 
</source>
 
 
=== debug手段 ===
 
==== Unknown SSH host key ====
 
<source lang="shell" line start="1" highlight="5">
 
admin@ncs# devices device f0bf1cdf-bee1-3525-817c-b593fcb8c8bb sync-from
 
result false
 
info Failed to authenticate towards device f0bf1cdf-bee1-3525-817c-b593fcb8c8bb: Unknown SSH host key
 
 
admin@ncs# devices device f0bf1cdf-bee1-3525-817c-b593fcb8c8bb ssh fetch-host-keys
 
result updated
 
fingerprint {
 
    algorithm ssh-rsa
 
    value 9e:7d:f8:c4:14:b9:87:4c:f0:a9:bf:36:41:65:80:ab
 
}
 
 
</source>
 
 
==== 状态为disable ====
 
<source lang="shell" line start="1" highlight="5">
 
admin@ncs# show devices device state
 
devices device 2c678746-c18d-3f32-8bcc-74a64c76da91
 
state oper-state    disabled
 
state oper-state-error-tag noconnection
 
# 查看错误原因
 
admin@ncs# devices device 2c678746-c18d-3f32-8bcc-74a64c76da91 sync-from
 
result false
 
info Failed to authenticate towards device 2c678746-c18d-3f32-8bcc-74a64c76da91: Bad password for local/remote user admin/admin Auth failed
 
</source>
 
==== no space left on device ====
 
<source lang="shell" >
 
# robot 里
 
cd /mnt/robot_logfs/robot-cfgsvc/1/ncs-logs
 
 
rm -rf rollback*
 
</source>
 
 
=== NED team support ===
 
==== add cmd 开case ====
 
https://techzone.cisco.com/t5/Network-Services-Orchestrator/How-to-Open-a-TAC-NSO-NED-Case/ta-p/955288
 
 
==== download ====
 
* ncs
 
https://earth.tail-f.com:8443/ncs-pkgs/cisco-ios/4.5.5/
 
* nso
 
https://earth.tail-f.com:8443/ncs/<br />
 
https://software.cisco.com/download/special/release.html?config=ec46b94d82ecbe84593bbc5a96c4c04b
 
 
=== build NSO docker ===
 
<source lang="shell">
 
# sign 文件到 tar
 
sh ncs-4.5.5-cisco-ios-6.0.2.signed.bin
 
 
# upload to engci
 
curl --noproxy cisco.com -i -X PUT -u robot-dev-deployer:qqyiwhc7ts6um8sw -v --retry 999 --retry-max-time 0 -T ncs-4.5.5-cisco-ios-6.0.2.tar.gz "http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.5.5/ncs-4.5.5-cisco-ios-6.0.2.tar.gz"
 
 
curl --noproxy cisco.com -i -X PUT -u robot-dev-deployer:qqyiwhc7ts6um8sw -v --retry 999 --retry-max-time 0 -T ncs-4.5.5-cisco-iosxr-6.5.tar.gz "http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.5.5/ncs-4.5.5-cisco-iosxr-6.5.tar.gz"
 
 
curl --noproxy cisco.com -i -X PUT -u robot-dev-deployer:qqyiwhc7ts6um8sw -v --retry 999 --retry-max-time 0 -T nso-4.5.5.darwin.x86_64.installer.bin "http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.5.5/nso-4.5.5.darwin.x86_64.installer.bin"
 
 
curl --noproxy cisco.com -i -X PUT -u robot-dev-deployer:qqyiwhc7ts6um8sw -v --retry 999 --retry-max-time 0 -T nso-4.5.5.linux.x86_64.installer.bin "http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.5.5/nso-4.5.5.linux.x86_64.installer.bin"
 
 
# delete
 
curl --noproxy cisco.com -X DELETE -u robot-dev-deployer:qqyiwhc7ts6um8sw "http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.4.5/nso-4.4.5.darwin.x86_64.installer.bin"
 
 
# :downloadNso
 
Download http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.4.2/nso-4.4.2.linux.x86_64.installer.bin
 
 
# change version
 
https://bitbucket-eng-sjc1.cisco.com/bitbucket/projects/CMTSORCH/repos/robot-cfgsvc/browse/src/packages/dlm/gradle.properties
 
 
nsoInstallerVersion=4.5.5
 
nsoVersion=4.5.5
 
iosNedVersion=6.0.2
 
</source>
 
* jenkins build nso docker
 
https://engci-jenkins-sjc.cisco.com/jenkins/job/team_CABU-CMTS-ORCH/job/Nightly_build_Pipeline/job/Nightly-Build-robot-cfgsvc/
 
 
== cassandra==
 
=== 在liunx上run ===
 
<source lang="shell">
 
docker run --publish 9042:9042 --publish 9160:9160 -d --name cassandra --net robot_network -e CASSANDRA_START_RPC=true -it cassandra:3.10
 
</source>
 
=== sql ===
 
<source lang="sql">
 
SELECT * FROM "RPD" WHERE name='vsrpd710.9' ALLOW FILTERING;
 
</source>
 
 
 
== dhcp ==
 
== dhcp ==
 
=== ipv6 ===
 
=== ipv6 ===
第486行: 第298行:
 
source /auto/pysw/ats64/env.sh
 
source /auto/pysw/ats64/env.sh
 
source ~/proxy.sh
 
source ~/proxy.sh
 +
</source>
 +
=== 运行vsg script ===
 +
<source lang="shell">
 +
easypy /home/build/qingwyan/tests/pyats/video_e2e_test/vsg_job.py -testbed_file "/auto/sjc-ccebuild-ar5/pyats-gate/smartphy/jenkins/release/testbed_files/cicd_l3_tb.yaml" -datafile "/home/build/pyats/smartphy/jenkins/release/data_files/v2.0.0/vsg_data.yaml"
 
</source>
 
</source>
  
第539行: 第355行:
 
SNMPv2-SMI::enterprises.9.2.1.58.0 = INTEGER: 14
 
SNMPv2-SMI::enterprises.9.2.1.58.0 = INTEGER: 14
 
</source>
 
</source>
 +
== tyk ==
 +
=== 证书过期 ===
 +
http://cmtswiki.cisco.com:8080/display/cmtsdpub/Replace+TYK+Key+on+Crosswork+based+SmartPHY+VM
 
[[category: cisco]]
 
[[category: cisco]]

2018年9月19日 (三) 03:04的最新版本

Android

发布release版本的apk

a.  Get the latest code from the git repository (android-app.git)
b.  Install Android Studio (If you have not already done so)
c.  Open the project in Android Studio.
d.  Try a debug build before the official release to make sure code compiles & run it either on emulator/actual phone.
e.  Go to build.grade file to edit version/build number (/Users/vidhsubr/IdeaProjects/android_app/android-app/app/build.gradle)
f.  Now to make an official release, please click on build drop down menu, choose option "Generate Signed APK"
g.  A pop up window appears; you'd need to fill in the below details
h.  choose app module in the pop up and hit "next"
i.  Keystore path will be "<project-path>/android-app/android.jks"; For ex : /Users/vidhsubr/IdeaProjects/android-app/android.jks
j.  Key store password: cisco123
k.  Key alias: myandroidkey
l.  Key password: cisco123; hit next
m.  choose apk destination folder; For ex /Users/vidhsubr/IdeaProjects/android_app/android-app/app
n.  Build type is "release"
o.  signature versions are v1 & v2
p.  hit finish
q.  If everything compiles well & there are no errors then "app-release.apk" file will be found in the previously specified location.

CBR 配置

真RPD ipv6 online

CRDC-NG-E09#sh run int tenGigabitEthernet 4/1/7
Load for five secs: 4%/1%; one minute: 6%; five minutes: 6%
Time source is NTP, 20:59:25.271 PST Mon Mar 5 2018

Building configuration...

Current configuration : 170 bytes
!
interface TenGigabitEthernet4/1/7
 ip address 60.10.10.5 255.255.255.0
 ipv6 address 2001:60:10:10::5/64
 ipv6 enable
 ipv6 dhcp relay destination 2001:20:1:1::33  ### 删掉这一行 不能IPV6上线,切换到IPV4上线
end

# 前提是RPD的DS要选DS controller,这个DS配置了IPV6地址, 如下7/1/0
CRDC-NG-E09#sh run int tenGigabitEthernet 7/1/0 
Load for five secs: 4%/1%; one minute: 8%; five minutes: 7%
Time source is NTP, 20:58:47.282 PST Mon Mar 5 2018

Building configuration...

Current configuration : 223 bytes
!
interface TenGigabitEthernet7/1/0
 vrf forwarding lcha-710
 ip address 60.10.10.1 255.255.255.0
 ip helper-address global 20.1.0.33
 cdp enable
 ipv6 address 2001:60:10:10::1/64
 ipv6 enable
 ipv6 nd ra suppress all
end

video

profile

CRDC-NG-E09#sh run | s profile 67
cable downstream controller-profile 67
 rf-chan 32
  type VIDEO ASYNC
  qam-profile 1
  rf-output NORMAL

support virtual splitting

cable downstream controller-profile 68
 multicast-pool 62   # !!!
 rf-chan 64
  type VIDEO ASYNC
  qam-profile 1
  rf-output NORMAL
cable virtual-service-group sg-6-0-3 downstream-cable 6/0/2 profile 68
cable virtual-service-group video-service-group downstream-cable 7/0/1 profile 68

# pool 配置
CRDC-NG-E09#sh run | s multi
cable depi multicast pool 62
 ip address 239.1.1.0 255.255.255.0
cable depi multicast pool 66
 ipv6 address FF3A::8000:0/120
cable depi multicast pool 127
 ip address 227.226.225.0 255.255.255.0

LCHA switch over

CRDC-NG-E09#redundancy linecard-group switchover from slot 6

看到online信息

CRDC-NG-E09#sh run | s logging
logging host 10.74.54.188 transport tcp port 8514

OOB

http://cmtswiki.cisco.com:8080/display/cmtsdpub/Sereno+OOB+Configuration

# 预先配置
cable oob
  virtual-om 1
    ip 11.22.33.44 255.255.255.0
    join-group 239.125.99.99 source-ip 10.8.120.5 out-group 225.1.99.99
  virtual-arpd 1
    ip 10.0.200.161 255.255.255.255
    nc 10.8.120.175 udp-port 58002
    source-id 1

# RPD 下
cable rpd node5
 identifier badb.ad13.4134
 no sbfd enable
 core-interface Te7/1/0
  principal
  rpd-ds 0 downstream-cable 7/0/0 profile 3
  rpd-ds 0 downstream-oob-vom 1 profile 1  <--- reference to vom and profile as input from ST
  rpd-us 0 upstream-cable 7/0/0 profile 3
  rpd-us 0 upstream-oob-varpd 1 profile 1   <--- reference to varpd and profile as input from ST
 r-dti 4
 rpd-event profile 0

UI

启动

干 -- BASE_URL=10.74.54.185 BASE_PORT=9000 HOST=10.74.54.185 npm start
HOST=10.79.196.189 npm start

# 如何kill
ps -ef | grep webpack
qingwyan  9392  9376 15 22:40 pts/21   00:00:48 node /home/qingwyan/workspace/robot-ui/node_modules/.bin/webpack-dev-server --inline --progress

build UI container

# 先到robot-ui目录下
git submodule init
git submodule update --remote

/bin/npm install
/bin/npm run build

MJ=1
D=`date +%y%m%d`
B=0
N=`git rev-parse --short HEAD`
TAG=$MJ.$B.$N.$D

sudo docker build -t dockerhub.cisco.com/robot-dockerprod/robot-ui:developv$TAG .

替换robot里的UI

# build UI container 后,build好的Image可以通过docker images看到
[qingwyan@crdc-sdn-ucs1 robot-ui]$ sudo docker images 
REPOSITORY                                                      TAG                          IMAGE ID            CREATED             SIZE
dockerhub.cisco.com/robot-dockerprod/robot-ui                   developv1.0.46a5914.180117   563a2bb56717        54 minutes ago      869.2 MB

# 保存tar到本地
docker save -o ui.tar 563a2bb56717
 
# 将tar cp到robot 里
# 之后导入本地镜像到robot里
sudo docker load --input ui.tar

# 命名刚刚导入的image
docker tag 563a2bb56717 localbuild/ui

# 之后的操作跟rpd 设置Debug 模式一样

iptable

container里ping不通外面

sudo iptables -t nat -A POSTROUTING -s  192.168.125.0/24 -o ens192 -j MASQUERADE

常用命令

# 删一条iptable
sudo iptables -t nat -D PREROUTING 1
# 删所有iptable
iptables -F -t nat
# 查看iptable
iptables -t nat -L --line-number | more

GCP container

快速进入docker的脚本

KEY=k8s_gcp  # gcp 换成 rpd

container_id=$(docker ps | grep $KEY | awk {'print $1'})
docker exec -it ${container_id} bash

# 一句话
docker exec -it $(docker ps | grep k8s_gcp | awk {'print $1'}) bash

debug

docker pull "dockerhub.cisco.com/cabu-cmts-orch-docker/gcp-service:debug"
# 查看log
tail -f /var/log/robot/gcp-service_stdout.log

设置debug模式

kubectl get pods --all-namespaces
kubectl exec --namespace=kube-system -it <robot-orch-container> bash
# 进入orch container 后, 修改orchmanifest.json

robotctl spec   - generates the new yaml file for the containers
robotctl update – my guess updates pod.conf
robotctl stop – stop existing default namespace containers, sometimes I needed to wait for few seconds till they stopped
kubectl get pods --all-namespaces         --- check that all default namespace containers stopped
robotctl start – start all containers
kubectl get pods --all-namespaces         --- verify all containers RUNNING
# copy image
scp qingwyan@10.75.12.21:/home/qingwyan/workspace3/gcp-service/spring/target/gcp-service-0.1-SNAPSHOT.jar .
# 启动
java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5006 gcp-service-0.1-SNAPSHOT.jar

一条命令kill java进程

ps -ef | grep java | grep -v grep | awk {'print $2'} | xargs kill -9
# grep -v grep 过滤掉auto出现的进程号

swagger ui

  • 1.6.6 version(robot)

https://10.74.54.185:30604/rpd-service-manager/swagger-ui.html#

dhcp

ipv6

启动ipv6 server

sudo /usr/local/sbin/dhcpd -6 -d -cf /etc/dhcp/dhcpd6.conf sdn-br

k8s

常用命令

# 删除一个pod
kubectl delete deployment rpd-service-manager

# apply 一个yaml
kubectl apply -f rpd-service-manager.yaml

# 查看所有运行的pods
kubectl get pods --all-namespaces

robot下单独换cobtainer

kubectl delete service robot-ui
kubectl delete deployment robot-ui

kubectl apply -f robot-ui_service.yaml
kubectl apply -f robot-ui.yaml

从k8s_robot-orch下cp yaml文件

KEY=k8s_robot-orch

container_id=$(docker ps | grep $KEY | awk {'print $1'})
docker cp ${container_id}:/root/rpd-service-manager.yaml .

docker

doker ps 不需要用sudo

# Cannot connect to the Docker daemon. Is the docker daemon running on this host?
sudo groupadd docker
sudo usermod -aG docker $(whoami)
# restart VM才生效?

设置docker代理

cat /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://64.103.36.133:8080" "HTTPS_PROXY=http://64.103.36.133:8080" "NO_PROXY=localhost,.cisco.com, sdntools.cisco.com,10.124.8.66"
[jifu@crdc-sdn-ucs1 robot-ui]$ 

then

systemctl daemon-reload
service docker restart

test

pyats运行环境

source /auto/sjc-ccebuild-ar5/pyats-gate/env.sh 
source /auto/pysw/ats64/env.sh
source ~/proxy.sh

运行vsg script

easypy /home/build/qingwyan/tests/pyats/video_e2e_test/vsg_job.py -testbed_file "/auto/sjc-ccebuild-ar5/pyats-gate/smartphy/jenkins/release/testbed_files/cicd_l3_tb.yaml" -datafile "/home/build/pyats/smartphy/jenkins/release/data_files/v2.0.0/vsg_data.yaml"

cnr8

设置CCAP core

Design > DHCP Settings > Policies
# 搜索 2001:60
# 进入 Edit DHCP Policy 2001:60:10:10-E09
# 修改 Configured Options, 替换 ccap-cores 后的 2001:10:74:54::186
(enterprise-id 4491((tftp-servers 32 2001:20:1:1::33)(ccap-cores 61 2001:20:6:1::2)(rfc868-servers 37 2001:20:1:1::33)(syslog-servers 34 2001:20:1:1::33)(time-offset 38 8h)(cablelabs-client-configuration 2170 )))
#!!! 修改好后save, return回上级页面也要save!!!

restart dhcp

Deploy > DHCP > DHCP Server

kvm

restart guest server

virsh shutdown sp1210

virsh start sp1210

# 强制shutdown
virsh destroy sp1210

snmp

cBR8 配置

CRDC-NG-E09#sh run | s snmp
snmp-server community private RW    # 对应UI SNMPv2 Write Community
snmp-server community okcard RO     # 对应UI SNMPv2 Read Community
snmp-server community public RO      # 对应UI SNMPv2 Read Community
snmp-server trap-source TenGigabitEthernet7/1/1
snmp-server enable traps snmp linkdown linkup
snmp-server enable traps entity-red
snmp-server host 10.74.54.150 version 2c okcard 
snmp-server host 10.75.12.21 version 2c okcard 
snmp-server manager

install snmp centos

# 安装客户端
yum install net-snmp-utils

robot里检查cBR8 snmp

# UI 上CBR8状态是unreachable, 检查snmp是不是work, 正常情况如下
[root@robot-vm-dev ~]# snmpwalk -v2c -c public 20.6.6.2 .1.3.6.1.4.1.9.2.1.58 
SNMPv2-SMI::enterprises.9.2.1.58.0 = INTEGER: 14

tyk

证书过期

http://cmtswiki.cisco.com:8080/display/cmtsdpub/Replace+TYK+Key+on+Crosswork+based+SmartPHY+VM