vol = _volsDao.persist(vol);
if (vm instanceof UserVm) {
Long offeringId = null;
if (offering.getType() == DiskOfferingVO.Type.Disk) {
offeringId = offering.getId();
<BUG>}
UsageEventVO usageEvent = new UsageEventVO(
EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(),
vol.getDataCenterId(), vol.getId(), vol.getName(),
offeringId, template.getId(), vol.getSize());
_usageEventDao.persist(usageEvent);</BUG>
_resourceLimitMgr.incrementResourceCount(vm.getAccountId(),

vol = _volsDao.persist(vol);
if (vm instanceof UserVm) {
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), offering.getId(), null, size,
Volume.class.getName(), vol.getUuid());
_resourceLimitMgr.incrementResourceCount(vm.getAccountId(),
