Skip to content

Conversation

@pablomendezroyo
Copy link
Contributor

@pablomendezroyo pablomendezroyo commented Oct 11, 2021

Expand the disk space of the dappnode with LVM

screenshots
image
image
image

@pablomendezroyo pablomendezroyo marked this pull request as draft October 11, 2021 07:58
@pablomendezroyo pablomendezroyo self-assigned this Oct 11, 2021
@pablomendezroyo pablomendezroyo linked an issue Oct 11, 2021 that may be closed by this pull request
@github-actions github-actions bot temporarily deployed to commit October 11, 2021 08:01 Inactive
@github-actions
Copy link

github-actions bot commented Oct 11, 2021

@github-actions
Copy link

github-actions bot commented Oct 11, 2021

DAppNode bot has built and pinned the release to an IPFS node, for commit: b545909

This is a development version and should only be installed for testing purposes, install link

/ipfs/QmUxNXXTMTTwCr37YDusrhTKu5JuVZSahpY4xXpA3UTPAU

(by dappnodebot/build-action)

@github-actions github-actions bot temporarily deployed to commit October 11, 2021 10:30 Inactive
@github-actions github-actions bot temporarily deployed to commit October 11, 2021 15:21 Inactive
@github-actions github-actions bot temporarily deployed to commit October 13, 2021 09:59 Inactive
@pablomendezroyo pablomendezroyo marked this pull request as ready for review October 13, 2021 10:40
@github-actions github-actions bot temporarily deployed to commit October 13, 2021 10:42 Inactive
@dapplion
Copy link
Contributor

When going into the Hardware tab the URL ends with undefined

https://<>/#/system/undefined

`-- --extend ${disk} ${volumeGroup} ${logicalVolume}`
);
},
{ promise: true, maxAge: 2000 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function have to be dealt with extreme care, doing memoize here is not the best strategy. Questions:

  • What happens if two extend calls are run at once? What's the damage if that happens? Then there must be a much stronger guarantee that --extend calls will run strictly sequential
  • How long does this call take on average?
  • Can and --extend call survive the DAPPMANAGER restarting? Can the disk end-up in an unknown state if the DAPPMANAGER dies during the execution of an --extend call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • What happens if two extend calls are run at once? What's the damage if that happens? Then there must be a much stronger guarantee that --extend calls will run strictly sequential

Gotcha, will implement it

  • How long does this call take on average?

on a dappnode extreme less than 5 s, on a less powerful dappnode may take a bit more

  • Can and --extend call survive the DAPPMANAGER restarting? Can the disk end-up in an unknown state if the DAPPMANAGER dies during the execution of an --extend call?

Since the dappmanager container starts the process of expanding the disk, if it dies then the process will die as well so It cannot survive the DAPPMANAGER restart.
The extension is composed mainly by 4 steps:

 # 2. Create pv
  pvcreate "/dev/${1}"
  # 3. Extend vg
  vgextend "$2" "/dev/${1}"
  # 4. Extend lv
  lvextend -l +100%FREE "/dev/${2}/${3}"
  # 5. Resize fs
  resize2fs -p "/dev/${2}/${3}"

Maybe having a rollback function called if any of these steps fails to leave everything as it was before starting the extension?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do blue checkmark for each of those steps? It would make support much easier if users know where it fails.

@dapplion
Copy link
Contributor

dapplion commented Oct 13, 2021

Nice work overall! The current process requires the user to take some decisions:

  • Choose the hard-disk
  • Choose the volume group
  • Choose the logical volume

Is a regular user able to take this decisions without external help? The UI should link to well written resources in the docs AND have a minimal guide of why each of the option should be chosen. Also the DAPPMANAGER should try to guess a sane default in case the user just goes "next", "next", "next"

@3alpha
Copy link
Member

3alpha commented Oct 13, 2021

We need to really think over warning messages we show users before doing this since this is critical operation.

Also, there is still pending research to be done. This comes to mind:

  • What happens if you add slower drive?
  • What happens if you disconnect drive before releasing it from the LVM?

@3alpha
Copy link
Member

3alpha commented Oct 13, 2021

Is a regular user able to take this decisions without external help? The UI should link to well written resources in the docs AND have a minimal guide of why each of the option should be chosen. Also the DAPPMANAGER should try to guess a sane default in case the user just goes "next", "next", "next"

We definitely need docs which would describe every option and advise them of "default" ones, but I would disallow users going "next", "next" and make them fill out fields themselves because that will make them think.

@pablomendezroyo
Copy link
Contributor Author

We need to really think over warning messages we show users before doing this since this is critical operation.
Totally agree, will add warning messages

Also, there is still pending research to be done. This comes to mind:

  • What happens if you add slower drive?
    slower drive than what?
  • What happens if you disconnect drive before releasing it from the LVM?
    Not sure about this and afraid of testing it

@pablomendezroyo
Copy link
Contributor Author

Is a regular user able to take this decisions without external help? The UI should link to well written resources in the docs AND have a minimal guide of why each of the option should be chosen. Also the DAPPMANAGER should try to guess a sane default in case the user just goes "next", "next", "next"

We definitely need docs which would describe every option and advise them of "default" ones, but I would disallow users going "next", "next" and make them fill out fields themselves because that will make them think.

I was thinking on writting a pretty and well documented how-to in the forum explaining how to upgrade the disk space with screenshots and pictures

@pablomendezroyo
Copy link
Contributor Author

Nice work overall! The current process requires the user to take some decisions:

  • Choose the hard-disk
  • Choose the volume group
  • Choose the logical volume

Is a regular user able to take this decisions without external help? The UI should link to well written resources in the docs AND have a minimal guide of why each of the option should be chosen. Also the DAPPMANAGER should try to guess a sane default in case the user just goes "next", "next", "next"

I would say it is really dangerous to assume which hard disk, volume group and logical volume to use since we dont know the host architecture, except for dappnodes that was purchased from our shop.

We could easily add more info so users can recognize which one to choose:

  • For choosing hard disk: free and used disk space
  • For choosing volume groups: the vg_size and vg_free
  • For logical volumes: the lv_size and to which volume group belongs to

@github-actions github-actions bot temporarily deployed to commit October 14, 2021 11:18 Inactive
@github-actions github-actions bot temporarily deployed to commit October 18, 2021 11:44 Inactive
@github-actions github-actions bot temporarily deployed to commit October 26, 2021 07:53 Inactive
@pablomendezroyo pablomendezroyo changed the title LVM: expand/reduce host disk space LVM: expand/reduce host filesystem space Oct 26, 2021
@dapplion
Copy link
Contributor

The current flow looks great!

  • I would make the "Manual expansion" of variant outline-secondary so unaware users go to automatic expansion naturally
  • The URL issue is still there #/system/undefined
  • file conflicts

@github-actions github-actions bot temporarily deployed to commit November 8, 2021 13:56 Inactive
@github-actions github-actions bot temporarily deployed to commit November 8, 2021 14:09 Inactive
@github-actions github-actions bot temporarily deployed to commit November 8, 2021 14:16 Inactive
@pablomendezroyo pablomendezroyo merged commit 19e7738 into master Nov 8, 2021
@pablomendezroyo pablomendezroyo deleted the pablo/lvm branch November 8, 2021 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add disk space through LVM

4 participants