Ignore:
Timestamp:
Mar 30, 2008, 4:28:10 AM (16 years ago)
Author:
price
Message:

expose cloning autoinstaller in web interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-www/code/controls.py

    r265 r340  
    6969        lvcreate(machine, disk)
    7070
     71def lvcopy(machine_orig_name, machine, rootpw):
     72    """Copy a golden image onto a machine's disk"""
     73    remctl('web', 'lvcopy', machine_orig_name, machine.name, rootpw)
     74
    7175def bootMachine(machine, cdtype):
    7276    """Boot a machine with a given boot CD.
     
    96100    remctl('web', 'unregister', machine.name)
    97101
    98 def createVm(owner, contact, name, memory, disk_size, is_hvm, cdrom):
     102def createVm(owner, contact, name, memory, disk_size, is_hvm, cdrom, clone_from):
    99103    """Create a VM and put it in the database"""
    100104    # put stuff in the table
     
    137141    registerMachine(machine)
    138142    makeDisks(machine)
     143    if clone_from:
     144        lvcopy(clone_from, machine, 'password')
    139145    # tell it to boot with cdrom
    140146    bootMachine(machine, cdrom)
Note: See TracChangeset for help on using the changeset viewer.