|
| 1 | +--- |
| 2 | +published: false |
| 3 | +date: '2016-06-30 20:40 +0800' |
| 4 | +title: Copying Telemetry Policy Files in Vagrant IOS XRv 6.1.1 |
| 5 | +author: Richard Wade |
| 6 | +excerpt: >- |
| 7 | + How to copy IOS XR policy files from the host Linux filesystem to the IOS XRv |
| 8 | + image running in a Vagrant box. |
| 9 | +tags: |
| 10 | + - vagrant |
| 11 | + - iosxr |
| 12 | + - linux |
| 13 | + - Telemetry |
| 14 | +--- |
| 15 | +This tutorial describes how to copy IOS XR policy files from your host filesystem to the IOS XR filesystem, where the target is IOS XRv running as a Vagrant box. Firstly, we should check which ports we should use for interaction with the IOS XRv Vagrant box. We do this using vagrant in the host operating system. |
| 16 | + |
| 17 | +<div class="highlighter-rouge"> |
| 18 | +<pre class="highlight"> |
| 19 | +<code> |
| 20 | +user@host:~/vagrant/iosxrv> <mark>vagrant port</mark> |
| 21 | +The forwarded ports for the machine are listed below. Please note that these values may differ from values configured in the Vagrantfile if the provider supports automatic port collision detection and resolution. |
| 22 | + |
| 23 | + 22 (guest) => 2223 (host) |
| 24 | + 57722 (guest) => 2222 (host) |
| 25 | +</code> |
| 26 | +</pre> |
| 27 | +</div> |
| 28 | + |
| 29 | +We can see that port 22 of the IOS XRv instance has been mapped to host port 2223. However, we need to interact with the IOS XR Linux operating system, which has SSH listening on port 57722. Vagrant has mapped port 57722 to port 2222 of the host operating system. We therefore need to copy our policy file to port 2222 as follows: |
| 30 | + |
| 31 | +<div class="highlighter-rouge"> |
| 32 | +<pre class="highlight"> |
| 33 | +<code> |
| 34 | +user@host:~/vagrant/iosxrv⟫ ls -l Test.policy |
| 35 | +-rw-rw-r-- 1 user group 412 Jun 29 18:22 Test.policy |
| 36 | +user@host:~/vagrant/iosxrv⟫ <mark>scp -P 2222 Test.policy vagrant@localhost:/misc/app_host/scratch/</mark> |
| 37 | +vagrant@localhost's password: |
| 38 | +Test.policy 100% 412 0.4KB/s 00:00 |
| 39 | +</code> |
| 40 | +</pre> |
| 41 | +</div> |
| 42 | + |
| 43 | +Due to filesystem security policy in IOS XR, incoming files must be copied to a directory which is writable by the vagrant user. /misc/app_host/scratch is suitable for this and is writable by the vagrant user. In order to install the policy file in IOS XR's running configuration, we must copy it to the telemetry policy directory at /telemetry/policies/: |
| 44 | + |
| 45 | +<div class="highlighter-rouge"> |
| 46 | +<pre class="highlight"> |
| 47 | +<code> |
| 48 | +user@host:~/vagrant/iosxrv> <mark>ssh -p 2223 vagrant@localhost</mark> |
| 49 | +vagrant@localhost's password: |
| 50 | + |
| 51 | +RP/0/RP0/CPU0:ios#run |
| 52 | +Wed Jun 29 08:37:35.302 UTC |
| 53 | +[xr-vm_node0_RP0_CPU0:~]$<mark>cd /misc/app_host/scratch/</mark> |
| 54 | +[xr-vm_node0_RP0_CPU0:/misc/app_host/scratch]$ls -l |
| 55 | +total 4 |
| 56 | +-rw-r--r-- 1 vagrant vagrant 412 Jun 29 08:23 Test.policy |
| 57 | +[xr-vm_node0_RP0_CPU0:/misc/app_host/scratch]$<mark>cp Test.policy /telemetry/policies/</mark> |
| 58 | +[xr-vm_node0_RP0_CPU0:/misc/app_host/scratch]$ls -l /telemetry/policies/ |
| 59 | +total 4 |
| 60 | +-rwxr-xr-x 1 root root 412 Jun 29 08:37 Test.policy |
| 61 | +[xr-vm_node0_RP0_CPU0:/misc/app_host/scratch]$ |
| 62 | +</code> |
| 63 | +</pre> |
| 64 | +</div> |
| 65 | + |
| 66 | +Now, if we return to the IOS XR command line interface and show the configured telemetry policies, we see that the uploaded policy has been installed: |
| 67 | + |
| 68 | +<div class="highlighter-rouge"> |
| 69 | +<pre class="highlight"> |
| 70 | +<code> |
| 71 | +RP/0/RP0/CPU0:ios#<mark>show telemetry policies</mark> |
| 72 | +Wed Jun 29 08:44:37.055 UTC |
| 73 | + |
| 74 | +cpu |
| 75 | + Filename: None |
| 76 | + Status: Inactive |
| 77 | + |
| 78 | +memory |
| 79 | + Filename: None |
| 80 | + Status: Inactive |
| 81 | + |
| 82 | +robot |
| 83 | + Filename: None |
| 84 | + Status: Inactive |
| 85 | + |
| 86 | +Test |
| 87 | + Filename: Test.policy |
| 88 | + Version: 25 |
| 89 | + Description: This is a sample policy |
| 90 | + Status: Inactive |
| 91 | + CollectionGroup: FirstGroup |
| 92 | + Cadence: 30.0s |
| 93 | + Total collections: 0 |
| 94 | + Latest collection: Never |
| 95 | + Min total time: 0.000s |
| 96 | + Max total time: 0.000s |
| 97 | + Avg total time: 0.000s |
| 98 | + Collection errors: 0 |
| 99 | + Missed collections: 0 |
| 100 | + +----------------------------------------------+---------+---------+------+ |
| 101 | + | Path | Avg (s) | Max (s) | Err | |
| 102 | + +----------------------------------------------+---------+---------+------+ |
| 103 | + | RootOper.InfraStatistics.Interface(*).Latest | 0.000 | 0.000 | 0 | |
| 104 | + +----------------------------------------------+---------+---------+------+ |
| 105 | + |
| 106 | + |
| 107 | +RP/0/RP0/CPU0:ios# |
| 108 | +</code> |
| 109 | +</pre> |
| 110 | +</div> |
0 commit comments