-
Notifications
You must be signed in to change notification settings - Fork 30
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
Move swapfile to data volume (/var/lib/scylla) #492
Comments
It's not a good idea, wasting fast+expensive NVMe space. Maybe we can add an EBS volume to the AMI. |
I asked bard, it said this: To configure an AMI to create an EBS volume when launched as an instance, you can use block device mappings. Block device mappings specify how block devices are mapped to an instance when it launches. You can use block device mappings to attach EBS volumes to an instance at launch, and you can also use them to configure the instance's root volume. To attach an EBS volume to an instance at launch, you need to create a block device mapping that specifies the following information:
To configure the instance's root volume, you need to create a block device mapping that specifies the following information:
Once you have created the block device mappings for the EBS volumes that you want to attach to the instance, you can create the AMI. To create an AMI from an instance, you can use the following methods:
Once the AMI has been created, you can launch it as an instance. When the instance launches, the EBS volumes that you specified in the block device mappings will be attached to the instance. |
bard is nice but, the issue is that now you need to teach whom is using the image, that he need todo something else the whole reason it was done in build time, was to save time and complexity for cloud deployment we can't take a step back, without syncing it with whom is depending on it. |
The idea is to configure the AMI to do it, if it's possible.
|
Bard: To create an AMI that creates a new EBS volume and attaches to it, you can use a combination of user data and cloud-init to automate the process. Here's a general outline of the steps involved:
Here's an example of a user data script that uses the AWS CLI to create a new EBS volume of 100GB and attach it to the instance: #!/bin/bash
# Set the AWS region
aws_region=us-east-1
# Create a new EBS volume of 100GB
aws ec2 create-volume --volume-type gp2 --size 100 --region $aws_region > volume.json
# Extract the volume ID from the JSON output
volume_id=$(cat volume.json | jq -r '.VolumeId')
# Attach the EBS volume to the instance
aws ec2 attach-volume --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --volume-id $volume_id --region $aws_region
# Format and mount the EBS volume
mkfs.ext4 /dev/xvdf
mount /dev/xvdf /mnt/ebs To create an AMI from the instance, you can use the AWS CLI or the Amazon EC2 console. Once the AMI is created, you can launch new instances from it and the EBS volume will be automatically attached to each instance. |
I think bard is crap |
but, we can certainly create a swap volume in cloud-init on the first boot. |
I wonder how long until we roll over, and move it back to build time to speed things up :) |
Why does the root disk need to change? |
Where is the swap now in our images ? |
We can add additional EBS volume with following change on packer configuration file:
With the configuration file, machine-image will have additional disk by default. |
How is it different from sizing the root disk ? both would be saved and we go back to the sizing, but you'll have two snapshots ? or I'm missing something |
I don't understand why we should calculate the swap based on any disk size. Based on 069318b , there is a simple calculation to the relevant size of the swap, the max value should be 16Gb, how long does it take to create it during first boot as @avikivity suggested? |
Closing, since using the data volume for swap seems not good idea, as @avikivity commented on the thread. |
Related with #491, we want to reduce the image size, but if we do that we will not have enough disk space for swapfile.
To fix the problem, we need to move swapfile to the data volume (/var/lib/scylla) to avoid running out disk space of rootfs.
see: #491 (comment)
The text was updated successfully, but these errors were encountered: