Skip to content
Open
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
1 change: 1 addition & 0 deletions docs/resources/machine_config_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ The following attributes are exported:
* `user_data` - (Optional) UserData content of cloud-init, base64 is supported. If the image does not contain the qemu-guest-agent package, you must install and start qemu-guest-agent using userdata (string)
* `network_data` - (Optional) NetworkData content of cloud-init, base64 is supported (string)
* `vm_affinity` - (Optional) Virtual machine affinity, only base64 format is supported. For Rancher v2.6.7 and above (string)
* `vgpu_info` - (Optional) A JSON string specifying info for the vGPUs e.g. `{\"vGPURequests\":[{\"name\":\"provisioned\",\"deviceName\":\"nvidia.com/NVIDIA_H200-141C\"}]}` (string)

### `linode_config`

Expand Down
5 changes: 5 additions & 0 deletions rancher2/schema_machine_config_v2_harvester.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ func machineConfigV2HarvesterFields() map[string]*schema.Schema {
Optional: true,
Description: "NetworkData content of cloud-init, base64 is supported",
},
"vgpu_info": {
Type: schema.TypeString,
Optional: true,
Description: "A JSON string specifying info for the vGPUs e.g. `{\"vGPURequests\":[{\"name\":\"provisioned\",\"deviceName\":\"nvidia.com/NVIDIA_H200-141C\"}]}`",
},
}

return s
Expand Down
9 changes: 9 additions & 0 deletions rancher2/structure_machine_config_v2_harvester.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type machineConfigV2Harvester struct {
NetworkInfo string `json:"networkInfo,omitempty" yaml:"networkInfo,omitempty"`
UserData string `json:"userData,omitempty" yaml:"userData,omitempty"`
NetworkData string `json:"networkData,omitempty" yaml:"networkData,omitempty"`
VGPUInfo string `json:"vgpuInfo,omitempty" yaml:"vgpuInfo,omitempty"`
}

type MachineConfigV2Harvester struct {
Expand Down Expand Up @@ -108,6 +109,10 @@ func flattenMachineConfigV2Harvester(in *MachineConfigV2Harvester) []interface{}
obj["network_data"] = in.NetworkData
}

if len(in.VGPUInfo) > 0 {
obj["vgpu_info"] = in.VGPUInfo
}

return []interface{}{obj}
}

Expand Down Expand Up @@ -189,5 +194,9 @@ func expandMachineConfigV2Harvester(p []interface{}, source *MachineConfigV2) *M
obj.NetworkData = v
}

if v, ok := in["vgpu_info"].(string); ok && len(v) > 0 {
obj.VGPUInfo = v
}

return obj
}