Nexus9の運用設定5(ファイル操作)

Nexus9監視運用設定と出力

運用フェーズで使いそうなコマンド出力を記載する。
※仮想NX-OSなので参考まで。

確認すること

sftpでconfigバックアップ
Nexus9k# copy running-config sftp://user@172.16.0.1 vrf default
Enter destination filename: [Nexus9k-running-config] sftp_NX9k_config
user@172.16.0.1's password: 
Connected to 172.16.0.1.
sftp> put  /var/tmp/vsh/sftp_NX9k_config  sftp_NX9k_config 
Uploading /var/tmp/vsh/sftp_NX9k_config to /home/user/sftp_NX9k_config
/var/tmp/vsh/sftp_NX9k_config                 100% 7416     7.2KB/s   00:00    
sftp> exit 
Copy complete, now saving to disk (please wait)...
Copy complete.
Nexus9k# 
scpでconfigバックアップ
Nexus9k# copy running-config scp://user@172.16.0.1 vrf default
Enter destination filename: [Nexus9k-running-config] scp_NX9k_config
user@172.16.0.1's password: 
scp_NX9k_config                               100% 7416     7.2KB/s   00:00    
Copy complete, now saving to disk (please wait)...
Copy complete.
■フォルダ階層を確認(初期デフォルト ディレクトリは bootflash:)
Nexus9k# pwd
bootflash:
■bootflash:配下確認
Nexus9k# dir
       4096    Sep 10 11:27:59 2020  .rpmstore/
       4096    Sep 30 15:53:46 2020  virtual-instance/
       4096    Sep 30 15:53:34 2020  virtual-instance-stby-sync/
        120    Sep 30 15:46:20 2020  virtual-instance.conf

Usage for bootflash://
 1500626944 bytes used
20364791808 bytes free
21865418752 bytes total
■bootflash:配下にフォルダ作成
Nexus9k# mkdir config_backup
■作成したフォルダにconfigバックアップ
Nexus9k# copy running-config bootflash:///config_backup/202010/26_test-rt10
Copy complete, now saving to disk (please wait)...
Copy complete.
■running-configをSBY側のsupに保存する
Nexus9k# copy running-config bootflash://sup-standby/
Enter destination filename: [Nexus9k-running-config] 
Copy complete, now saving to disk (please wait)...
Copy complete.
■フォルダ移動
Nexus9k# cd volatile:
Nexus9k# 
Nexus9k# pwd
volatile:
■ファイルを削除する
Nexus9k# delete bootflash://sup-standby/Nexus9k-running-config
Do you want to delete "/Nexus9k-running-config" ? (yes/no/abort)   [y] y
■ファイルの出し入れが可能なフォルダ、actまたはsbyのsup
Nexus9k# copy running-config bootflash://?
  bootflash:///             
  bootflash://module-27/    
  bootflash://module-28/    
  bootflash://sup-1/        
  bootflash://sup-2/        
  bootflash://sup-active/   
  bootflash://sup-local/    
  bootflash://sup-remote/   
  bootflash://sup-standby/  
■ローカル側bootflash:(今)以下全部同じローカル側bootflash
bootflash://module-27/    
bootflash://sup-standby/
bootflash://sup-1/     
bootflash://sup-remote/ 
■リモート側bootflash:
bootflash://module-28/
bootflash://sup-active/     
bootflash://sup-local/   
bootflash://sup-2/      
■SCPでサーバからダウンロード
Nexus9k# copy scp://192.168.1.1 bootflash://
Enter source filename: test10
Enter vrf (If no input, current vrf 'default' is considered): management
Enter username: XXXX
katano@192.168.1.1's password: 
test10                                                        100% 7830     7.7KB/s   00:00    
Copy complete, now saving to disk (please wait)...
Copy complete.
Nexus9k# 
Nexus9k# dir ★確認
       4096    Sep 10 11:27:59 2020  .rpmstore/
       4096    May 21 11:41:09 2020  .swtam/
       4096    May 21 11:41:40 2020  scripts/
   39102288    Oct 07 10:41:38 2020  tech.gz
       7830    Oct 25 18:11:30 2020  test10
       4096    Oct 25 17:37:41 2020  test2dir/
        120    Sep 30 15:46:20 2020  virtual-instance.conf
■ロール バック
リロードしなくてもコンフィギュレーションを再適用できる