VolumeTO vol = new VolumeTO(cmd.getVolumeId(),
diskchar.getType(),
pool.getType(), pool.getUuid(), cmd.getDiskCharacteristics().getName(),
pool.getPath(), cmd.getDiskCharacteristics().getName(), cmd.getDiskCharacteristics().getSize(),
null);
return new CreateAnswer(cmd, vol);
} else {
VolumeTO vol = new VolumeTO(cmd.getVolumeId(),
diskchar.getType(),
pool.getType(), pool.getUuid(), cmd.getDiskCharacteristics().getName(),
pool.getPath(), cmd.getDiskCharacteristics().getName(), cmd.getDiskCharacteristics().getSize(), null);
return new CreateAnswer(cmd, vol);
}
} else {
//create data volume
String volumeUuid = "cloud.worker." + UUID.randomUUID().toString();
VolumeTO vol = new VolumeTO(cmd.getVolumeId(),
diskchar.getType(),
pool.getType(), pool.getUuid(), cmd.getDiskCharacteristics().getName(),
pool.getPath(), volumeUuid, cmd.getDiskCharacteristics().getSize(), null);
return new CreateAnswer(cmd, vol);
}
} catch (Exception ex) {
return null;
}
}