lighting XEN management README[ Updating in the progress…]

These set of scripts used to manage xen dom0s and domUs.

1. Struchture

1.1
File Structure:

DIRs:

bin: Control Center bin files.
plugin-bin: Dom0 Plugin-bin files
libs: System libiraries.
hvs_web_cgi: gathering info of instance & and show them via web server.

FILE:

iamges: standard.img

1.2 Control Introduction.

Control Center
———————————————-
dom0_control.py DOM0_NAME cmd…
domu_comtrol.py DOMU_NAME cmd…
———————————————–
dom0-1 dom0-2 dom0-…. dom0-20
————————————————
-domU1 . . . . . . . . . . .. . . . . . . . . .domUx

———————————————————–

2. Command introduction Client-Plugin

xen_create_instance : create instance on dom0s
xen_delete_instance : remove instance on dom0s
xen_getimg : download standard iamges for instance creation

3. See Also
/var/www/html/hvs
http://10.130.142.155/hvs/xenlist

Cool Command line options parser–Python Optparse

Reference Link: http://www.saltycrane.com/blog/2009/09/python-optparse-example/

#!/usr/bin/env python

from optparse import OptionParser

def main():
parser = OptionParser(usage=”usage: %prog [options] filename”,
version=”%prog 1.0″)
parser.add_option(“-x”, “–xhtml”,
action=”store_true”,
dest=”xhtml_flag”,
default=False,
help=”create a XHTML template instead of HTML”)
parser.add_option(“-c”, “–cssfile”,
action=”store”, # optional because action defaults to “store”
dest=”cssfile”,
default=”style.css”,
help=”CSS file to link”,)
(options, args) = parser.parse_args()

if len(args) != 1:
parser.error(“wrong number of arguments”)

print options
print args

if __name__ == ‘__main__’:
main()

See Also: http://docs.python.org/library/optparse.html
(options, args) = parser.parse_args()
(If you like, you can pass a custom argument list to parse_args(), but that’s rarely necessary: by default it uses sys.argv[1:].)

parse_args() returns two values:

options, an object containing values for all of your options—e.g. if –file takes a single string argument, then options.file will be the filename supplied by the user, or None if the user did not supply that option
args, the list of positional arguments leftover after parsing options
This tutorial section only covers the four most important option attributes: action, type, dest (destination), and help. Of these, action is the most fundamental.