1 ================================================================================
3 ================================================================================
5 Ganeti Web Manager is a Django based web application that allows administrators
6 and clients access to their ganeti clusters.
10 2.1.x - mostly supported
11 2.0.x - unsupported but may work
14 Browser compatibility:
15 * Mozilla Firefox >= 3.x
18 The VNC console requires websockets or flash support and HTML5 support in the
21 Project page: http://code.osuosl.org/projects/ganeti-webmgr
22 Mailing List: http://groups.google.com/group/ganeti-webmgr
23 IRC: #ganeti-webmgr on freenode.net
24 Twitter: http://twitter.com/ganetiwebmgr
27 ================================================================================
29 ================================================================================
31 1. Install Dependencies
32 * Python >= 2.5 but < 3.x (Python 3.x is not supported due to
33 backward-compatibility issues)
35 * Fabric >= 1.0.1 (installable from pip)
36 * VirtualEnv >= 1.6.1 (installable from pip)
37 2. Deploy this code somewhere (i.e. /var/lib/django/ganeti_webmgr)
38 3. Run Fabric deployment
42 or a production deployment:
46 4. Copy settings.py.dist to settings.py
47 5. Create a database and configure your settings:
49 DATABASE_ENGINE = '' <-- Change This to 'mysql', 'postgresql',
50 'postgresql_psycopg2' or 'sqlite3'
51 DATABASE_NAME = '' <-- Change this to a database name, or a file for SQLite
52 DATABASE_USER = '' <-- Change this (not needed for SQLite)
53 DATABASE_PASSWORD = '' <-- Change this (not needed for SQLite)
54 DATABASE_HOST = '' <-- Change this (not needed if database is localhost)
55 DATABASE_PORT = '' <-- Change this (not needed if database is localhost)
57 6. Set the id, name and domain of your site in settings.py and the site will
58 automatically be created when syncdb is run.
60 # Unique site id used by many modules to distinguish site from others.
63 # Site name and domain referenced by some modules to provide links back to the
65 SITE_NAME = 'Ganeti Web Manager'
66 SITE_DOMAIN = 'localhost:8000'
68 7. Initialize the database
70 ./manage.py syncdb --migrate
72 8. Activate Virtual Environment
84 1. Change your SECRET_KEY and WEB_MGR_API_KEY to unique (and hopefully
85 unguessable) strings in your settings.py.
87 2. For versions >= 0.5 you may need to add the full filesystem path to your
88 templates directory to TEMPLATE_DIRS and remove the relative reference
89 to 'templates'. We've had issues using wsgi not working correctly unless
90 this change has been made.
92 3. Ensure the server has the ability to send emails or you have access to
93 an SMTP server. Set EMAIL_HOST, EMAIL_PORT, and DEFAULT_FROM_EMAIL in
94 settings.py. For more complicated outgoing mail setups, please refer to
95 the django email documentation [1].
97 4. Follow the django guide to deploy [2] with apache. Here is an example
103 path = '/var/lib/django/ganeti_webmgr'
104 if path not in sys.path:
105 sys.path.append(path)
107 os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
109 import django.core.handlers.wsgi
110 application = django.core.handlers.wsgi.WSGIHandler()
112 5. Enable periodic cache updater [3].
114 twistd gwm_cache --pidfile=tmp/gwm_cache.pid
116 [1] http://docs.djangoproject.com/en/1.2/topics/email/
117 [2] http://docs.djangoproject.com/en/1.2/howto/deployment/
118 [3] http://code.osuosl.org/projects/ganeti-webmgr/wiki/Cache_System#Periodic-Cache-Refresh
120 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/Install
122 ================================================================================
123 Ganeti RAPI users and passwords
124 ================================================================================
126 Before you can start using Ganeti Web Manager you will need to create a user
127 and password on the Ganeti cluster.
129 Here is an example with a user jack and password abc123:
131 echo -n 'jack:Ganeti Remote API:abc123' | openssl md5
133 Add the hash to the RAPI users file and restart ganeti-rapi. Depending on the
134 version of Ganeti you are running, you will need to either use
135 `/var/lib/ganeti/rapi_users` (Ganeti <=2.3.x ) or
136 `/var/lib/ganeti/rapi/users` (Ganeti >=2.4.x ).
138 An example hash entry might look like the following:
140 # Hashed password for jack
141 jack {HA1}54c12257ee9be413f2f3182435514aae write
143 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/Managing_Clusters#Ganeti-RAPI-users-and-passwords
146 ================================================================================
148 ================================================================================
150 1. Use the admin user created during syncdb to log in.
151 2. Import a cluster: Clusters -> Add Cluster
152 3. Fill out properties and click save
154 When the cluster is created it will automatically synchronize the list of
155 Virtual Machines with information from the ganeti cluster.
157 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/Importing_a_Cluster
160 ================================================================================
161 Users, Groups, and Permissions
162 ================================================================================
164 Permissions may be granted to both clusters and virtual machines. The
165 permissions system is intended to allow users to manage themselves. Any object
166 that can have its permissions edited will have a Users tab.
168 Adding users to objects:
169 1. Navigate to Group, Cluster, or VirtualMachine detail page
170 2. Click Add New User
171 3. Select user or group
172 4. Select permissions
175 Updating permissions:
176 1. Navigate to Group, Cluster, or VirtualMachine detail page
178 3. Click permissions column
179 4. Select permissions and save
181 Deleting permissions:
182 1. Navigate to Group, Cluster, or VirtualMachine detail page
184 3. Click the delete icon
186 Deleting a user will remove all permissions, and other properties associated
187 with the user such as cluster quotas.
189 Users may belong to any number of user groups. User groups can be assigned
190 permissions and quotas just like users. Users inherit permissions from groups
191 and may act on their behalf to create virtual machines.
193 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/Permissions
196 ================================================================================
198 ================================================================================
200 Quotas restrict the usage of cluster resources by users and groups. Default
201 quotas can be set by editing clusters, if no quota is set unlimited access is
202 allowed. This will affect all users and groups.
204 The default quota can be overridden on the cluster users page:
206 1. Clusters -> Cluster -> Users
207 2. Click on the quota
210 Leaving a value empty specifies unlimited access for that resource.
212 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/Permissions#Quotas
215 ================================================================================
216 Orphaned VirtualMachines
217 ================================================================================
219 You can find VirtualMachines with no permissions via Admin -> Orphaned VMs.
220 This will force a synchronization of all clusters and display VirtualMachines
221 that do not have any permissions assigned.
223 You only need to grant permissions directly on virtual machines if you are
224 granting access to non-admin users.
226 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/Managing_Clusters#Orphaned-Virtual-Machines
229 ================================================================================
231 ================================================================================
233 Ganeti Web Manager uses a cache system that stores information about ganeti
234 clusters in the database. This allows the following:
240 Model <- cache <- Updater
242 * Permissions are stored in the database and are associated to the cached
244 * The cached data can be searched and or filtered
245 * Limits the amount of traffic between the webserver and ganeti cluster.
247 The cache system is transparent and will load cached data automatically when
248 the object is initialized.
250 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/Cache_System
252 ================================================================================
254 ================================================================================
256 Ganeti Web Manager provides an in browser console using noVNC [1], an HTML5
257 client. noVNC requires WebSockets to function. Support for older browsers is
258 provided through a flash applet that is used transparently in the absence of
261 [1] https://github.com/kanaka/noVNC
263 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/VNC
265 ================================================================================
267 ================================================================================
269 VNC Auth proxy [1] is required for the console tab to function. VNC servers do
270 not speak websockets and our proxy allows your ganeti cluster to sit behind a
271 firewall, VPN, or NAT.
273 Enabling in settings.py
274 -----------------------
276 Set the host and port that the proxy will be running at with the VNC_PROXY
277 setting. For development this is typically "localhost:8888" but for production
278 you would use the name of the server its running on. See the instructions in
279 settings.py for more details.
284 Twisted VNC Authproxy is started with twistd, the twisted daemon. Eventually we
285 will include init.d scripts for better managing the daemon. You may want to open
286 port 8888 in your firewall for production systems.
288 twistd --pidfile=/tmp/proxy.pid -n vncap
290 Starting Flash Policy Server
291 ----------------------------
293 Browsers that do not support WebSockets natively are supported through the use
294 of a flash applet. Flash applets that make use of sockets must retrieve a policy
295 file from the server they are connecting to. Twisted VNCAuthProxy includes a
296 policy server. It must be run separately since it requires a root port. You may
297 want to open port 843 in your firewall for production systems.
299 Start the policy server with twistd
301 sudo twistd --pidfile=/tmp/policy.pid -n flashpolicy
307 You may encounter an issue where twisted fails to start and gives you an error.
308 This is usually caused by the environment variable PYTHONPATH not being
309 exported correctly if you sudo up to root. To fix it type:
311 export PYTHONPATH="."
313 Try executing twisted again and it should work.
315 [1] http://code.osuosl.org/projects/twisted-vncauthproxy
317 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/VNC#VNC-Authproxy
319 ================================================================================
321 ================================================================================
323 Ganeti Web Manager allows users to store SSH Keys. Each virtual machine has a
324 view that will return SSH keys for users with access. This can be used as a
325 Ganeti post-install hook to deploy user's keys on the VMs.
327 To allow VMs to copy keys, copy util/hooks/sshkeys.sh to the instance
328 definition hooks directory on every node in the clsuter and make the file
329 executable. Next, add the required variables to the variant config file
330 or main instance definition config file. The config file can be found in
331 util/hooks/sshkeys.conf and includes documentation for each variable.
333 Also see: http://code.osuosl.org/projects/ganeti-webmgr/wiki/PermissionsSSHKeys