Is it possible to tell if an EC2 instance disk is full without logging in?

0

1

I can no longer log in to my EC2 instance running the bitnami node stack. Is there some way of ascertaining whether the disk is full (EBS) without being able to log in?

Also if anyone knows a browser on Mac which will actually work with the Java in-browser aws console that would be useful! I've tried Chrome, Safari and Firefox.

codecowboy

Posted 2014-02-07T09:21:28.373

Reputation: 465

Answers

2

Short answer: No, you need to connect to the instance to see the disk usage in a file system on an attached EBS volume.

Longer answer: Yes, but probably not in the way that you want.

Explanation: EBS volumes are block devices. Amazon EC2 provides this block device attached over the network and it is the responsibility of the operating system and software running on your instance to add a file system on top of the block device.

EC2 has no visibility into what is stored on the EBS volume at a conceptual level (though it obviously moves bits back and forth).

EC2 does not know what type of file system, if any, is on the EBS volume, much less the amount of space used by files in the file system on the EBS volume.

This means that Amazon EC2 cannot provide an API (how they make available all information) that tells you how much disk is used, so you must log in to the instance to find out.

Now on to some ideas of how it is possible to find out how much of the disk is used without logging in to the instance:

  1. You could install software on the instance that publishes the disk usage to a location outside of the instance, like, say, CloudWatch. You could then query CloudWatch to see how full the disk is on the instance.

  2. You could create an EBS snapshot of the EBS volume, create a new volume from that snapshot, attach the new volume to a different EC2 instance, log in to the second instance, mount the file system, and check how much disk is used. The answer may be slightly out of date as it is based on a point-in-time snapshot of the original volume. This approach could be used if you don't have ssh access to the original instance, but do have API permissions to create snapshots, volumes, attach volumes to instances, and have permission to ssh to a different instance.

If you elaborate on exactly what you are trying to do with some background on the situation, it's possible somebody might be able to provide an even better solution.

[Ignoring the second, unrelated question about Mac browsers, Java, etc. Probably best if you remove it and post it as a separate question.]

Eric Hammond

Posted 2014-02-07T09:21:28.373

Reputation: 286