The ungleich VM console » History » Version 3
Jin-Guk Kwon, 02/17/2020 06:52 PM
1 | 1 | Jin-Guk Kwon | h1. The ungleich VM console |
---|---|---|---|
2 | |||
3 | {{toc}} |
||
4 | |||
5 | h2. 1. System Architecture |
||
6 | |||
7 | This service supports accessing console of your VM through guacamole service. |
||
8 | And To log-in VM console web needs datacenterlight.ch account. User's accounts are syncronized with LDAP. |
||
9 | |||
10 | !archi.png! |
||
11 | |||
12 | h2. 2. Set guacamole server |
||
13 | |||
14 | - run cdist |
||
15 | |||
16 | <pre> |
||
17 | cd ~/.cdist; git pull; cdist config -bj7 -p9 -vv desktop.ungleich.ch |
||
18 | </pre> |
||
19 | |||
20 | 3 | Jin-Guk Kwon | - in manifest for centos |
21 | 1 | Jin-Guk Kwon | |
22 | <pre> |
||
23 | …… |
||
24 | desktop.ungleich.ch) |
||
25 | __guacamole_centos --ldap-hostname 'ldap server url' \ |
||
26 | 3 | Jin-Guk Kwon | --ldap-port '636' \ |
27 | --ldap-encryption-method 'ssl' \ |
||
28 | --ldap-user-base-dn 'ou=XXX,dc=ungleich,dc=ch' \ |
||
29 | --ldap-search-bind-password ‘refer to pass' \ |
||
30 | --ldap-search-bind-dn 'cn=XXXXX,dc=ungleich,dc=ch' \ |
||
31 | --ldap-username-attribute 'uid' \ |
||
32 | --postgresql-hostname 'localhost' \ |
||
33 | --postgresql-username 'USER name' \ |
||
34 | --postgresql-database 'DB-name' \ |
||
35 | --postgresql-port 'XXXX' \ |
||
36 | --postgresql-password 'password' \ |
||
37 | --TOTP \ |
||
38 | --guacd-db 'postgresql' |
||
39 | </pre> |
||
40 | |||
41 | - in manifest for alpine (only support postgresql) |
||
42 | |||
43 | <pre> |
||
44 | …… |
||
45 | desktop.ungleich.ch) |
||
46 | _ungleich_vnc_console --ldap-hostname 'ldap server url' \ |
||
47 | 1 | Jin-Guk Kwon | --ldap-port '636' \ |
48 | --ldap-encryption-method 'ssl' \ |
||
49 | --ldap-user-base-dn 'ou=XXX,dc=ungleich,dc=ch' \ |
||
50 | --ldap-search-bind-password ‘refer to pass' \ |
||
51 | --ldap-search-bind-dn 'cn=XXXXX,dc=ungleich,dc=ch' \ |
||
52 | --ldap-username-attribute 'uid' \ |
||
53 | --postgresql-hostname 'localhost' \ |
||
54 | --postgresql-username 'USER name' \ |
||
55 | --postgresql-database 'DB-name' \ |
||
56 | --postgresql-port 'XXXX' \ |
||
57 | --postgresql-password 'password' \ |
||
58 | --TOTP \ |
||
59 | --guacd-db 'postgresql' |
||
60 | </pre> |
||
61 | |||
62 | h2. 3. Create VNC connection for VM |
||
63 | |||
64 | !g_con.png! |
||
65 | |||
66 | h3. 1) install postgresql on opennebual server |
||
67 | |||
68 | <pre> |
||
69 | apt install postgresql-client |
||
70 | </pre> |
||
71 | |||
72 | h3. 2) config postgresql for accessing from external host(%{color:blue}This is excuted by cdist%) |
||
73 | |||
74 | - vi /var/lib/pgsql/data/postgresql.conf on guacamole server(desktop) |
||
75 | |||
76 | <pre> |
||
77 | listen_addresses = '*' |
||
78 | </pre> |
||
79 | |||
80 | - vi /var/lib/pgsql/data/pg_hba.conf on guacamole server(desktop) |
||
81 | |||
82 | <pre> |
||
83 | host all all opennbula server address trust |
||
84 | </pre> |
||
85 | |||
86 | - Restart postgresql |
||
87 | |||
88 | <pre> |
||
89 | systemctl restart postgresql |
||
90 | </pre> |
||
91 | |||
92 | h3. 3) set vnc connection automatically on opennebula server |
||
93 | |||
94 | h4. (1) vnc connection script |
||
95 | |||
96 | - vm_list_dual_uid : create VM list file(uid, email, VM Number, host, VNC port) (https://code.ungleich.ch/ungleich-public/ungleich-tools/blob/master/vm_list_dual_uid) |
||
97 | |||
98 | - create-guacamole-session-ldap-db : create VNC connection on desktop (https://code.ungleich.ch/ungleich-public/ungleich-tools/blob/master/create-guacamole-session-ldap-DB) |
||
99 | |||
100 | h4. (2) create crontab |
||
101 | |||
102 | <pre> |
||
103 | crontab -e |
||
104 | </pre> |
||
105 | |||
106 | <pre> |
||
107 | 15 0,2,4,6,8,10,12,14,16,18,20,22 * * * ./vm_list_dual_uid #create vm_list |
||
108 | 45 0,2,4,6,8,10,12,14,16,18,20,22 * * * ./create-guacamole-session-ldap-db vm_vnc_list #create vm_list |
||
109 | </pre> |
||
110 | |||
111 | h2. 4. Monitoring VNC console |
||
112 | |||
113 | - We are monitoring VNC console with prometheus. |
||
114 | - run cdist __dcl_monitoring_server(update prometheus.yml) |
||
115 | |||
116 | 2 | Jin-Guk Kwon | h2. %{color:blue}※User VM information is synchronized with the VM console every hour. If you create VM right now, you can access VM console after one hour.(vnc connection script takes about 7~8 minutes.)% |