public VolumeTO(Volume volume, StoragePool pool) { this.id = volume.getId(); this.name = volume.getName(); this.path = volume.getPath(); this.size = volume.getSize(); this.type = volume.getVolumeType(); this.storagePoolType = pool.getPoolType(); this.storagePoolUuid = pool.getUuid(); this.mountPoint = volume.getFolder(); this.chainInfo = volume.getChainInfo(); this.chainSize = volume.getVmSnapshotChainSize(); if (volume.getDeviceId() != null) this.deviceId = volume.getDeviceId(); }
chainInfo = that.getChainInfo(); templateId = that.getTemplateId(); deviceId = that.getDeviceId(); format = that.getFormat(); provisioningType = that.getProvisioningType();
public VolumeVO allocateDuplicateVolumeVO(Volume oldVol, Long templateId) { VolumeVO newVol = new VolumeVO(oldVol.getVolumeType(), oldVol.getName(), oldVol.getDataCenterId(), oldVol.getDomainId(), oldVol.getAccountId(), oldVol.getDiskOfferingId(), oldVol.getProvisioningType(), oldVol.getSize(), oldVol.getMinIops(), oldVol.getMaxIops(), oldVol.get_iScsiName()); if (templateId != null) { newVol.setTemplateId(templateId); } else { newVol.setTemplateId(oldVol.getTemplateId()); } newVol.setDeviceId(oldVol.getDeviceId()); newVol.setInstanceId(oldVol.getInstanceId()); newVol.setRecreatable(oldVol.isRecreatable()); newVol.setFormat(oldVol.getFormat()); return _volsDao.persist(newVol); }
} else { DataTO volTO = volFactory.getVolume(volume.getId()).getTO(); DiskTO disk = new DiskTO(volTO, volume.getDeviceId(), volume.getPath(), volume.getVolumeType());
_volsDao.attachVolume(newVol.getId(), vmId, newVol.getDeviceId());
DiskTO disk = storageMgr.getDiskWithThrottling(volTO, vol.getVolumeType(), vol.getDeviceId(), vol.getPath(), vm.getServiceOfferingId(), vol.getDiskOfferingId()); DataStore dataStore = dataStoreMgr.getDataStore(vol.getPoolId(), DataStoreRole.Primary);
DiskTO disk = new DiskTO(volTO, volume.getDeviceId(), volume.getPath(), volume.getVolumeType());