# l4 commitments renewal

> Size the repurchase for a commitment that is about to end, and get the instant to buy after rather than a date.

Source: https://docs.levelfour.ai/cli/commands/commitments/renewal


`l4 commitments renewal` answers what to buy when a term ends: how many units you hold, how many you
actually consumed, how many to buy back, and the moment to buy after.

```bash
l4 commitments renewal <id> [flags]
```

Nothing here purchases anything. It drafts a plan for a person to execute. The purchase itself is raised in the dashboard and goes through approval like any other saving; [Renewals](/commitments/renewals) walks through it.

## Flags

| Flag           | Description                |
| -------------- | -------------------------- |
| `--format <f>` | `table` (default) or `csv` |

Global flags apply. See [CLI overview](/cli#global-flags).

## An instant, not a date

The plan reports **buy after (UTC)**, an instant rather than a day. A replacement commitment bills
from the moment it is bought, so a replacement bought on the right day but before the old term ends
is paid for twice for the overlap. The instant is the end of the existing term.

## Held against consumed

```text
Units held        Units consumed    Units recommended
40                34                36
```

Held is what you bought. Consumed is what the usage actually drew. Recommended is what to buy back,
which is neither of the first two: renewing what you hold repurchases the unused part for another
term, and renewing exactly what you consumed leaves nothing for growth.

Two figures sit below, and they are never added:

```text
Renewal protects       $12400.00/mo
Rightsizing recovers     $620.00/mo
```

The first is what lapsing would cost you. The second is what buying less would save. One is a loss
avoided, the other is a saving, and summing them double-counts the same usage.

A commitment used too little to pay for itself gets a recommended `0`, and the plan advises letting
it expire on its end date.

On Azure, recommended is what you hold scaled by the utilization Azure measured for the commitment,
the same size a renewal raised in the dashboard buys. A savings plan's amounts are dollars an hour,
so they can be fractional, and consumed reads `not measured` where Azure measured nothing. Nothing
prices what an Azure renewal protects or what rightsizing it recovers, so both monthly amounts read
`not measured`, as they do on an AWS commitment the sizing has not reached yet. Azure may bill or
quote a commitment in a currency other than USD. LevelFour renews only commitments priced in USD, so
the recommended size reads `not measured` too, and the command tells you to renew it in the Azure
portal. A reservation still shows the units it holds.

## Land the pending changes first

Where the API knows of accepted changes that have not yet been applied to the resources this
commitment covers, the plan lists them:

```text
Land these before renewing
ID        SERVICE  ACCOUNT  SAVINGS      STATUS
REC-1234  ec2      prod     $210.00/mo   available

Accept one with: l4 rec accept <id>
```

Capacity a pending change would release is capacity the renewal must not reserve for another term.
A change that shrinks a fleet after the renewal is bought has bought a year of the wrong size.

Acting on one is [`l4 rec accept`](/cli/commands/recommendations/accept), which needs a read-write
key.

## CSV

`--format csv` emits the same columns the dashboard's own download writes, so a plan exported from
either surface lands in the same spreadsheet:

```bash
l4 commitments renewal ri-0a1b2c3d --format csv > renewal.csv
```

```text
commitment_id,service,holder_account_id,buy_after_utc,units_held,units_consumed,units_recommended,decision,sizing_basis,protects_monthly,rightsizing_monthly
```

An absent instant is an empty cell, which is what a spreadsheet reads as no value. `decision` sits
beside the recommended units, so a `0` with `let_expire` reads as advice to let the term run out.
`sizing_basis` names where the recommended amount came from, and `not_usd` marks an Azure commitment
billed or quoted in another currency, whose zeros mean nothing was sized. A monthly amount nothing
priced is an empty cell.

## Examples

```bash
l4 commitments renewal ri-0a1b2c3d
l4 commitments renewal "arn:aws:savingsplans::111122223333:savingsplan/abc"
l4 commitments renewal ri-0a1b2c3d --format csv
l4 commitments renewal ri-0a1b2c3d --json
```

A Savings Plan id is an ARN, so quote it.

## Providers that cannot be planned

Renewal planning needs a term and an end date. Outside AWS and Azure the command names why and exits `0`:

```text
Renewal planning is not measured for Google Cloud: the commitment lifecycle export is not enabled.
```

## Related

* [`l4 commitments expiring`](/cli/commands/commitments/expiring): what to run before this one
* [`l4 commitments plan`](/cli/commands/commitments#plan): sizing a first purchase rather than a repurchase
* [`l4 rec accept`](/cli/commands/recommendations/accept): landing a pending change
* [`l4 commitments`](/cli/commands/commitments): the rest of the group
