Skip to content
Merged
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 @@ -1187,6 +1187,12 @@ public boolean attachIso(long isoId, long vmId) {
throw new InvalidParameterValueException("Unable to find an ISO with id " + isoId);
}

long dcId = vm.getDataCenterId();
VMTemplateZoneVO exists = _tmpltZoneDao.findByZoneTemplate(dcId, isoId);
if (null == exists) {
throw new InvalidParameterValueException("ISO is not available in the zone the VM is in.");
}

// check permissions
// check if caller has access to VM and ISO
// and also check if the VM's owner has access to the ISO.
Expand Down