From 659712c850a5624057c6425e29928ee697de5dea Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Tue, 14 Oct 2008 16:22:14 +0000 Subject: [PATCH] Burnin OpGrowDisk With this patch both the os and the swap disk are grown during burnin. You can pass an increase size of 0 to skip this operation. and: burnin: don't try to grow diskless instances When burnin is run on a diskless instance, it fails when trying GrowDisk, because a non-existant disk cannot be grown. This patch disables the test for that disk template. This is a forward-port of revisions 1181 and 1606 on the 1.2 branch. Original author: ultrotter Reviewed-by: ultrotter --- tools/burnin | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/burnin b/tools/burnin index 69236d54e..ace223339 100755 --- a/tools/burnin +++ b/tools/burnin @@ -129,8 +129,12 @@ class Burner(object): metavar="<OS>") parser.add_option("--os-size", dest="os_size", help="Disk size", default=4 * 1024, type="unit", metavar="<size>") + parser.add_option("--os-growth", dest="sda_growth", help="Disk growth", + default=1024, type="unit", metavar="<size>") parser.add_option("--swap-size", dest="swap_size", help="Swap size", default=4 * 1024, type="unit", metavar="<size>") + parser.add_option("--swap-growth", dest="sdb_growth", help="Swap growth", + default=1024, type="unit", metavar="<size>") parser.add_option("--mem-size", dest="mem_size", help="Memory size", default=128, type="unit", metavar="<size>") parser.add_option("-v", "--verbose", @@ -277,6 +281,17 @@ class Burner(object): if self.opts.parallel: self.ExecJobSet(jobset) + def GrowDisks(self): + """Grow both the os and the swap disks by the requested amount, if any.""" + for instance in self.instances: + for disk in ['sda', 'sdb']: + growth = getattr(self.opts, '%s_growth' % disk) + if growth > 0: + op = opcodes.OpGrowDisk(instance_name=instance, disk=disk, + amount=growth) + Log("- Increase %s's %s disk by %s MB" % (instance, disk, growth)) + self.ExecOp(op) + def ReplaceDisks1D8(self): """Replace disks on primary and secondary for drbd8.""" for instance in self.instances: @@ -454,6 +469,9 @@ class Burner(object): opts.disk_template in constants.DTS_NET_MIRROR) : self.ReplaceDisks2() + if opts.disk_template != constants.DT_DISKLESS: + self.GrowDisks() + if opts.do_failover and opts.disk_template in constants.DTS_NET_MIRROR: self.Failover() -- GitLab