Skip to content

Commit

Permalink
core: add sd_id to detachManagedBlockVolume
Browse files Browse the repository at this point in the history
Since multiple volumes with the same id can be attached to the same host
(live storage migration for example), we now send the sd_id as well to
be able to distinguish between them.

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
  • Loading branch information
bennyz committed Jun 2, 2022
1 parent ab71651 commit 6fcc5e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private VDSReturnValue detachVolume() {
AttachManagedBlockStorageVolumeVDSCommandParameters params =
new AttachManagedBlockStorageVolumeVDSCommandParameters(vds);
params.setVolumeId(getParameters().getDiskId());
params.setStorageDomainId(getParameters().getStorageDomainId());
return runVdsCommand(VDSCommandType.DetachManagedBlockStorageVolume, params);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2643,10 +2643,11 @@ public DeviceInfoReturn attachManagedBlockStorageVolume(Guid volumeId, Guid sdUU
}

@Override
public StatusOnlyReturn detachManagedBlockStorageVolume(Guid volumeId) {
public StatusOnlyReturn detachManagedBlockStorageVolume(Guid volumeId, Guid sdUUID) {
JsonRpcRequest request =
new RequestBuilder("ManagedVolume.detach_volume")
.withParameter("vol_id", volumeId.toString())
.withParameter("sd_id", sdUUID.toString())
.build();
Map<String, Object> response = new FutureMap(this.client, request);
return new StatusOnlyReturn(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public DetachManagedBlockStorageVolumeVDSCommand(P parameters) {

@Override
protected void executeVdsBrokerCommand() {
status = getBroker().detachManagedBlockStorageVolume(getParameters().getVolumeId());
status = getBroker().detachManagedBlockStorageVolume(getParameters().getVolumeId(),
getParameters().getStorageDomainId());
proceedProxyReturnValue();
setReturnValue(status);
}
Expand Down

0 comments on commit 6fcc5e7

Please sign in to comment.