> For the complete documentation index, see [llms.txt](https://kubevirtlegacy.gitbook.io/user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kubevirtlegacy.gitbook.io/user-guide/docs/virtual_machines/virtual_machine_instances.md).

# Virtual Machines Instances

The `VirtualMachineInstance` type conceptionally has two parts:

* Information for making scheduling decisions
* Information about the virtual machine ABI

Every `VirtualMachineInstance` object represents a single running virtual machine instance.

## API Overview

With the installation of KubeVirt, new types are added to the Kubernetes API to manage Virtual Machines.

You can interact with the new resources (via `kubectl`) as you would with any other API resource.

## VirtualMachineInstance API

> Note: A full API reference is available at <https://kubevirt.io/api-reference/>.

Here is an example of a VirtualMachineInstance object:

```
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachineInstance
metadata:
  name: testvmi-nocloud
spec:
  terminationGracePeriodSeconds: 30
  domain:
    resources:
      requests:
        memory: 1024M
    devices:
      disks:
      - name: containerdisk
        disk:
          bus: virtio
      - name: emptydisk
        disk:
          bus: virtio
      - disk:
          bus: virtio
        name: cloudinitdisk
  volumes:
  - name: containerdisk
    containerDisk:
      image: kubevirt/fedora-cloud-container-disk-demo:latest
  - name: emptydisk
    emptyDisk:
      capacity: "2Gi"
  - name: cloudinitdisk
    cloudInitNoCloud:
      userData: |-
        #cloud-config
        password: fedora
        chpasswd: { expire: False }
```

This example uses a fedora cloud image in combination with cloud-init and an ephemeral empty disk with a capacity of `2Gi`. For the sake of simplicity, the volume sources in this example are ephemeral and don't require a provisioner in your cluster.

## Additional Information

* More information about persistent and ephemeral volumes: [Disks and Volumes](/user-guide/docs/virtual_machines/disks_and_volumes.md)
* How to access a VirtualMachineInstance via `console` or `vnc`: [Console Access](/user-guide/docs/virtual_machines/accessing_virtual_machines.md)
* How to customize VirtualMachineInstances with `cloud-init`: [Cloud Init](/user-guide/docs/virtual_machines/startup_scripts.md#cloud-init)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kubevirtlegacy.gitbook.io/user-guide/docs/virtual_machines/virtual_machine_instances.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
