{
  "id": "cloud/aws-ec2-spot-instance-termination",
  "signature": "EC2 Spot Instance termination notice: Your Spot Instance 'i-1234567890abcdef0' is terminated because the Spot price exceeded the maximum price you are willing to pay.",
  "signature_zh": "EC2竞价实例终止通知：您的竞价实例'i-1234567890abcdef0'已终止，因为竞价价格超过了您愿意支付的最高价格。",
  "regex": "Spot Instance .* terminated because the Spot price exceeded the maximum price",
  "domain": "cloud",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The Spot Instance's bid price is lower than the current Spot market price, causing AWS to reclaim the instance.",
  "root_cause_type": "generic",
  "root_cause_zh": "竞价实例的出价低于当前竞价市场价格，导致AWS回收该实例。",
  "versions": [
    {
      "version": "EC2 Spot Instances (all regions)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS CLI 2.13.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase the bid price to the On-Demand price",
      "why_fails": "Setting bid to On-Demand price defeats the purpose of Spot Instances and may still not guarantee persistence during high demand. AWS may still terminate if capacity is reclaimed.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a different instance type without changing bid",
      "why_fails": "Different instance types have different Spot markets; the same bid may still be too low for the new type.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a Spot Fleet or EC2 Fleet with multiple instance types and bid prices. Example: `aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json` where config.json includes diverse instance types (e.g., m5.large, c5.large) and a max bid equal to the On-Demand price. This increases chances of capacity availability.",
      "success_rate": 0.8,
      "how": "Use a Spot Fleet or EC2 Fleet with multiple instance types and bid prices. Example: `aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json` where config.json includes diverse instance types (e.g., m5.large, c5.large) and a max bid equal to the On-Demand price. This increases chances of capacity availability.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement graceful shutdown handling. Use the EC2 metadata endpoint to check for termination notices (http://169.254.169.254/latest/meta-data/spot/termination-time) and save state before termination. Example script: `curl http://169.254.169.254/latest/meta-data/spot/termination-time 2>/dev/null && echo \"Termination imminent\"`",
      "success_rate": 0.75,
      "how": "Implement graceful shutdown handling. Use the EC2 metadata endpoint to check for termination notices (http://169.254.169.254/latest/meta-data/spot/termination-time) and save state before termination. Example script: `curl http://169.254.169.254/latest/meta-data/spot/termination-time 2>/dev/null && echo \"Termination imminent\"`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use a Spot Fleet or EC2 Fleet with multiple instance types and bid prices. Example: `aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json` where config.json includes diverse instance types (e.g., m5.large, c5.large) and a max bid equal to the On-Demand price. This increases chances of capacity availability.",
    "Implement graceful shutdown handling. Use the EC2 metadata endpoint to check for termination notices (http://169.254.169.254/latest/meta-data/spot/termination-time) and save state before termination. Example script: `curl http://169.254.169.254/latest/meta-data/spot/termination-time 2>/dev/null && echo \"Termination imminent\"`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-instances-termination-notices.html",
  "official_doc_section": null,
  "error_code": "SpotInstanceTermination",
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2023-04-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}