Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

install

Christian Stankowic edited this page Apr 16, 2015 · 16 revisions

This page explains how to install and configure satprep.

#Requirements satprep needs Python 2.6 or newer - it runs on EL5/6 machines without adding additional software repositories (that's by the way one reason why I had chosen optparse instead of argparse). The following Python modules are used:

  • libvirt
  • optparse
  • sys
  • os
  • stat
  • difflib
  • time
  • csv
  • string
  • datetime
  • time
  • getpass
  • xmlrpclic (shipped with rhnlib)
  • pprint
  • logging
  • requests
  • unidecode

The toolkit needs the pdflatex binary which is usually part of the LaTeX or TeX Live software set provided by your distributor (for EL you’ll need the texlive-latexpackage). You need to install one of both. The template which is used by satprep uses the following LaTeX modules:

  • wasysym
  • tabularx
  • colortbl
  • array
  • hyper
  • graphicx

Usually these modules should already be part of your LaTeX or TeX Live distribution.

For the satprep_wa_vcvms.py vCenter workaround script you will need to install the Python module pysphere.

#Installation ##Software preparation Make sure to have TeX live and additional Python modules installed:

# yum install -y texlive-latex rhnlib libvirt-python python-{unidecode,requests}

If you need to use the vCenter workaround script install pysphere:

# pip install -U pysphere

##Monitoring preparation To make things clear you should create a dedicated user for (un)scheduling downtimes. This can be done by adding a contact to your configuration:

define contact {
    contact_name                   satprep
    alias                          satprep user
    use                            generic-contact
    email                          root@localhost
}

Depending on your monitoring configuration you might also need to add an entry to your monitoring web-application's password file:

$ htpasswd ~/etc/htpasswd satprep
New password:
Re-type new password: 
Adding password for user satprep

The user also needs to have permissions for the following CGI operations (sections from cgi.cfg):

authorized_for_system_information
authorized_for_system_commands
authorized_for_all_services
authorized_for_all_hosts
authorized_for_all_service_commands
authorized_for_all_host_commands

To make satprep work without authorization dialogs create an auth file for the new user. Simply create a file containing the user name and password. Make sure the file has the permissions 0600 - otherwise the file is rejected:

$ cat mon.auth
myuser
mypass
$ chmod 0600 mon.auth

##Virtualization preparation Create a dedicated user for your virtualization (management) host that is allowed to:

  • search for VMs based on UIDs
  • search for snapshots
  • create snapshots
  • remove snapshots
  • consolidate virtual hard disks (if applicable)

###vCenter role For VMware vCenter create a role satprep with the following permissions:

  • Sessions
    • Validate sessions
  • Virtual machine
    • Interaction
      • Consolidate hard disks
    • Snapshot management
      • Create Snapshot
      • Remove Snapshot

Also create an authfile if you need non-interactive automation.

##Toolkit installation Check-out using Git or download the current master zip file and extract it:

# cd /opt
# wget https://github.com/stdevel/satprep/archive/master.zip
# unzip master.zip
# mv satprep-master satprep
# chmod +x satprep/*.py

##Satellite preparation Execute the satprep_install_custominfos.py script to make sure your management system has the appropriate custom information keys to assign important meta information to your registered hosts:

$ ./satprep_install_custominfos.py -s mysat.localdomain.loc
Satellite Username:
Satellite Password:
INFO:satprep_install_custominfos:successfully created/updated information key 'SYSTEM_OWNER'
INFO:satprep_install_custominfos:successfully created/updated information key 'SYSTEM_MONITORING'
...

It is also a good idea to create a dedicated user for the satprep toolkit to avoid using your private login. Make sure that this user has at least read-only permissions (this was added in Spacewalk API 2.2).

To make satprep work without authorization dialogs create an authfile for the new user.

##Configure your systems To have senseful information for your system you need to assign custominfos to all your registered systems. You can easily assign them using the web interface of Spacewalk.

Some examples:

System A, test system without monitoring and anti-virus protection, snapshots before maintenance required, hosted on ESXi system myesxA

  • SYSTEM_OWNER: Max Mustermann
  • SYSTEM_VIRT_SNAPSHOT: 1
  • SYSTEM_VIRT_HOST: myesxA
  • SYSTEM_VIRT_HOST_AUTH: /opt/satprep/myesxA.auth

System B, prodcution system, with monitoring and backup, snapshots before maintenance required, hosted on ESXi system myesxB

  • SYSTEM_OWNER: Max Mustermann
  • SYSTEM_PROD: 1
  • SYSTEM_MONITORING: 1
  • SYSTEM_MONITORING_HOST: myicinga
  • SYSTEM_MONITORING_HOST_AUTH: /opt/satprep/myicinga.auth
  • SYSTEM_VIRT_SNAPSHOT: 1
  • SYSTEM_VIRT_HOST: myesxB
  • SYSTEM_VIRT_HOST_AUTH: /opt/satprep/myesxB.auth

System C, prodcution system, with monitoring and backup, snapshots before maintenance required, hosted on ESXi system myesxC, with custom names on ESXi and Icinga server

  • SYSTEM_OWNER: Max Mustermann
  • SYSTEM_PROD: 1
  • SYSTEM_MONITORING: 1
  • SYSTEM_MONITORING_NAME: mysrv
  • SYSTEM_MONITORING_HOST: myicinga
  • SYSTEM_MONITORING_HOST_AUTH: /opt/satprep/myicinga.auth
  • SYSTEM_VIRT_VMNAME: mysrv
  • SYSTEM_VIRT_SNAPSHOT: 1
  • SYSTEM_VIRT_HOST: myesxB
  • SYSTEM_VIRT_HOST_AUTH: /opt/satprep/myesxB.auth
Clone this wiki locally