Skip to content

describe_volume_status

describe_volume_status(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    max_results: Optional[Integer] = None,
    next_token: Optional[String] = None,
    volume_ids: Optional[VolumeIdStringList] = None,
    include_managed_resources: Optional[Boolean] = None,
    dry_run: Optional[Boolean] = None,
    filters: Optional[FilterList] = None,
) -> DescribeVolumeStatusResult

Describes the status of the specified volumes. Volume status provides the result of the checks performed on your volumes to determine events that can impair the performance of your volumes. The performance of a volume can be affected if an issue occurs on the volume's underlying host. If the volume's underlying host experiences a power outage or system issue, after the system is restored, there could be data inconsistencies on the volume. Volume events notify you if this occurs. Volume actions notify you if any action needs to be taken in response to the event.

The DescribeVolumeStatus operation provides the following information about the specified volumes:

Status: Reflects the current status of the volume. The possible values are ok, impaired , warning, or insufficient-data. If all checks pass, the overall status of the volume is ok. If the check fails, the overall status is impaired. If the status is insufficient-data, then the checks might still be taking place on your volume at the time. We recommend that you retry the request. For more information about volume status, see Monitor the status of your volumes in the Amazon EBS User Guide.

Events: Reflect the cause of a volume status and might require you to take action. For example, if your volume returns an impaired status, then the volume event might be potential-data-inconsistency. This means that your volume has been affected by an issue with the underlying host, has all I/O operations disabled, and might have inconsistent data.

Actions: Reflect the actions you might have to take in response to an event. For example, if the status of the volume is impaired and the volume event shows potential-data-inconsistency, then the action shows enable-volume-io. This means that you may want to enable the I/O operations for the volume and then check the volume for data consistency. For more information, see Work with an impaired EBS volume.

Volume status is based on the volume status checks, and does not reflect the volume state. Therefore, volume status does not indicate volumes in the error state (for example, when a volume is incapable of accepting I/O.)

The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.

Parameters:

  • max_results (Optional[Integer], default: None ) –

    The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

  • next_token (Optional[String], default: None ) –

    The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

  • volume_ids (Optional[VolumeIdStringList], default: None ) –

    The IDs of the volumes.

    Default: Describes all your volumes.

  • include_managed_resources (Optional[Boolean], default: None ) –

    Indicates whether to include managed resources in the output. If this parameter is set to true, the output includes resources that are managed by Amazon Web Services services, even if managed resource visibility is set to hidden.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • filters (Optional[FilterList], default: None ) –

    The filters.

    • action.code - The action code for the event (for example, enable-volume-io).

    • action.description - A description of the action.

    • action.event-id - The event ID associated with the action.

    • availability-zone - The Availability Zone of the instance.

    • event.description - A description of the event.

    • event.event-id - The event ID.

    • event.event-type - The event type (for io-enabled: passed | failed; for io-performance: io-performance:degraded | io-performance:severely-degraded | io-performance:stalled).

    • event.not-after - The latest end time for the event.

    • event.not-before - The earliest start time for the event.

    • volume-status.details-name - The cause for volume-status.status (io-enabled | io-performance).

    • volume-status.details-status - The status of volume-status.details-name (for io-enabled: passed | failed; for io-performance: normal | degraded | severely-degraded | stalled).

    • volume-status.status - The status of the volume (ok | impaired | warning | insufficient-data).

Raises:

Examples:

To describe the status of a single volume This example describes the status for the volume vol-1234567890abcdef0.

>>> client.describe_volume_status(volume_ids=['vol-1234567890abcdef0'])
To describe the status of impaired volumes
This example describes the status for all volumes that are impaired. In this example output, there are no impaired volumes.
>>> client.describe_volume_status(filters=[{'Values': ['impaired'], 'Name': 'volume-status.status'}])
Source code in docs_src/capo_ec2/_services/ec2.py
def describe_volume_status(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    max_results: Optional["capo_ec2.types.integer.Integer"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    volume_ids: Optional[
        "capo_ec2.types.volume_id_string_list.VolumeIdStringList"
    ] = None,
    include_managed_resources: Optional["capo_ec2.types.boolean.Boolean"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
) -> "capo_ec2.types.describe_volume_status_result.DescribeVolumeStatusResult":
    """<p>Describes the status of the specified volumes. Volume status provides the result of the checks performed on your volumes to determine events that can impair the performance of your volumes. The performance of a volume can be affected if an issue occurs on the volume's underlying host. If the volume's underlying host experiences a power outage or system issue, after the system is restored, there could be data inconsistencies on the volume. Volume events notify you if this occurs. Volume actions notify you if any action needs to be taken in response to the event.</p> <p>The <code>DescribeVolumeStatus</code> operation provides the following information about the specified volumes:</p> <p> <i>Status</i>: Reflects the current status of the volume. The possible values are <code>ok</code>, <code>impaired</code> , <code>warning</code>, or <code>insufficient-data</code>. If all checks pass, the overall status of the volume is <code>ok</code>. If the check fails, the overall status is <code>impaired</code>. If the status is <code>insufficient-data</code>, then the checks might still be taking place on your volume at the time. We recommend that you retry the request. For more information about volume status, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-status.html">Monitor the status of your volumes</a> in the <i>Amazon EBS User Guide</i>.</p> <p> <i>Events</i>: Reflect the cause of a volume status and might require you to take action. For example, if your volume returns an <code>impaired</code> status, then the volume event might be <code>potential-data-inconsistency</code>. This means that your volume has been affected by an issue with the underlying host, has all I/O operations disabled, and might have inconsistent data.</p> <p> <i>Actions</i>: Reflect the actions you might have to take in response to an event. For example, if the status of the volume is <code>impaired</code> and the volume event shows <code>potential-data-inconsistency</code>, then the action shows <code>enable-volume-io</code>. This means that you may want to enable the I/O operations for the volume and then check the volume for data consistency. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/work_volumes_impaired.html">Work with an impaired EBS volume</a>.</p> <p>Volume status is based on the volume status checks, and does not reflect the volume state. Therefore, volume status does not indicate volumes in the <code>error</code> state (for example, when a volume is incapable of accepting I/O.)</p> <note> <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p> </note>

    Args:
        max_results: <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
        next_token: <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
        volume_ids: <p>The IDs of the volumes.</p> <p>Default: Describes all your volumes.</p>
        include_managed_resources: <p>Indicates whether to include managed resources in the output. If this parameter is set to <code>true</code>, the output includes resources that are managed by Amazon Web Services services, even if managed resource visibility is set to hidden.</p>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        filters: <p>The filters.</p> <ul> <li> <p> <code>action.code</code> - The action code for the event (for example, <code>enable-volume-io</code>).</p> </li> <li> <p> <code>action.description</code> - A description of the action.</p> </li> <li> <p> <code>action.event-id</code> - The event ID associated with the action.</p> </li> <li> <p> <code>availability-zone</code> - The Availability Zone of the instance.</p> </li> <li> <p> <code>event.description</code> - A description of the event.</p> </li> <li> <p> <code>event.event-id</code> - The event ID.</p> </li> <li> <p> <code>event.event-type</code> - The event type (for <code>io-enabled</code>: <code>passed</code> | <code>failed</code>; for <code>io-performance</code>: <code>io-performance:degraded</code> | <code>io-performance:severely-degraded</code> | <code>io-performance:stalled</code>).</p> </li> <li> <p> <code>event.not-after</code> - The latest end time for the event.</p> </li> <li> <p> <code>event.not-before</code> - The earliest start time for the event.</p> </li> <li> <p> <code>volume-status.details-name</code> - The cause for <code>volume-status.status</code> (<code>io-enabled</code> | <code>io-performance</code>).</p> </li> <li> <p> <code>volume-status.details-status</code> - The status of <code>volume-status.details-name</code> (for <code>io-enabled</code>: <code>passed</code> | <code>failed</code>; for <code>io-performance</code>: <code>normal</code> | <code>degraded</code> | <code>severely-degraded</code> | <code>stalled</code>).</p> </li> <li> <p> <code>volume-status.status</code> - The status of the volume (<code>ok</code> | <code>impaired</code> | <code>warning</code> | <code>insufficient-data</code>).</p> </li> </ul>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe the status of a single volume
        This example describes the status for the volume ``vol-1234567890abcdef0``.

        >>> client.describe_volume_status(volume_ids=['vol-1234567890abcdef0'])
        To describe the status of impaired volumes
        This example describes the status for all volumes that are impaired. In this example output, there are no impaired volumes.

        >>> client.describe_volume_status(filters=[{'Values': ['impaired'], 'Name': 'volume-status.status'}])
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_volume_status_request.DescribeVolumeStatusRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_volume_status_result.DescribeVolumeStatusResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_volume_status

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_volume_status.describe_volume_status(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeVolumeStatus")
    )
    input_: capo_ec2.types.describe_volume_status_request.DescribeVolumeStatusRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if volume_ids is not None:
        input_["volume_ids"] = volume_ids
    if include_managed_resources is not None:
        input_["include_managed_resources"] = include_managed_resources
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if filters is not None:
        input_["filters"] = filters

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output