diff options
Diffstat (limited to 'rumba/testbeds/qemu.py')
-rw-r--r-- | rumba/testbeds/qemu.py | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py index 73a4f14..7255b3c 100644 --- a/rumba/testbeds/qemu.py +++ b/rumba/testbeds/qemu.py @@ -180,14 +180,14 @@ class Testbed(mod.Testbed): boot_batch_size = max(1, multiprocessing.cpu_count() // 2) booting_budget = boot_batch_size - boot_backoff = 12 + boot_backoff = 12 # in seconds base_port = 2222 - vm_memory = 164 + vm_memory = 164 # in megabytes vm_frontend = 'virtio-net-pci' vmid = 1 - for node in experiment.nodes: # type: mod.Node + for node in experiment.nodes: name = node.name vm = self.vms.setdefault(name, {'vm': node, 'ports': []}) fwdp = base_port + vmid @@ -195,7 +195,8 @@ class Testbed(mod.Testbed): mac = '00:0a:0a:0a:%02x:%02x' % (vmid, 99) vm['ssh'] = fwdp vm['id'] = vmid - node.full_name = "127.0.0.1:%s" % fwdp + node.ssh_config.hostname = "localhost" + node.ssh_config.port = fwdp vars_dict = {'fwdp': fwdp, 'id': vmid, 'mac': mac, 'bzimage': self.bzimage, @@ -243,8 +244,10 @@ class Testbed(mod.Testbed): booting_budget -= 1 if booting_budget <= 0: - print('Sleeping for %s seconds to give ' - 'the machines time to boot up.' % boot_backoff) + + print('Sleeping %s secs waiting ' + 'for the VMs to boot' % boot_backoff) + time.sleep(boot_backoff) booting_budget = boot_batch_size @@ -256,6 +259,14 @@ class Testbed(mod.Testbed): vmid += 1 + # Wait for the last batch of VMs to start + if booting_budget < boot_backoff: + tsleep = boot_backoff * (boot_batch_size - booting_budget) / \ + boot_batch_size + print('Sleeping %s secs waiting for the last VMs to boot' % tsleep) + time.sleep(tsleep) + + def swap_out(self, experiment): """ :rtype str |