-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support multiple volumes on virtual machines #2287
Open
adityahase
wants to merge
54
commits into
master
Choose a base branch
from
feat-server-volumes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are argument for the `mount` command (and /etc/fstab)
/var/lib/mysql and /etc/mysql for Database Server /home/frappe/benches for Server
…used If MariaDB gets activated, then mounts will be activated as well. If one of the mounts fails to activate, MariaDB will not be started. If one of the mounts is explicitly stopped (or restarted), MariaDB will be stopped (or restarted). If one of the mounts are stopped, MariaDB will be stopped too. The mounts strictly have to be in active state for MariaDB to also be in active state. Reference: https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#BindsTo=
The mount strictly has to be in active state for Docker to also be in active state. Reference: https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#BindsTo=
Converts None to "" instead of "None"
EBS Volume ID will change when we start a new machine from an image. Since the ID is only known after the machine boots. We have to wait for the machine to boot and then run a playbook to reconfigure the mount. But UUID remains the same. so, we don't need to change anything in the new machine at the first boot. Reference: https://aws.amazon.com/blogs/compute/how-to-mount-linux-volume-and-keep-mount-point-consistency/
/home/frappe/benches directory needs to be owned by frappe There are other ways of doing this. But this seems useful.
mysql user isn't created when volumes are mounted
So, create the source mount point with the correct permissions and ownership
TODO: Guess platform from instance_type
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2287 +/- ##
==========================================
- Coverage 39.80% 39.41% -0.39%
==========================================
Files 373 377 +4
Lines 28380 28765 +385
==========================================
+ Hits 11296 11339 +43
- Misses 17084 17426 +342 ☔ View full report in Codecov by Sentry. |
VirtualMachineImage.platform should match ServerPlan.platform
arm64 plans should pick arm64 base images x86_64 plans should pick x86_64 base images
We need to do a few things. - Find the UUID of the root partition. - Update fstab to use to old root partition as data partition. Update UUID. - Drop UEFI and cloudimg-rootfs labels. So the new VM doesn't mount these partitions. - Drop the extra partitions after migration is complete.
We'll need this to determine which partitions need relabelling
We'll need this to determine which partitions need relabelling
Do best effort match based on the previous plan
This prevents these partitions from being mounted in the machine Also update fstab we can boot the old machine in case the migration fails
The new machine image still refers to the UUID of the blank data volume. Remount and update fstab.
Cloud-init (updates host keys and) restarts SSH on first boot. Sometimes this makes the machine unreachable.
Use x86_64 plans as the default option while creating new servers TODO: Make this a configuration
This was partially implemented
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, we place all the data on a single EBS volume (root partition). This feature supports placing some of the data on another volume.
So that, we can
By default, the "movable" data is placed on a separate volume
Instead of directly mounting the filesystem to /var/lib/mysql. We mount it to /opt/volumes/mariadb and then bind mount /opt/volumes/mariadb/var/lib/mysql to /var/lib/mysql. This gets us two things.
To guarantee mount point consistency we use UUID in fstab (instead of device name or volume IDs). Data volumes are unpartitioned and ext4 formatted.
This feature is built to make moving from Intel -> ARM easy.