Introduction

"ROOT volume detach" feature enables support for following use cases:

  1. Replace current ROOT volume with the new one for  existing vm.
  2. Case when ROOT volume of vm1 gets corrupted, and you want to attach it to vm2 to run the recovery utils on it. With current CS implemntation, you have to perform several steps - create snapshot of vm1's volume, create volume from snapshot, attach volume to the vm2. New implementation will merge it all to one step.

With the planned implementation, once the ROOT volume is detached, it can be attached to any existing vm (with respect to Admin/Domain/Physical resources limitations), either as a DataDisk or a Root disk. 

Amazon EC2 already has this functionality in place, so I think CS would only benefit from having it. 

References

JIRA ticket: 

 

Architecture and design description

Changes has to be done on the Services layer to attach/detach methods.

  1. Volume Detach changes

VolumeApiServiceImpl class, orchestrateDetachVolumeFromVM method:

VolumeDaoImpl class, detachVolume method:

 

2. Volume attach changes

VolumeApiServiceImpl class, attachVolumeToVM method:

 

VolumeDaoImpl class, attachVolume method:

Web API changes

UI changes

 

Feature limitations for 4.5 release