def remove(env): """Delete a vlmc Image """ name = env.get("name") sys.stderr.write("Deleting '%s'\n" % name) vlmc.remove(name=name) return 0
rf = [getrandomfile(RANDOMSIZE)] write_data(tmpvolume, mntdir, rf) archipelago.restart(user=True) read_data(tmpvolume, mntdir, rf) #snapshot snapname = gettempname(prefix="snapshot") print "Snapshot ", tmpvolume, "to", snapname snap = vlmc.snapshot(name=tmpvolume, snap_name=snapname) clonedvolume = gettempname() print "Cloning ", snapname, "to", clonedvolume test_create(clonedvolume, snap=snapname) except Exception as e: print e vlmc.remove(name=tmpvolume) raise e #create clone volume from snapshot try: rf1 = [getrandomfile(RANDOMSIZE)] #write new data to old volume write_data(tmpvolume, mntdir, rf1) #read new data from old volume read_data(tmpvolume, mntdir, rf1) #read old data from new volume read_data(clonedvolume, mntdir, rf) rf2 = [getrandomfile(RANDOMSIZE)] #write new data2 to snapshot write_data(clonedvolume, mntdir, rf2)
rf = [getrandomfile(RANDOMSIZE)] write_data(tmpvolume, mntdir, rf) archipelago.restart(user=True) read_data(tmpvolume, mntdir, rf) #snapshot snapname=gettempname(prefix="snapshot") print "Snapshot ", tmpvolume, "to", snapname snap = vlmc.snapshot(name=tmpvolume, snap_name=snapname) clonedvolume=gettempname() print "Cloning ", snapname, "to", clonedvolume test_create(clonedvolume, snap=snapname) except Exception as e: print e vlmc.remove(name=tmpvolume) raise e #create clone volume from snapshot try: rf1 = [getrandomfile(RANDOMSIZE)] #write new data to old volume write_data(tmpvolume, mntdir, rf1) #read new data from old volume read_data(tmpvolume, mntdir, rf1) #read old data from new volume read_data(clonedvolume, mntdir, rf) rf2 = [getrandomfile(RANDOMSIZE)] #write new data2 to snapshot write_data(clonedvolume, mntdir, rf2)