在CentOS7下的OpenStack中配置使用Spice協議 
        
 
        
          by 無若 
        
 
         
         1. 需要的包 
        
 
         
         在計算節點上 
        
 
        
          #yum install spice-html5 
        
 
        
          注意:使用yum安裝spice-html5不成功時,可以直接使用rpm方式下載后安裝 
        
 
        
          wget http://dl.fedoraproject.org/pub/epel/7/x86_64/s/spice-html5-0.1.6-1.el7.noarch.rpm 
        
 
        
          rpm -i spice-html5-0.1.6-1.el7.noarch.rpm 
        
 
         
         在控制節點上 
        
 
        
          yum install openstack-nova-spicehtml5proxy 
        
 
         
         2. 修改配置文件 
        
 
         
          這里假設 
         
 
         
           控制節點IP = 192.168.1.100 
         
 
         
           計算節點IP = 172.16.1.100 
         
 
         
         控制節點 
        
 
        
          /etc/nova/nova.conf 
        
 
        
          /etc/nova/nova.conf 
        
 
        
          [DEFAULT] 
        
 
        
          web=/usr/share/spice-html5 
        
 
        
          vnc_enabled=false 
        
 
        
          novnc_enabled=false 
        
 
        
          ... 
        
 
        
          [vnc] 
        
 
        
          enabled=false 
        
 
        
          ... 
        
 
        
          [spice] 
        
 
        
          html5proxy_host=0.0.0.0 
        
 
        
          html5proxy_port=6082 
        
 
        
          html5proxy_base_url=https://192.168.1.100:6082/spice_auto.html 
        
 
        
          # Enable spice related features (boolean value) 
        
 
        
          enabled=True 
        
 
        
          # Enable spice guest agent support (boolean value) 
        
 
        
          agent_enabled=true 
        
 
        
          # Keymap for spice (string value) 
        
 
        
          keymap=en-us 
        
 
         
         在控制節點上修改路由規則 
        
 
        
          iptables -I INPUT -p tcp -m multiport --dports 6082 -m comment --comment "Allow SPICE connections for console access " -j ACCEPT 
        
 
         
         修改計算節點配置 
        
 
        
          /etc/nova/nova.conf 
        
 
        
          [DEFAULT] 
        
 
        
          web=/usr/share/spice-html5 
        
 
        
          vnc_enabled=false 
        
 
        
          novnc_enabled=false 
        
 
        
          ... 
        
 
        
          [vnc] 
        
 
        
          enabled=false 
        
 
        
          ... 
        
 
        
          [spice] 
        
 
        
          html5proxy_base_url=https://192.168.1.100:6082/spice_auto.html 
        
 
        
          server_listen=0.0.0.0 
        
 
        
          server_proxyclient_address=172.16.10.100 
        
 
        
          # Enable spice related features (boolean value) 
        
 
        
          enabled=True 
        
 
        
          # Enable spice guest agent support (boolean value) 
        
 
        
          agent_enabled=true 
        
 
        
          # Keymap for spice (string value) 
        
 
        
          keymap=en-us 
        
 
         
         3. 重啟服務 
        
 
         
         控制節點 
        
 
        
          # service httpd restart 
        
 
        
          # service openstack-nova-spicehtml5proxy start 
        
 
         
         
        
          # service openstack-nova-spicehtml5proxy status  
        
 
        
          # systemctl enable openstack-nova-spicehtml5proxy 
        
 
         
         計算節點 
        
 
        
          # service openstack-nova-compute restart 
        
 
        
