This video could not play here.
It may be members-only, region-restricted, or unavailable in embedded players.
DevOps | AWS | Initializing EBS Volumes
EBS provides persistent block storage to be used with EC2 instances. EBS volumes are network attached to the physical server hosting the EC2 instance. Initialization ( also know as pre-warming) is the process to read out all the blocks of the volumes, so EBS volumes can achieve its maximum performance.
Why EBS Volume Initialization for the Volumes restored from Snapshots. ?
When a volume is created form the snapshot , the data is not immediately available on the volumes but it gets synced the AWS S3. When Instance request accesses data that hasn't yet been loaded, the volume immediately downloads the requested data from Amazon S3, and continues loading the rest of the data in the background. As Data gets read from the s3 , volume does not performs with its full capabilities. When we initialize the drives all data is read from the s3 and available to the volume itself and no performance penalty.
Shell Script to initializing the EBS volumes. # cat aws_ebs_initialize.sh #!/bin/bash DEVICES=“$@” for DEVICE in ${DEVICES[@]};do if [[ ! -b /dev/${DEVICE} ]]; then echo "Invalid Disk. Please retry the command with valid disk" continue elif ps -eaf | grep "dd if=/dev/${DEVICE}" | grep -v grep; then echo "Disk initializing already in progress" continue fi dd if=/dev/${DEVICE} of=/dev/null bs=1M && ( echo "Disk $DEVICE Initialization completed.”| tee -a /var/log/messages ) & done #
Watch the video for details.