DatastoreMO dsMo = new DatastoreMO(getServiceContext(), morDs);
String datastoreVolumePath = String.format("[%s] %s.vmdk", dsMo.getName(), cmd.getVolumePath());
AttachVolumeAnswer answer = new AttachVolumeAnswer(cmd, cmd.getDeviceId());
if (cmd.getAttach()) {
vmMo.attachDisk(new String[] { datastoreVolumePath }, morDs);
} else {
vmMo.removeAllSnapshots();
vmMo.detachDisk(datastoreVolumePath, false);
}