Revision 56c9a709 doc/admin.rst

b/doc/admin.rst
293 293
  gnt-cluster version
294 294

  
295 295
See the man page :manpage:`gnt-cluster` to know more about their usage.
296

  
297
Removing a cluster entirely
298
~~~~~~~~~~~~~~~~~~~~~~~~~~~
299

  
300
The usual method to cleanup a cluster is to run ``gnt-cluster
301
destroy`` however if the Ganeti installation is broken in any way then
302
this will not run.
303

  
304
It is possible in such a case to cleanup manually most if not all
305
traces of a cluster installation by following these steps on all of
306
the nodes:
307

  
308
1. Shutdown all instances. This depends on the virtualisation
309
   method used (Xen, KVM, etc.):
310

  
311
  - Xen: run ``xm list`` and ``xm destroy`` on all the non-Domain-0
312
    instances
313
  - KVM: kill all the KVM processes
314
  - chroot: kill all processes under the chroot mountpoints
315

  
316
2. If using DRBD, shutdown all DRBD minors (which should by at this
317
   time no-longer in use by instances); on each node, run ``drbdsetup
318
   /dev/drbdN down`` for each active DRBD minor.
319

  
320
3. If using LVM, cleanup the Ganeti volume group; if only Ganeti
321
   created logical volumes (and you are not sharing the volume group
322
   with the OS, for example), then simply running ``lvremove -f
323
   xenvg`` (replace 'xenvg' with your volume group name) should do the
324
   required cleanup.
325

  
326
4. If using file-based storage, remove recursively all files and
327
   directories under your file-storage directory: ``rm -rf
328
   /srv/ganeti/file-storage/*`` replacing the path with the correct
329
   path for your cluster.
330

  
331
5. Stop the ganeti daemons (``/etc/init.d/ganeti stop``) and kill any
332
   that remain alive (``pgrep ganeti`` and ``pkill ganeti``).
333

  
334
6. Remove the ganeti state directory (``rm -rf /var/lib/ganeti/*``),
335
   replacing the path with the correct path for your installation.
336

  
337
On the master node, remove the cluster from the master-netdev (usually
338
``xen-br0`` for bridged mode, otherwise ``eth0`` or similar), by
339
running ``ip a del $clusterip/32 dev xen-br0`` (use the correct
340
cluster ip and network device name).
341

  
342
At this point, the machines are ready for a cluster creation; in case
343
you want to remove Ganeti completely, you need to also undo some of
344
the SSH changes and log directories:
345

  
346
- ``rm -rf /var/log/ganeti /srv/ganeti`` (replace with the correct paths)
347
- remove from ``/root/.ssh`` the keys that Ganeti added (check
348
  the ``authorized_keys`` and ``id_dsa`` files)
349
- regenerate the host's SSH keys (check the OpenSSH startup scripts)
350
- uninstall Ganeti
351

  
352
Otherwise, if you plan to re-create the cluster, you can just go ahead
353
and rerun ``gnt-cluster init``.

Also available in: Unified diff