core icon indicating copy to clipboard operation
core copied to clipboard

How to remove a volume on a node in Eru

Open jasonjoo2010 opened this issue 4 years ago • 2 comments

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?

jasonjoo2010 avatar Aug 31 '21 12:08 jasonjoo2010

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:

  1. make sure no container is using this volume
  2. set the available bytes of the volume to zero: cli node set --volume /vol:0 will do
  3. delete the volume from meta, using the exactly same command as above: cli node set --volume /vol:0

jschwinger233 avatar Sep 01 '21 03:09 jschwinger233

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:

  1. make sure no container is using this volume
  2. set the available bytes of the volume to zero: cli node set --volume /vol:0 will do
  3. 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?

jasonjoo2010 avatar Sep 01 '21 14:09 jasonjoo2010