core
core copied to clipboard
How to remove a volume on a node in Eru
Background
Sometimes, we added wrong volume to a node. But we only can change the capacity or resource declaration using eru-cli node set but cannot remove it completely. So things could become:
init_volume:
/data: 945966546944
/data1: 945966546944
/data2: 945966546944
/data3: 945966546944
/data4: 945966546944
/data5: 945966546944
/data6: 945966546944
/data7: 945966546944
/data8: 0
memory: 719407022080
memory_used: 380104605696
name: -------
podname: --------
storage: 2516850835456
storage_used: 5050881540096
volume:
/data: 945966546944
/data1: 224412041216
/data2: 224412041216
/data3: 224412041216
/data4: 224412041216
/data5: 224412041216
/data6: 224412041216
/data7: 224412041216
/data8: 0
volume_used: 5050881540096
Expectation
Able to remove it completely. So is there a way to do so?
The short answer is: set it again, for your case, eru-cli node set --volume /data8:0 $nodename
Due to current implementation, to discard an unused volume, you must follow these steps:
- make sure no container is using this volume
- set the available bytes of the volume to zero:
cli node set --volume /vol:0will do - delete the volume from meta, using the exactly same command as above:
cli node set --volume /vol:0
The short answer is: set it again, for your case,
eru-cli node set --volume /data8:0 $nodenameDue to current implementation, to discard an unused volume, you must follow these steps:
- make sure no container is using this volume
- set the available bytes of the volume to zero:
cli node set --volume /vol:0will do- delete the volume from meta, using the exactly same command as above:
cli node set --volume /vol:0
Yeah I have tried both set to zero nor set it using negative size to zero by delta. But the result didn't change.
So you mean I should execute the set to zero twice and it will work as what I expect?