Merge release branch 4.13 to master

* 4.13:
  Added zone check for attach iso (#3755)
  config: add isdynamic flag in configuration response (#3729)
  filter hosts to query on zone wide storage (#3733)
  convert protocal names to be found as labels (#3747)
  Once again allow a VM to be on multiple networks from VPCs (#3754)
  create template from snapshot regression (partly reverted) (#3767)
This commit is contained in:
Daan Hoogland 2019-12-23 17:20:44 +01:00
commit 06e1212e22

View File

@ -1187,6 +1187,12 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
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.