Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 38 additions & 34 deletions content/docs/getting-started/create-small-vm-catalog-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,46 @@ Create a file called `small-vm.yaml` with the following content:
api_version: v1alpha1
display_name: "Small VM"
spec:
service_type: vm
fields:
- path: metadata
editable: true
- path: vcpu.count
display_name: "CPU Count"
editable: true
default: 2
validation_schema:
type: integer
minimum: 1
maximum: 4
- path: memory.size
display_name: "Memory (GB)"
editable: false
default: "2GB"
- path: storage.disks
display_name: "Storage (GB)"
editable: false
default:
- name: boot
capacity: "20GB"
validation_schema:
type: array
- path: guest_os.type
display_name: "Guest OS"
editable: true
default: "rhel-10"
validation_schema:
type: string
enum:
- rhel-9
- rhel-10
resources:
- name: main
service_type: vm
fields:
- path: metadata
editable: true
- path: vcpu.count
display_name: "CPU Count"
editable: true
default: 2
validation_schema:
type: integer
minimum: 1
maximum: 4
- path: memory.size
display_name: "Memory (GB)"
editable: false
default: "2GB"
- path: storage.disks
display_name: "Storage (GB)"
editable: false
default:
- name: boot
capacity: "20GB"
validation_schema:
type: array
- path: guest_os.type
display_name: "Guest OS"
editable: true
default: "rhel-10"
validation_schema:
type: string
enum:
- rhel-9
- rhel-10
```

This defines a small VM catalog item with:
A catalog item declares one or more **resources** — each with a name, service
type, and field configurations. This single-resource catalog item defines a VM
(`main`) with:

- **Metadata** — editable by users, for setting VM name and labels
- **2 vCPUs** — editable by users, between 1 and 4
Expand Down
10 changes: 8 additions & 2 deletions content/docs/getting-started/create-small-vm-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,21 @@ display_name: "My Dev VM"
spec:
catalog_item_id: small-vm
user_values:
- path: metadata
- resource: main
path: metadata
value:
name: "small-vm"
labels:
env: "dev"
- path: vcpu.count
- resource: main
path: vcpu.count
value: 1
```

Each `user_values` entry specifies which **resource** (by name) it applies to.
For single-resource catalog items like `small-vm`, this is the name of the sole
resource (`main`).

This creates a VM instance based on the `small-vm` catalog item with:

- **Metadata** — sets the VM name to `small-vm` with a `dev` environment label
Expand Down
Loading