Skip to content

Commit

Permalink
Updated doc and prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
bouchardh authored and lbajolet-hashicorp committed Sep 12, 2023
1 parent 7e7a7f5 commit b41e909
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .web-docs/components/builder/clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ Example:

- `ssd` (bool) - Drive will be presented to the guest as solid-state drive
rather than a rotational disk.

This cannot work with virtio disks.

<!-- End of code generated from the comments of the diskConfig struct in builder/proxmox/common/config.go; -->

Expand Down
2 changes: 2 additions & 0 deletions .web-docs/components/builder/iso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ Example:

- `ssd` (bool) - Drive will be presented to the guest as solid-state drive
rather than a rotational disk.

This cannot work with virtio disks.

<!-- End of code generated from the comments of the diskConfig struct in builder/proxmox/common/config.go; -->

Expand Down
8 changes: 8 additions & 0 deletions builder/proxmox/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ type diskConfig struct {
Discard bool `mapstructure:"discard"`
// Drive will be presented to the guest as solid-state drive
// rather than a rotational disk.
//
// This cannot work with virtio disks.
SSD bool `mapstructure:"ssd"`
}

Expand Down Expand Up @@ -611,6 +613,12 @@ func (c *Config) Prepare(upper interface{}, raws ...interface{}) ([]string, []st
}
}
}
if disk.SSD {
// SSD emulation is not supported on virtio device type
if disk.Type == "virtio" {
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("SSD emulation is not supported on a virtio disk"))
}
}
if disk.StoragePool == "" {
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("disks[%d].storage_pool must be specified", idx))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@

- `ssd` (bool) - Drive will be presented to the guest as solid-state drive
rather than a rotational disk.

This cannot work with virtio disks.

<!-- End of code generated from the comments of the diskConfig struct in builder/proxmox/common/config.go; -->

0 comments on commit b41e909

Please sign in to comment.