更新前需要做如下检查,确保能使用upgrade命令升级:
- 查看当前状态,备份基础配置 ifconfig ovs-vsctl show cd /home/admin tar czvf ovs.tgz /ovs/ovs-vswitchd.conf.db /etc/picos/picosstart.conf tar cavf lic.tgz /etc/picos/switch-public.key /etc/picos/pica.lic 用scp 将 ovs.tgz lic.tgz 复制出来
确定备份分区状态(它必须是ok或者up-to-date)
admin@PicOS-OVS$cat /etc/picos/fsstatus
primary: ok
secondary: up-to-date
admin@PicOS-OVS$
上传更新image文件到交换机的/cftmp 目录
假设您用来下载的主机系统为linux,IP地址为 10.10.10.16,下载的文 件名为 picos-2.8.0-P5401-45ec985.tar.gz 在确保交换机可以ping 通 10.10.50.16后,可以在 交换机 上执行
admin@PicOS-OVS$cd cftmp
admin@PicOS-OVS$sudo scp user@10.10.50.16:/home/user/picos-2.8.0-P5401-45ec985.tar.gz ./
admin@PicOS-OVS$sudo scp user@10.10.50.16:/home/user/picos-2.8.0-P5401-45ec985.tar.gz.md5 ./
此步骤的目的是将升级映像复制到交换机的/cftmp 目录下。
在/cftmp下执行upgrade命令升级交换机版本
admin@PicOS-OVS$ cd /cftmp admin@PicOS-OVS$ sudo upgrade picos-2.8.0-P5401-45ec985.tar.gz
./etc/lsb-release
Upgrading P5401
Upgrade P5401 started
Checking MD5 of image
MD5 Check OK!
./etc/p1upgrade.sh
Back up PicOS configuration files
/ovs/ovs-vswitchd.conf.db /etc/picos/picosstart.conf
Config files saved locally as
/cftmp/CONFIGFILEP5401-10.10.51.162-@20170116.tgz
Backup PicOS license files
/etc/picos/switch-public.key /etc/picos/pica.lic
License files saved locally as
/cftmp/LICENSEFILEP5401-10.10.51.162-@20170116.tgz
Rebooting in 10 seconds!
admin@PicOS-OVS$
回滚
如果新操作系统无法及时上线工作,则以携带的备份机器顶上。 恢复之前备份之配置,
tar xzvf ovs.tgz