# ecs-billing

Part of **ECS**

# ECS Billing Troubleshooting Guide

## Problem Index

| Problem | Symptom | Severity | Solution Summary |
|--------|--------|----------|------------------|
| Insufficient Account Balance | Error: `InsufficientBalance`; services suspended or renewal fails | High | Recharge account and verify payment method |
| Unexpected Snapshot Storage Charges | User sees recurring snapshot fees despite no manual snapshots | Medium | Check for auto-created snapshots from custom images or backups |
| Public Bandwidth Billing Confusion | Charges incurred for outbound traffic even with low usage | Medium | Confirm bandwidth billing type (traffic-based vs. bandwidth-based) and monitor usage |

## Problem Details

### Problem 1: Insufficient Account Balance Causes Service Suspension

**Symptoms**
- Error message: `InsufficientBalance`
- Behavior: ECS instances stop automatically, renewal fails, or new orders cannot be placed
- Context: Occurs when account balance is too low to cover upcoming or current charges, especially for pay-as-you-go resources

**Root Cause**
- The account lacks sufficient funds to cover hourly or monthly billing cycles. Pay-as-you-go services (including public bandwidth billed by traffic) are suspended immediately upon negative balance. Subscription renewals also fail if balance is inadequate at renewal time.

**Solution**
1. Log in to the [Alibaba Cloud Console](https://ecs.console.aliyun.com)
2. Navigate to **Billing Management Console > Account Balance**
3. Click **Recharge** and add sufficient funds to cover expected usage
4. If using automatic payment methods (e.g., credit card), ensure they are valid and not expired
5. For enterprise users needing offline payment, apply for a renewal contract:
   - Go to **User Center > Contract Management**
   - Select the unpaid order and submit a contract request

**Verification**
- After recharge, check that ECS instances resume normal operation
- In **Billing Console > Bills**, confirm recent charges are now marked as "Paid"
- Run a test operation (e.g., create a temporary instance) to validate payment processing

### Problem 2: Unexpected Snapshot Storage Fees

**Symptoms**
- Behavior: Recurring charges appear under "Snapshot Storage" even though user did not manually create snapshots
- Context: Often noticed after creating custom images or enabling backup policies

**Root Cause**
- Creating a custom image automatically generates a snapshot of the system disk, which incurs ongoing storage fees. Additionally, automated backup policies (if enabled) create periodic snapshots. Standard snapshots are billed based on storage capacity used, and OSS resource packages only offset standard snapshot storage—not replication or cross-region copy fees.

**Solution**
1. Identify source of snapshots:
   ```bash
   # Use Alibaba Cloud CLI to list snapshots
   aliyun ecs DescribeSnapshots --RegionId <your-region>
   ```
2. Delete unnecessary snapshots:
   - In **ECS Console > Snapshots**, select unused snapshots and click **Delete**
   - Alternatively, delete via API:
     ```bash
     aliyun ecs DeleteSnapshot --SnapshotId snap-xxxxxxxxx
     ```
3. Review custom images:
   - If a custom image is no longer needed, delete it—this may also remove its base snapshot (if not shared or used by other resources)
4. Adjust backup policies if using automated backup features

**Verification**
- In **Billing Console > Bills**, filter by "Snapshot" product and confirm charges decrease in next billing cycle
- Ensure no critical data loss by verifying retained snapshots still support recovery needs

### Problem 3: Confusion Over Public Bandwidth Billing Charges

**Symptoms**
- Behavior: Unexpected charges for outbound internet traffic despite minimal perceived usage
- Context: Common when instances use "Pay-by-Traffic" public bandwidth model

**Root Cause**
- Public bandwidth can be billed in two ways: **Pay-by-Bandwidth** (fixed peak bandwidth) or **Pay-by-Traffic** (actual data transferred). Pay-by-Traffic charges per GB of outbound traffic and settles hourly. Users often assume low activity means low cost, but background updates, logs, or misconfigured services can generate significant traffic.

**Solution**
1. Check current bandwidth billing type:
   - In **ECS Console > Instances**, view instance details → **Network Attributes**
   - Look for "Billing Method for Network Usage"
2. If using Pay-by-Traffic and traffic is unpredictable:
   - Switch to Pay-by-Bandwidth to cap costs:
     ```bash
     aliyun ecs ModifyInstanceNetworkSpec \
       --InstanceId i-xxxxxxxxx \
       --InternetMaxBandwidthOut 5 \
       --InternetChargeType PayByBandwidth
     ```
   - Note: Requires instance restart in some cases
3. Monitor traffic usage:
   - Use **CloudMonitor** to track outbound traffic metrics
   - Set billing alerts in **Cost Management > Budgets**

**Verification**
- After change, observe next hour’s bill for updated charge pattern
- Confirm network performance meets application requirements under new billing model

## FAQ

**Q: How do I check why I was charged for ECS resources I didn’t explicitly create?**  
A: Review your bills in the **Billing Console > Bills** section. Filter by product (e.g., "Snapshot", "Cloud Disk") and correlate with resource creation events. Custom images, auto snapshots, and backup policies often trigger indirect charges.

**Q: What permissions or account settings are required to manage billing and avoid service interruption?**  
A: Your account must complete **real-name verification**, maintain **sufficient balance**, and have **accurate contact information** to receive balance alerts. Financial operations like invoicing or contract applications require appropriate RAM permissions or primary account access.

**Q: Can I get a refund if my ECS instance was stopped due to insufficient balance?**  
A: Refunds are generally not issued for service interruptions caused by account balance issues. However, you can apply for a refund only if the service itself failed (not due to user-side payment issues). Review the official refund policy in the **Billing Console > Refund Management**.

**Q: How do I enable alerts for low account balance or high usage?**  
A: Go to **Cost Management Console > Budgets**, create a new budget, and set alert thresholds for account balance or daily/monthly spend. Alerts are sent via email and SMS to registered contacts.

**Q: Why am I being charged after releasing an ECS instance?**  
A: Charges may persist for associated resources like cloud disks (if not deleted with instance), snapshots, or public IP addresses retained post-release. Always verify that all dependent resources are deleted to avoid residual billing.