查看“CABUORCH-1697”的源代码
←
CABUORCH-1697
跳转至:
导航
,
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{HeaderOfTask | content=Investigation: CLI to XML Conversion for NSO | wiki=http://cmtswiki.cisco.com:8080/display/cmtsdpub/DSG+and+Load+Balancing+Requirements+and+High+Level+Design | wiki2=http://cmtswiki.cisco.com:8080/display/cmtsdpub/LB+and+DSG+with+OPS }} == 描述 == Investigation: CLI to XML Conversion for NSO === wiki === http://cmtswiki.cisco.com:8080/display/cmtsdpub/DSG+and+Load+Balancing+Requirements+and+High+Level+Design<br /> http://cmtswiki.cisco.com:8080/display/cmtsdpub/LB+and+DSG+with+OPS == ntool == === git === https://github.com/NSO-developer/ntool === 在NSO docker安装ntool === <source lang="shell"> # 修改 repo # editing both /etc/yum.repos.d/epel.repo and /etc/yum.repos.d/epel-testing.repo files, commenting all entries starting with mirrorlist=... and uncommenting all the entries starting with baseurl=.... # 配置代理 bash-4.2# export http_proxy=http://proxy-wsa.esl.cisco.com:80 bash-4.2# export https_proxy=http://proxy-wsa.esl.cisco.com:80 bash-4.2# env | grep proxy http_proxy=http://proxy-wsa.esl.cisco.com:80 https_proxy=http://proxy-wsa.esl.cisco.com:80 # 安装 make yum install make # 安装 ant yum install ant # JAVA_HOME指向错误,不是正确的jdk位置,要重新export # export JAVA_HOME bash-4.2# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64 # 安装ntool, 将ntool 拷贝到下面目录 cd /mnt/datafs/ncs-run/packages make -C ntool/src clean all #重启NSO !!! cd /mnt/datafs/ncs-run ncs --stop ncs </source> === 问题 === <source lang="shell"> /usr/bin/ant: Failed to set JAVACMD Error: JAVA_HOME is not defined correctly. We cannot execute /usr/bin/java/bin/java make: *** [javac] Error 1 make: Leaving directory `/mnt/datafs/ncs-run/packages/ntool/src' # JAVA_HOME配置错误 # 找到Jdk 位置,修改JAVA_HOME bash-4.2# find /usr/ -name *jdk* -type d /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.x86_64 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64 /usr/lib/jvm-exports/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64 #用这个jdk # export JAVA_HOME bash-4.2# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64 </source> == ntool 使用 == === 验证 === <source lang="shell"> admin@ncs> ntool verify type cisco-ios file /mnt/datafs/ncs-run/cable-rpd.text Verifying [cisco-ios] command(s) sequence.... cable rpd 225400000002 identifier 2254.0000.0002 core-interface Te7/1/0 principal rpd-ds 0 downstream-cable 7/0/4 profile 1 rpd-us 0 upstream-cable 7/0/4 profile 1 r-dti 1 rpd-event profile 0 Verification completed [ok][2018-05-28 00:51:07] </source> === 转化 === rpd config <source lang="shell"> bash-4.2# cat cable-rpd.text cable rpd 225400000002 identifier 2254.0000.0002 core-interface Te7/1/0 principal rpd-ds 0 downstream-cable 7/0/4 profile 1 rpd-us 0 upstream-cable 7/0/4 profile 1 r-dti 1 rpd-event profile 0 </source> <source lang="shell"> admin@ncs> ntool template type ios template-type config file /mnt/datafs/ncs-run/cable-rpd.text Creating template [ios] .... Reading input command file /mnt/datafs/ncs-run/cable-rpd.text Executing template create action.... <config-template xmlns="http://tail-f.com/ns/config/1.0"> <devices xmlns="http://tail-f.com/ns/ncs"> <device> <name>{$DEVICE}</name> <config> <cable xmlns="urn:ios"> <rpd> <name>225400000002</name> <identifier>2254.0000.0002</identifier> <core-interface> <Te> <name>7/1/0</name> <principal/> <rpd-ds> <port>0</port> <name>downstream-cable</name> <id>7/0/4</id> <profile>1</profile> </rpd-ds> <rpd-us> <port>0</port> <name>upstream-cable</name> <id>7/0/4</id> <profile>1</profile> </rpd-us> </Te> </core-interface> <r-dti>1</r-dti> <rpd-event> <profile>0</profile> </rpd-event> </rpd> </cable> </config> </device> </devices> </config-template> Template create completed [ok][2018-05-28 00:51:49] </source> == NSO 验证 == === 上传image到仓库 === <source lang="shell"> curl --noproxy cisco.com -i -X PUT -u robot-dev-deployer:qqyiwhc7ts6um8sw -v --retry 999 --retry-max-time 0 -T ncs-4.5.6-cisco-ios-6.0.6.tar.gz "http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.5.6/ncs-4.5.6-cisco-ios-6.0.6.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.6-cisco-iosxr-7.0.6.tar.gz "http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.5.6/ncs-4.5.6-cisco-iosxr-7.0.6.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.6.linux.x86_64.installer.bin "http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.5.6/nso-4.5.6.linux.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.6.darwin.x86_64.installer.bin "http://engci-maven-master.cisco.com/artifactory/robot-dev-thirdparty/com.cisco/cfgsvc/nso-4.5.6/nso-4.5.6.darwin.x86_64.installer.bin" </source> === IOS cli === <source lang="shell"> cable load-balance docsis-group 10011 downstream Downstream-Cable 7/0/1 rf-channel 0-3 8-11 upstream Upstream-Cable 7/0/2 us-channel 0-3 method utilization us-method modems threshold load 30 threshold stability 70 policy pure-ds-load init-tech-list 4 cable load-balance docsis-group 10012 restricted downstream Downstream-Cable 7/0/1 rf-channel 0-3 8-11 18-21 26-29 upstream Upstream-Cable 7/0/2 us-channel 4 init-tech-list 4 interval 5 cable load-balance docsis-group 10013 restricted downstream Downstream-Cable 7/0/1 rf-channel 0-31 upstream Upstream-Cable 7/0/2 us-channel 1-4 threshold load minimum 1 init-tech-list 4 interval 5 </source> === NSO cmd === <source lang="shell"> admin@ncs# show running-config devices device f0bf1cdf-bee1-3525-817c-b593fcb8c8bb config ios:cable load-balance docsis-group devices device f0bf1cdf-bee1-3525-817c-b593fcb8c8bb config ios:cable load-balance docsis-group 10011 downstream Downstream-Cable 7/0/1 rf-channel 0-3 8-11 upstream Upstream-Cable 7/0/2 us-channel 0-3 method utilization us-method modems threshold load 30 threshold stability 70 policy pure-ds-load init-tech-list 4 ! ios:cable load-balance docsis-group 10012 restricted downstream Downstream-Cable 7/0/1 rf-channel 0-3 8-11 18-21 26-29 upstream Upstream-Cable 7/0/2 us-channel 4 interval 5 init-tech-list 4 ! ios:cable load-balance docsis-group 10013 restricted downstream Downstream-Cable 7/0/1 rf-channel 0-31 upstream Upstream-Cable 7/0/2 us-channel 1-4 threshold load minimum 1 interval 5 init-tech-list 4 ! ! ! </source> === 转化后的XML === <source lang="xml"> <config-template xmlns="http://tail-f.com/ns/config/1.0"> <devices xmlns="http://tail-f.com/ns/ncs"> <device> <name>{$DEVICE}</name> <config> <cable xmlns="urn:ios"> <load-balance> <docsis-group> <docsis-group-list> <docsis-group-id>10011</docsis-group-id> <downstream> <Downstream-Cable> <name>7/0/1</name> <rf-channel>0-3 8-11</rf-channel> </Downstream-Cable> </downstream> <upstream> <Upstream-Cable> <name>7/0/2</name> <us-channel>0-3</us-channel> </Upstream-Cable> </upstream> <method> <type>utilization</type> <us-method>modems</us-method> </method> <threshold> <load> <percentage>30</percentage> </load> <stability>70</stability> </threshold> <policy>pure-ds-load</policy> <init-tech-list> <grouplist>4</grouplist> </init-tech-list> </docsis-group-list> <docsis-group-list> <docsis-group-id>10012</docsis-group-id> <restricted/> <downstream> <Downstream-Cable> <name>7/0/1</name> <rf-channel>0-3 8-11 18-21 26-29</rf-channel> </Downstream-Cable> </downstream> <upstream> <Upstream-Cable> <name>7/0/2</name> <us-channel>4</us-channel> </Upstream-Cable> </upstream> <interval>5</interval> <init-tech-list> <grouplist>4</grouplist> </init-tech-list> </docsis-group-list> <docsis-group-list> <docsis-group-id>10013</docsis-group-id> <restricted/> <downstream> <Downstream-Cable> <name>7/0/1</name> <rf-channel>0-31</rf-channel> </Downstream-Cable> </downstream> <upstream> <Upstream-Cable> <name>7/0/2</name> <us-channel>1-4</us-channel> </Upstream-Cable> </upstream> <threshold> <load> <minimum>1</minimum> </load> </threshold> <interval>5</interval> <init-tech-list> <grouplist>4</grouplist> </init-tech-list> </docsis-group-list> </docsis-group> </load-balance> </cable> </config> </device> </devices> </config-template> </source> [[category: cisco]] [[category: task]]
该页面使用的模板:
Template:DivNote
(
查看源代码
)
Template:HeaderOfTask
(
查看源代码
)
返回至
CABUORCH-1697
。
导航菜单
个人工具
创建账户
登录
命名空间
页面
讨论
不转换
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
台灣正體
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息