Skip to main content

How to copy file from sysadmin or HOST to xr-vm in IOX 64bit system

·457 words·3 mins
Rs
Rory
Author
Rory
Step by step the ladder is ascended

alt text

This article will introduction how to copy file beteew sysadmin-vm/xr-vm/host at IOS XR 64bit system.

First of all, we need to know how to access these 3 modules.

XR-VM
#

Login one device by using telnet, you can use command “dir” to check what file are stored in this media.

User Access Verification

Username: xuxing
Password:


RP/0/RSP0/CPU0:9904-E_eXR#
RP/0/RSP0/CPU0:9904-E_eXR#
RP/0/RSP0/CPU0:9904-E_eXR#dir harddisk:

You can use below two method to access XR-vm linux kernel, and you will see the same file stored at /harddisk:/.

Option 1:
RP/0/RSP0/CPU0:9904-E_eXR#
RP/0/RSP0/CPU0:9904-E_eXR#run
Mon Jul  1 03:54:17.751 CDT
[xr-vm_node0_RSP0_CPU0:~]$
[xr-vm_node0_RSP0_CPU0:~]$

Option 2:
RP/0/RSP0/CPU0:9904-E_eXR#admin
Mon Jul  1 03:53:42.111 CDT

xuxing connected from 127.0.0.1 using console on 9904-E_eXR
sysadmin-vm:0_RSP0# show VM
Mon Jul  1  08:53:45.847 UTC
Location: 0/RSP0
Id                Status        IP Address       HB Sent/Recv
-------------------------------------------------------------
sysadmin          running       192.0.4.1        NA/NA
default-sdr       running       192.0.4.4        470117/470117     <<<<<< This ip address
sysadmin-vm:0_RSP0# run
Mon Jul  1  08:53:58.970 UTC
[sysadmin-vm:0_RSP0:~]$ssh 192.0.4.4
[xr-vm_node0_RSP0_CPU0:~]$
[xr-vm_node0_RSP0_CPU0:~]$dir /harddisk:

Sysadmin-VM
#

You can use below method access sysadmin-vm,and admin vm linux kernel.

RP/0/RSP0/CPU0:9904-E_eXR#admin
Mon Jul  1 04:00:21.764 CDT

xuxing connected from 127.0.0.1 using console on 9904-E_eXR
sysadmin-vm:0_RSP0#
sysadmin-vm:0_RSP0# show VM
Mon Jul  1  09:01:15.235 UTC

Location: 0/0
Id                Status        IP Address       HB Sent/Recv
-------------------------------------------------------------
sysadmin          running       192.0.0.1        NA/NA       <<<<<
default-sdr       running       192.0.0.3        23534/23534

Location: 0/RSP0
Id                Status        IP Address       HB Sent/Recv
-------------------------------------------------------------
sysadmin          running       192.0.4.1        NA/NA
default-sdr       running       192.0.4.4        471015/471015
sysadmin-vm:0_RSP0#
[sysadmin-vm:0_RSP0:~]$ssh 192.0.0.1    <<< ssh LC sysadmin ip address, you can access lc sysadmin-vm linux kernel.

Host
#

sysadmin-vm:0_RSP0# run
Mon Jul  1  09:03:36.526 UTC

[sysadmin-vm:0_RSP0:~]$
[sysadmin-vm:0_RSP0:~]$chvrf 0 ssh my_host
[host:~]$
[host:~]$

Special for NCS55 (fretta), use below method to login host VM:

[sysadmin-vm:0_RP0:~]$
[sysadmin-vm:0_RP0:~]$ssh 10.0.2.16
[host:0_RP0:~]$
[host:0_RP0:~]$

to LC host vm , you can also use ip 10.0.2.16, like below from 0/RP0 sysadmin vm to LC0/1 sysadmin vm then to LC1 host vm.


[sysadmin-vm:0_RP0:~]$
[sysadmin-vm:0_RP0:~]$ssh 192.0.8.1
Warning: Permanently added '192.0.8.1' (ECDSA) to the list of known hosts.
[sysadmin-vm:0_1:~]$
[sysadmin-vm:0_1:~]$ ssh 10.0.2.16
[host:0_LC1:~]$
[host:0_LC1:~]$

Copy file from sysadmin or host to xr-vm
#

We can see xr-vm and xr-vm linux kernel will use same file system, so if we can copy file to xr-vm linux kernel, then we can find it at xr-vm.

RP/0/RSP0/CPU0:9904-E_eXR#admin
sysadmin-vm:0_RSP0#
[sysadmin-vm:0_RSP0:~]$chvrf 0 ssh my_host
[host:~]$
[host:~]$ cd /var/
[host:/var]$ cd log/
[host:/var/log]$ tar zcvf test.tar *   <<<<< tar all file and named test.tar
[host:/var/log]$ ls -l test.tar
-rw-r--r-- 1 root root 28656788 Jul  1 08:23 test.tar
[host:/var/log]$
[sysadmin-vm:0_RSP0:~]$sftp my_host
sftp> cd /var/log
sftp> get test.tar
Fetching /var/log/test.tar to test.tar

/var/log/test.tar                                                                                  0%    0     0.0KB/s   --:-- ETA
/var/log/test.tar                                                                                100%   27MB  27.3MB/s   00:00
sftp>
sftp>
sftp> exit
sftp> exit
[sysadmin-vm:0_RSP0:~]$ls
asr9k_idprom_dump  default-sdr--1.20190626-204550.core.host.0_0.kdump  lost+found  test.tar  tmp_staging
cisco_support      dumper                                              showtech    tftpboot

Or use below method:

RP/0/RSP0/CPU0:9904-E_eXR#admin
Mon Jul  1 04:21:27.469 CDT

xuxing connected from 127.0.0.1 using console on 9904-E_eXR
sysadmin-vm:0_RSP0# copy harddisk:/test.tar location 0/RSP0 harddisk:/test.tar location 0/RSP0/CPU0/VM1