Skip to content
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

Question: what size does the last column represent? GB? TB? #1

Open
WinstonN opened this issue Nov 9, 2020 · 2 comments
Open

Question: what size does the last column represent? GB? TB? #1

WinstonN opened this issue Nov 9, 2020 · 2 comments

Comments

@WinstonN
Copy link

WinstonN commented Nov 9, 2020

Hi,

Thank you so much for this script, really helpful!
I have a question around the size of the volume

You have

# 1
row['VolumeSize'] * 1024 * 1024 * 1024
# 2
changed * blockSize

The value for VolumeSize is in GB - https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshots.html

volume-size - The size of the volume, in GiB.

My question is, what is the size of that column? Is it based off the block size?

What I want to do, is use the AWS calculator to confirm that the size of my snapshots == the storage I am being charged for, to make sure the numbers match up. And when they do, I want to work out a cost savings, based on snapshot retention time

Thanks again!

@Hummdis
Copy link

Hummdis commented Nov 6, 2023

The size reported is in bytes.

However, there's a problem in the script. On line 18 the blockSize variable is set to 524288, which is 512, but it's 512 KB, not bytes.

According to AWS documentation, an attached EBS volume appears to be a physical hard disk drive containing 512-byte disk sectors. Note that's 512 bytes, not Kilobytes. So, the use of 524288 is incorrect and it should be changed to just 512.

In line 35 that specifically does the changed * blockSize part, it obtains the number of EBS blocks that have changed in the snapshot. Since EBS is a 512-byte block size you need to multiply the number of changed blocks by 512 to get the amount of bytes that have changed.

@asmigar
Copy link

asmigar commented Apr 25, 2024

@Hummdis

The size reported is in bytes.

However, there's a problem in the script. On line 18 the blockSize variable is set to 524288, which is 512, but it's 512 KB, not bytes.

Block size and sector size are two different things. The EBS Snapshots are stored as blocks. And block size is 512KB.

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

No branches or pull requests

3 participants