Sergey Gotliv has posted comments on this change.
Change subject: backend,webadmin: Enable virtual drive size extension
......................................................................
Patch Set 13: (11 inline comments)
....................................................
File
backend/manager/dbscripts/upgrade/03_03_0190_add_extend_image_size_action_version_map.sql
Line 1: insert into action_version_map (action_type, cluster_minimal_version,
storage_pool_minimal_version) values(1013, '*', '3.3');
Done
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExtendImageSizeCommand.java
Line 41: }
Line 42:
Line 43: @Override
Line 44: protected boolean canDoAction() {
Line 45: return isDiskExists() && isNewSizeValid() && isVMStatusValid();
Done
Line 46: }
Line 47:
Line 48: protected boolean isDiskExists() {
Line 49: if (getImage() == null) {
Line 105:
Line 106: setSucceeded(true);
Line 107: }
Line 108:
Line 109: private void updateRelevantVms() {
Currently floating disks are not supported, I'll add it during the bug fixing -
UI, REST and Backend
Line 110: List<VM> vms = getVmsDiskPluggedTo();
Line 111:
Line 112: for (VM vm : vms) {
Line 113: // All running VMs must be updated that their virtual
disk is grown, otherwise the change will be
Line 111:
Line 112: for (VM vm : vms) {
Line 113: // All running VMs must be updated that their virtual
disk is grown, otherwise the change will be
Line 114: // visible after next restart. If disk is plugged to the
single VM, this step must be executed anyway -
Line 115: // for QCOW disk format it must sync between QCOW header
and volume metadata.
According to the protocol VDSM must promise the sync!!!
Line 116: if (vm.getStatus().isUpOrPaused() || vms.size() == 1) {
Line 117: try {
Line 118: VDSReturnValue ret = extendVmDiskSize(vm,
getParameters().getNewSize());
Line 119: if (!ret.getSucceeded()) {
Line 223: private List<VM> getVmsDiskPluggedTo() {
Line 224: if (vmsDiskPluggedTo == null) {
Line 225: vmsDiskPluggedTo =
getVmDAO().getForDisk(getImage().getId()).get(Boolean.TRUE);
Line 226:
Line 227: if (vmsDiskPluggedTo == null) {
DAO returns a MAP which is not empty, but the we call to get(Boolean.TRUE)
which is potentially can return null. But anyway, I want to be on the safe side.
Line 228: vmsDiskPluggedTo = Collections.emptyList();
Line 229: }
Line 230: }
Line 231: return vmsDiskPluggedTo;
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java
Line 101: } else {
Line 102: try {
Line 103: performDiskUpdate(false);
Line 104: } finally {
Line 105: // by default this command will keep the lock even
after this method is done,
I removed this comment
Line 106: // because the resize is async operation, but if this
is the simple disk update
Line 107: // locks should be freed right after the execution.
Line 108: freeLock();
Line 109: }
Line 122: if (isAtLeastOneVmIsNotDown(vmsDiskPluggedTo) &&
shouldUpdatePropertiesOtherThanSize()) {
Line 123: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN);
Line 124: }
Line 125:
Line 126: if
(!validateCanUpdateDiskInterfaceAndBootable(vmsDiskPluggedTo)) {
Done
Line 127: return false;
Line 128: }
Line 129: }
Line 130:
Line 464: }
Line 465: return false;
Line 466: }
Line 467:
Line 468: private boolean isDiskBecomesShareable(Disk oldDisk, Disk
newDisk) {
Done
Line 469: return newDisk.isShareable() && !oldDisk.isShareable();
Line 470: }
Line 471:
Line 472: private boolean isDiskBecomesNonShareable(Disk oldDisk, Disk
newDisk) {
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
Line 52: momErr(54),
Line 53: replicaErr(55),
Line 54: UpdateDeviceErr(56),
Line 55: hwInfoErr(57),
Line 56: ResizeErr(58),
I will
Line 57: recovery(99),
Line 58: GeneralException(100),
Line 59: StorageException(200),
Line 60: VolumeDoesNotExist(201),
....................................................
File
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/AbstractDiskModel.java
Line 442: boolean isShareableDiskEnabled = (Boolean)
AsyncDataProvider.getConfigValuePreConverted(
Line 443: ConfigurationValues.ShareableDiskEnabled,
datacenter.getcompatibility_version().getValue());
Line 444:
Line 445:
getIsShareable().setChangeProhibitionReason(CONSTANTS.shareableDiskNotSupported());
Line 446: getIsShareable().setIsChangable(isShareableDiskEnabled &&
getVm() != null && getVm().isDown());
Unfortunately, yes. User couldn't update disk properties for running VM, now he
can extend the disk size, but I must prevent updates of other properties in
that case.
Line 447: }
Line 448:
Line 449: private void updateDirectLunDiskEnabled(StoragePool datacenter) {
Line 450: boolean isInternal = (Boolean) getIsInternal().getEntity();
Line 465: getIsShareable().setIsChangable(false);
Line 466: getIsShareable().setEntity(false);
Line 467: }
Line 468: else {
Line 469: getIsShareable().setIsChangable(getVm() != null &&
getVm().isDown());
Same is before.
Line 470: }
Line 471: }
Line 472:
Line 473: private void updateVolumeFormat(VolumeType volumeType,
StorageType storageType) {
--
To view, visit http://gerrit.ovirt.org/14975
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie702348a68a26ac02a01f66aaa1ea42c2c675ebb
Gerrit-PatchSet: 13
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: A Burden <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Cheryn Tan <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: liron aravot <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches