return new Answer(cmd, false, errorMsg);
}
protected Answer execute(CreateVolumeFromBaseImageCommand cmd) {
VolumeTO volume = cmd.getVolume();
ImageOnPrimaryDataStoreTO baseImage = cmd.getImage();
Connection conn = hypervisorResource.getConnection();
try {
VDI baseVdi = VDI.getByUuid(conn, baseImage.getPathOnPrimaryDataStore());
VDI newVol = baseVdi.createClone(conn, new HashMap<String, String>());
newVol.setNameLabel(conn, volume.getName());
return new CreateObjectAnswer(cmd, newVol.getUuid(conn), newVol.getVirtualSize(conn));
} catch (BadServerResponse e) {
return new Answer(cmd, false, e.toString());