0
votes

I'm relatively new to AWS. I hope i'm posting this questions in the right forum, if not, pls suggest where do i post it.

Question

I have an Instance store EC2 instance with Windows OS.

There are plenty of drives/volumes on the server. Is there a way i can know which of these volumes are EBS and which one is instance store. Any suggestions or scripts will be highly appreciated.

Thanks.

2

2 Answers

0
votes

In windows server. C:/ Drive is the instance store and the rest of the other are EBS volume.

You can use boto3 to find all the Ebs volume attached to an instance. Here is an example which will give you all the ebs volume attached to all the running instance in a region.

import boto3


session = boto3.Session(profile_name='Your_profile_name')
ec2 = session.resource('ec2')
for instance in ec2.instances.all():
    if(instance.state['Name'] == "running"):
        print(instance.id, instance.block_device_mappings)

You will get output something like this

('i-015XXXXXXXXXX', [{u'DeviceName': '/dev/xvda', u'Ebs': {u'Status': 'attached', u'DeleteOnTermination': True, u'VolumeId': 'vol-03cXXXXXXXXX', u'AttachTime': datetime.datetime(2019, 4, 17, 12, 23, 46, tzinfo=tzutc())}}])
('i-075XXXXXXXXXX', [{u'DeviceName': '/dev/xvda', u'Ebs': {u'Status': 'attached', u'DeleteOnTermination': True, u'VolumeId': 'vol-014XXXXXXXXX', u'AttachTime': datetime.datetime(2019, 4, 21, 10, 1, 40, tzinfo=tzutc())}}])
0
votes

I think that Instance Store normally appears as X:, Y: and Z:.