Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm
}

VMInstanceVO vo = _vmDao.findById(vm.getId());
assert vo != null : "Where ths nic " + nic.getId() + " going???";
if (vo.getLastHostId() == null) {
nic.setMacAddress(dest.getHost().getPrivateMacAddress());
NicVO nicVo = _nicDao.findById(nic.getId());
assert vo != null : "Where ths nic " + nic.getId() + " going???";
nicVo.setMacAddress(nic.getMacAddress());
_nicDao.update(nicVo.getId(), nicVo);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ public void deleteAsync(DataStore dataStore, DataObject dataObject, AsyncComplet
long usedBytes = storagePool.getUsedBytes();
long capacityIops = storagePool.getCapacityIops();

usedBytes -= volumeInfo != null ? volumeInfo.getSize() : 0;
capacityIops += volumeInfo != null ? volumeInfo.getMaxIops() : 0;
usedBytes -= volumeInfo.getSize();
capacityIops += volumeInfo.getMaxIops();

storagePool.setUsedBytes(usedBytes < 0 ? 0 : usedBytes);
storagePool.setCapacityIops(capacityIops < 0 ? 0 : capacityIops);
Expand Down