# 查看第一台CNA主机的虚机情况 [gandalf@CNA01 ~]$ su - root Password: Last login: Thu Jan 9 16:01:01 CST 2025 CNA01:~ # TMOUT=0 CNA01:~ # virsh list Id Name State ------------------------ 1 i-00000002 running # 查看第二天CNA主机的虚机情况 [gandalf@CNA02 ~]$ su - root Password: Last login: Thu Jan 9 16:01:01 CST 2025 CNA02:~ # TMOUT=0 CNA02:~ # virsh list Id Name State ------------------------ 1 i-00000001 running
# 确定主VRM主机VNC端口为标准端口 # 使用标准端口通过vnc连接CNA主机01IP CNA01:~ # modify_vm_vnc open i-00000002 vrm id:i-00000002 Begin safe stop vm i-00000002 del_nginx_libvirt_conf, cmd is sh /etc/vna-api/ecs_scripts/NginxDelServer.sh "5900" Begin undefine vm i-00000002 Begin define vm i-00000002 Begin start vm i-00000002 add_nginx_libvirt_conf, cmd is sh /etc/vna-api/ecs_scripts/NginxAddServer.sh "172.16.199.100" "5900" modify vm vnc success. # 确定备VRM主机VNC端口 # 使用指定5935端口通过vnc连接CNA02主机IP CNA02:~ # modify_vm_vnc open i-00000001 vrm id:i-00000001 Begin safe stop vm i-00000001 del_nginx_libvirt_conf, cmd is sh /etc/vna-api/ecs_scripts/NginxDelServer.sh "5935" Begin undefine vm i-00000001 Begin define vm i-00000001 Begin start vm i-00000001 add_nginx_libvirt_conf, cmd is sh /etc/vna-api/ecs_scripts/NginxAddServer.sh "172.16.199.101" "5935" modify vm vnc success. # 可以看出是非标准接口 CNA02:~ # virsh dumpxml i-00000001 | grep vnc <graphics type='vnc' port='5935' autoport='yes' listen='127.0.0.1' keymap='en-us'>