• Leigh Stoller's avatar
    New script, clone_image to simplify create/snapshot from a node. · b01c991d
    Leigh Stoller authored
    clone_image is a wrapper around newimageid_ez and create_image, that
    simplifies the most common operation; creating a new imageid derived
    from the image/os that is currently running in the node, and then
    taking a snapshot of the node. So for example, if node pcXXX is
    running image FREEBSD, and you want to create a custom image from that
    node, all you need to do:
    
    	boss> clone_image myfreebsd pcXXX
    
    which will create the new descriptor, deriving everything from the
    FREEBSD image on the node, and then take a snapshot from pcXXX. If
    the descriptor already exists, just take the snapshot.
    
    So what if you do:
    
    	boss> clone_image FREEBSD pcXXX
    
    well, the image is always looked up in the project the node is
    currently attached to, so in fact a new descriptor is created in that
    project, and you do not actually overwrite an image from some other
    project. 
    
    I've added some locking to images to prevent concurrent snapshots.
    This seemed like a good idea since this script is going to be used
    from the ProtoGeni interface. More on this in another commit.
    b01c991d
295 403 Bytes