> For the complete documentation index, see [llms.txt](https://docs.cloudeka.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudeka.ai/panduan-untuk-enterprise/cloudeka-api-list/command-reference/cldkctl-flexi/image/snapshot-vm.md).

# snapshot-vm

Create a snapshot of a VM instance and save it as a flexi image. This command allows you to capture the state of a VM instance at a specific point in time and use it as a flexi image for future deployments.

## Usage

```
cldkctl flexi image snapshot-vm [flags]
```

## Aliases

```
snapshot-vm, snapshot-vm
```

## Steps

Follow the steps below to run and view the result of this command:

#### Interactive Mode

1. Run the following command in your terminal:

```
cldkctl flexi image snapshot-vm -i 
```

2. Select the **billing type**.

<figure><img src="https://753761090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtAYQyBIz2BclZ3ZHHlS4%2Fuploads%2Fgit-blob-79d5b620877f5e172b4ec4c9dfe9f3f62fa3f4c5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Select the **instance** for which you want to create the snapshot.
4. Enter the **snapshot name**.
5. Confirm the snapshot creation by selecting **Confirm**.

<figure><img src="https://753761090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtAYQyBIz2BclZ3ZHHlS4%2Fuploads%2Fgit-blob-e6952cbb686078f1ca3be4bdd2964cc15e9e8956%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

6. Once completed successfully, the terminal displays the success message.

<figure><img src="https://753761090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtAYQyBIz2BclZ3ZHHlS4%2Fuploads%2Fgit-blob-ab7e9afeb0d7fe70f4f950781ee79ef8d29554cf%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Non-Interactive Mode

1. Provide all required values using command flags.
2. Add `--auto-confirm` or `-y` to skip confirmation prompts in non-interactive mode.
3. Run the command in your terminal.
4. Once completed successfully, the terminal displays the success message.

<figure><img src="https://753761090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtAYQyBIz2BclZ3ZHHlS4%2Fuploads%2Fgit-blob-977ae33dd48d36dc503c630064f4fd69684cf630%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Flags

{% hint style="info" %}
This command supports [global flags](/panduan-untuk-enterprise/cloudeka-api-list/global-flags.md). Refer to the Global Flags section for details
{% endhint %}

| Flag              | Shorthand | Default | Description                       |
| ----------------- | --------- | ------- | --------------------------------- |
| --auto-confirm    | -y        | false   |                                   |
| --help            | -h        |         | Help for the snapshot-vm command. |
| --instance string |           |         |                                   |
| --interactive     | -i        | false   |                                   |
| --name string     | -n        |         |                                   |
