Revision 808
Added by Borja Sotomayor almost 14 years ago
imagetransfer.py | ||
---|---|---|
129 | 129 |
def estimate_migration_time(self, lease): |
130 | 130 |
migration = get_config().get("migration") |
131 | 131 |
if migration == constants.MIGRATE_YES: |
132 |
bandwidth = self.resourcepool.info.get_migration_bandwidth() |
|
132 | 133 |
vmrr = lease.get_last_vmrr() |
133 |
images_in_pnode = dict([(pnode,0) for pnode in set(vmrr.nodes.values())]) |
|
134 |
for (vnode,pnode) in vmrr.nodes.items():
|
|
135 |
images_in_pnode[pnode] += lease.software.image_size
|
|
136 |
max_to_transfer = max(images_in_pnode.values()) * 2 # Kludge
|
|
137 |
bandwidth = self.resourcepool.info.get_migration_bandwidth()
|
|
138 |
return estimate_transfer_time(max_to_transfer, bandwidth)
|
|
134 |
#images_in_pnode = dict([(pnode,0) for pnode in set(vmrr.nodes.values())])
|
|
135 |
transfer_time = estimate_transfer_time(lease.software.image_size, bandwidth) * len (vmrr.nodes)
|
|
136 |
#for (vnode,pnode) in vmrr.nodes.items():
|
|
137 |
# images_in_pnode[pnode] += lease.software.image_size
|
|
138 |
#max_to_transfer = max(images_in_pnode.values()) * 2 # Kludge
|
|
139 |
return transfer_time
|
|
139 | 140 |
elif migration == constants.MIGRATE_YES_NOTRANSFER: |
140 | 141 |
return TimeDelta(seconds=0) |
141 | 142 |
|
Also available in: Unified diff
- In some cases an error was carried over in the estimated migration times that would result in the sanity check failing.
- Migration bandwidth was hardcoded; now taken from configuration file.