티스토리 뷰

카테고리 없음

spice console

Jacob_baek 2017. 6. 19. 17:37

VNC 혹은 SPICE HTML5는 OpenStack Dashboard 혹은 command line 사용하여 Guest OS에 remote desktop을 접근할수 있다. 이는 token 인증 관리를 수행하는 nova-consoleauth라 불리는 공유된 서비스를 통해 접근할 수 있다. 이중 spice console을 사용하는 방법에 대해 알아보자.


Spice Console을 사용하는 방법

기본으로 VNC로 console이 설정되어 있다. vnc의 경우 사실 많이 느리고 연결성이 떨어진다.

Spice 로 변경하는 방법을 알아보자. 


기본적으로 미설치되어 있는 패키지 설치를 한다.


# controller && compute

yum install openstack-nova-spicehtml5proxy -y

yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm -y

yum install spice-html5 -y


패키지가 설치되면 각 노드에 설정을 수행한다.


설정전 가정사항은 

- controller node ip : 10.2.2.109 (horizon dashboard ip) / 10.2.3.18 (internal ip)

- compute node ip : 10.2.3.17


# Controller Node

[default]

web=/usr/share/spice-html5

[spice]

enabled=true

agent_enabled=true
html5proxy_base_url=http://127.0.0.1:6082/spice_auto.html
keymap=en-us
html5proxy_host=0.0.0.0
html5proxy_port=6082

아래와 iptables 등록을 해야 한다.

iptables -I INPUT -p tcp -m multiport --dports 6082 -m comment --comment "using spice console" -j ACCEPT


# Compute Node

[default]

web=/usr/share/spice-html5

[spice]

enabled=true

agent_enabled=true
html5proxy_base_url=http://10.2.2.109:6082/spice_auto.html
server_listen=10.2.3.17
server_proxyclient_address=10.2.3.17
keymap=en-us

이후 아래의 서비스를 재구동한다.

# Controller

systemctl restart openstack-nova-spicehtml5proxy

systemctl enable openstack-nova-spicehtml5proxy


# compute

systemctl restart openstack-nova-compute


확인작업

실제로 다음과 같은 서비스가 동작중이어야 한다.

Controller는 아래와 같이 6082로 서비스가 되고 있어야 하고 

[root@overcloud-controller-0 heat-admin]# netstat -tnlp | grep 608

tcp        0      0 10.2.3.18:6080          0.0.0.0:*               LISTEN      199681/haproxy

tcp        0      0 10.2.2.109:6080         0.0.0.0:*               LISTEN      199681/haproxy

tcp        0      0 10.2.3.19:6080          0.0.0.0:*               LISTEN      2077/python2

tcp        0      0 0.0.0.0:6082            0.0.0.0:*               LISTEN      517345/python2


compute에서는 virsh edit instance_id를 해보면
    <graphics type='vnc' port='-1' autoport='yes' listen='10.2.3.17' keymap='en-us'>
      <listen type='address' address='10.2.3.17'/>
    </graphics>
    <graphics type='spice' autoport='yes' listen='10.2.3.17' keymap='en-us'>
      <listen type='address' address='10.2.3.17'/>
    </graphics>
와 같이 spice 에 대한 graphics element가 존재해야 한다.

최종적으로 아래와 같이 확인이 되어야 한다.

[stack@director11 ~]$ openstack console url show testvm-3 --spice

+-------+-----------------------------------------------------------------------------------+

| Field | Value                                                                             |

+-------+-----------------------------------------------------------------------------------+

| type  | spice-html5                                                                       |

| url   | http://10.2.2.109:6082/spice_auto.html?token=49fe3581-4a62-447a-96d0-284879384c9e |

+-------+-----------------------------------------------------------------------------------+

[stack@director11 ~]$ openstack console url show testvm-3 --novnc

+-------+---------------------------------------------------------------------------------+

| Field | Value                                                                           |

+-------+---------------------------------------------------------------------------------+

| type  | novnc                                                                           |

| url   | http://10.2.2.109:6080/vnc_auto.html?token=9401fef9-c2f4-4e7d-91b9-b3454e43e5b5 |

+-------+---------------------------------------------------------------------------------+


참고로 설정전에 만들어놓았던 VM의 경우 spice 적용이 안된다. VM을 재생성해야 한다.


최종적으로 아래와 같이 연결이 이루어진다.



TroubleShooting

만약 아래와 같이 연결이 되지 않는 경우는 

[stack@director9 ~]$ openstack console url show NAIM-DB --spice

Invalid input for field/attribute type. Value: spice. u'spice' is not one of ['spice-html5'] (HTTP 400) (Request-ID: req-b3f491c4-c36c-4f21-9362-90aad945cf55)


controller 노드에서 6082 port가 listen되는지와 연결이 되는지 확인하고
compute 노드에서 virsh tool을 이용하여 VM에 graphics에 spice가 설정되어 있는지 확인한다.


참고사이트

- http://silverskysoft.com/open-stack-xwrpr/2015/07/enable-spice-html5-console-access-in-openstack-kilo/

- https://www.slideshare.net/YukihiroKawada/rdo-spice
- https://docs.openstack.org/nova/pike/admin/remote-console-access.html

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함