mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug CS-14833: if iso is xen/vmware tools, attach it to vm; status CS-14833: resolved fixed
This commit is contained in:
parent
d39e4dc611
commit
403addc59d
@ -821,11 +821,26 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
|
||||
|
||||
protected VDI mount(Connection conn, String vmName, VolumeTO volume) throws XmlRpcException, XenAPIException {
|
||||
if (volume.getType() == Volume.Type.ISO) {
|
||||
String isopath = volume.getPath();
|
||||
if (isopath == null) {
|
||||
return null;
|
||||
}
|
||||
if (isopath.startsWith("xs-tools")) {
|
||||
try {
|
||||
Set<VDI> vdis = VDI.getByNameLabel(conn, isopath);
|
||||
if (vdis.isEmpty()) {
|
||||
throw new CloudRuntimeException("Could not find ISO with URL: " + isopath);
|
||||
}
|
||||
return vdis.iterator().next();
|
||||
|
||||
String isopath = volume.getPath();
|
||||
if (isopath == null) {
|
||||
return null;
|
||||
}
|
||||
} catch (XenAPIException e) {
|
||||
throw new CloudRuntimeException("Unable to get pv iso: " + isopath + " due to " + e.toString());
|
||||
} catch (Exception e) {
|
||||
throw new CloudRuntimeException("Unable to get pv iso: " + isopath + " due to " + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int index = isopath.lastIndexOf("/");
|
||||
|
||||
String mountpoint = isopath.substring(0, index);
|
||||
|
||||
@ -2549,11 +2549,15 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
||||
|
||||
Pair<String, String> isoPathPair = _storageMgr.getAbsoluteIsoPath(template.getId(), vm.getDataCenterIdToDeployIn());
|
||||
|
||||
if (isoPathPair == null) {
|
||||
s_logger.warn("Couldn't get absolute iso path");
|
||||
return false;
|
||||
if (template.getTemplateType() == TemplateType.PERHOST) {
|
||||
isoPath = template.getName();
|
||||
} else {
|
||||
isoPath = isoPathPair.first();
|
||||
if (isoPathPair == null) {
|
||||
s_logger.warn("Couldn't get absolute iso path");
|
||||
return false;
|
||||
} else {
|
||||
isoPath = isoPathPair.first();
|
||||
}
|
||||
}
|
||||
|
||||
if (template.isBootable()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user