New-XenVGPU
Creates a new VGPU object.
Syntax
New-XenVGPU -HashTable <hashtable> [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>]
[-WhatIf] [-Confirm] [-Async] [<CommonParameters>]
New-XenVGPU -Record <VGPU> [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>]
[-WhatIf] [-Confirm] [-Async] [<CommonParameters>]
New-XenVGPU [-PassThru] [-VM <XenRef[VM]>] [-GPUGroup <XenRef[GPU_group]>]
[-Device <string>] [-OtherConfig <hashtable>] [-Type <XenRef[VGPU_type]>]
[-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async]
[<CommonParameters>]
Description
Creates a new VGPU object.
VGPU: A virtual GPU (vGPU).
Parameters
-Async
If set, the operation runs asynchronously and returns a Task object that can be used to track its progress.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-BestEffort
If set, the cmdlet continues processing further objects instead of throwing a terminating error when an operation fails for one object.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Confirm
Prompts for confirmation before running the cmdlet.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Aliases | cf |
-Device
This parameter has no documentation.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-GPUGroup
This parameter has no documentation.
| Attribute | Value |
|---|---|
| Type | XenRef[GPU_group] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-HashTable
A hashtable of field names to values, from which to create the VGPU.
| Attribute | Value |
|---|---|
| Type | hashtable |
| Required | True |
| Position | Named |
| Accepts pipeline input | False |
-OtherConfig
This parameter has no documentation.
| Attribute | Value |
|---|---|
| Type | hashtable |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-PassThru
If set, the cmdlet returns the affected object. By default the cmdlet does not generate any output.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Record
An existing VGPU record whose fields are used to create the new object.
| Attribute | Value |
|---|---|
| Type | VGPU |
| Required | True |
| Position | Named |
| Accepts pipeline input | False |
-SessionOpaqueRef
The session object on which to run the cmdlet. This overrides the default session and lets you target a specific open XenServer connection.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Type
This parameter has no documentation.
| Attribute | Value |
|---|---|
| Type | XenRef[VGPU_type] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-VM
This parameter has no documentation.
| Attribute | Value |
|---|---|
| Type | XenRef[VM] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Aliases | wi |
Inputs
-
None
Outputs
-
VGPU -
Task -
void
Examples
Example 1: Create a VGPU
PS> $vm = Get-XenVM | Select-Object -First 1
PS> $gpu_group = Get-XenGPUGroup | Select-Object -First 1
PS> $vgpu_type = Get-XenVGPUType | Select-Object -First 1
PS> New-XenVGPU -VM $vm -GPUGroup $gpu_group -Device "value" -OtherConfig @{ "key" = "value" } -Type $vgpu_type -PassThru
New-XenVGPU takes the arguments of the create call rather than a record of fields, and needs all of them. -PassThru returns the new VGPU.
Example 2: Create a VGPU and wait for the task
PS> $vm = Get-XenVM | Select-Object -First 1
PS> $gpu_group = Get-XenGPUGroup | Select-Object -First 1
PS> $vgpu_type = Get-XenVGPUType | Select-Object -First 1
PS> New-XenVGPU -VM $vm -GPUGroup $gpu_group -Device "value" -OtherConfig @{ "key" = "value" } -Type $vgpu_type -Async -PassThru |
Wait-XenTask -ShowProgress
-Async hands the work to the server and returns the Task that represents it, which pipes into Wait-XenTask.
Example 3: See what would be created
PS> $vm = Get-XenVM | Select-Object -First 1
PS> $gpu_group = Get-XenGPUGroup | Select-Object -First 1
PS> $vgpu_type = Get-XenVGPUType | Select-Object -First 1
PS> New-XenVGPU -VM $vm -GPUGroup $gpu_group -Device "value" -OtherConfig @{ "key" = "value" } -Type $vgpu_type -WhatIf
Reports what would be created without creating it. Every cmdlet that changes the server takes -WhatIf and -Confirm.
Related links
-
Class: VGPU
-
Using the XenServer PowerShell module