New-XenVBD
Creates a new VBD object.
Syntax
New-XenVBD -HashTable <hashtable> [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>]
[-WhatIf] [-Confirm] [-Async] [<CommonParameters>]
New-XenVBD -Record <VBD> [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf]
[-Confirm] [-Async] [<CommonParameters>]
New-XenVBD [-PassThru] [-VM <XenRef[VM]>] [-VDI <XenRef[VDI]>] [-Device <string>]
[-Userdevice <string>] [-Bootable <bool>] [-Mode {RO | RW | unknown}]
[-Type {CD | Disk | Floppy | unknown}] [-Unpluggable <bool>] [-Empty <bool>]
[-OtherConfig <hashtable>] [-CurrentlyAttached <bool>] [-QosAlgorithmType <string>]
[-QosAlgorithmParams <hashtable>] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf]
[-Confirm] [-Async] [<CommonParameters>]
Description
Creates a new VBD object.
VBD: A virtual block device.
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 |
-Bootable
true if this VBD is bootable
| Attribute | Value |
|---|---|
| Type | bool |
| 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 |
-CurrentlyAttached
is the device currently attached (erased on reboot)
| Attribute | Value |
|---|---|
| Type | bool |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Device
device seen by the guest, for example, hda1
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Empty
if true this represents an empty drive
| Attribute | Value |
|---|---|
| Type | bool |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-HashTable
A hashtable of field names to values, from which to create the VBD.
| Attribute | Value |
|---|---|
| Type | hashtable |
| Required | True |
| Position | Named |
| Accepts pipeline input | False |
-Mode
the mode the VBD should be mounted with
| Attribute | Value |
|---|---|
| Type | vbd_mode |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | RO, RW, unknown |
-OtherConfig
additional configuration
| 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 |
-QosAlgorithmParams
parameters for chosen QoS algorithm
| Attribute | Value |
|---|---|
| Type | hashtable |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-QosAlgorithmType
QoS algorithm to use
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Record
An existing VBD record whose fields are used to create the new object.
| Attribute | Value |
|---|---|
| Type | VBD |
| 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
how the VBD will appear to the guest (for example, disk or CD)
| Attribute | Value |
|---|---|
| Type | vbd_type |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | CD, Disk, Floppy, unknown |
-Unpluggable
true if this VBD will support hot-unplug
| Attribute | Value |
|---|---|
| Type | bool |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Userdevice
user-friendly device name, for example, 0, 1, 2, etc.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-VDI
the virtual disk
| Attribute | Value |
|---|---|
| Type | XenRef[VDI] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-VM
the virtual machine
| 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
-
VBD -
Task -
void
Examples
Example 1: Create a VBD from a table of fields
PS> New-XenVBD -HashTable @{ name_label = "Demo VBD" } -PassThru
The keys are the API's field names, so this form reads the same for every class whatever fields it happens to have. -PassThru returns the new VBD.
Example 2: Create a VBD from parameters
PS> New-XenVBD -VM $value -PassThru
The same thing with one parameter per field, which is the form that tab-completes. Get-Help New-XenVBD -Full lists them all.
Example 3: Create a VBD from an existing one
PS> $record = Get-XenVBD | Select-Object -First 1
PS> New-XenVBD -Record $record -PassThru
-Record takes a whole VBD record, so an existing object can be used as the template for a new one.
Related links
-
Class: VBD
-
Using the XenServer PowerShell module