< Back
Add-VsphereVmDevice
Post
NAME Add-VsphereVmDevice
SYNOPSIS
Adds a new device to an existing VM.
SYNTAX
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> -DiskSizeMb <Int64>
-DiskProvision {Thick Provision Lazy Zeroed | Thick Provision Eager Zeroed | Thin Provision} -Connection
<Hashtable> [<CommonParameters>]
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> [-ConnectAtPowerOn
<Boolean>] -NetworkId <String> -NetworkAdapterType {VirtualE1000 | VirtualE1000e | VirtualPCNet32 | VirtualVmxnet
| VirtualVmxnet2 | VirtualVmxnet3} -Connection <Hashtable> [<CommonParameters>]
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> [-ConnectAtPowerOn
<Boolean>] -CdDriveType {Client Device | Host Device | Datastore ISO File} -IsoFilePath <String> [-IsoDatastoreId
<String>] -Connection <Hashtable> [<CommonParameters>]
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> -CdDriveType {Client
Device | Host Device | Datastore ISO File} -Connection <Hashtable> [<CommonParameters>]
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> [-ConnectAtPowerOn
<Boolean>] -CdDriveType {Client Device | Host Device | Datastore ISO File} -HostDevicePath <String> -Connection
<Hashtable> [<CommonParameters>]
DESCRIPTION
Adds a new device to an existing VM.
PARAMETERS
-DeviceType <String>
Specifies the type of device that is to be added to the VM. Accepted values are:
CD/DVD Drive
Hard Disk
Network Adapter
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-VmId <String>
ID (managed object reference) of the VM to which the device is to be added.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-DiskSizeMb <Int64>
Size of the new hard disk, in MB.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-DiskProvision <String>
Provision type for the new hard disk. Allowed values are:
Thick Provision Lazy Zeroed
Thick Provision Eager Zeroed
Thin Provision
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-Connection <Hashtable>
Specifies connection information to the vCenter server. For example:
@{ServerUrl='<vCenter Server URL>';User='<user>';Password='<password>';LicenseKey=<license
key>;SkipCertificateValidation=$false}
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-ConnectAtPowerOn [<Boolean>]
Specifies if the drive should be connected when the VM powers on.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-NetworkId <String>
ID (managed object reference) of the network to be assigned to the new network adapter.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-NetworkAdapterType <String>
The type of network adapter to be added. This should be one of the NICs available for the Compute Resource (or
Cluster Compute Resource) owner of the Resource Pool of the VM, and it should be supported by the operating
system of the VM. Accepted values are:
VirtualE1000
VirtualE1000e
VirtualPCNet32
VirtualVmxnet
VirtualVmxnet2
VirtualVmxnet3
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-CdDriveType <String>
The type of CD/DVD drive that is to be added to the VM. This parameter is only available when DeviceType is
CD/DVD Drive. Accepted values are:
Client Device - connect the device to a physical CD/DVD device on the system from which you access the vSphere
Client
Host Device - connect the device to a physical CD/DVD device on the host.
Datastore ISO File - connect the device to an ISO file that is stored on a datastore accessible to the host.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-IsoFilePath <String>
Location of the datastore ISO file for the device, in the form [<datastore name>] <ISO file Path>. For example:
[DS-DEV-01] ISO/windows/ windows_10_x64.iso
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-IsoDatastoreId [<String>]
ID (managed object reference) of the datastore where the ISO file is stored. The datastore must correspond to
the datastore specified in the ISO File Path.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-HostDevicePath <String>
Location of host device.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
System.Int32
The Device Key of the newly added device.
RELATED LINKS
SYNOPSIS
Adds a new device to an existing VM.
SYNTAX
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> -DiskSizeMb <Int64>
-DiskProvision {Thick Provision Lazy Zeroed | Thick Provision Eager Zeroed | Thin Provision} -Connection
<Hashtable> [<CommonParameters>]
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> [-ConnectAtPowerOn
<Boolean>] -NetworkId <String> -NetworkAdapterType {VirtualE1000 | VirtualE1000e | VirtualPCNet32 | VirtualVmxnet
| VirtualVmxnet2 | VirtualVmxnet3} -Connection <Hashtable> [<CommonParameters>]
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> [-ConnectAtPowerOn
<Boolean>] -CdDriveType {Client Device | Host Device | Datastore ISO File} -IsoFilePath <String> [-IsoDatastoreId
<String>] -Connection <Hashtable> [<CommonParameters>]
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> -CdDriveType {Client
Device | Host Device | Datastore ISO File} -Connection <Hashtable> [<CommonParameters>]
Add-VsphereVmDevice -DeviceType {CD/DVD Drive | Hard Disk | Network Adapter} -VmId <String> [-ConnectAtPowerOn
<Boolean>] -CdDriveType {Client Device | Host Device | Datastore ISO File} -HostDevicePath <String> -Connection
<Hashtable> [<CommonParameters>]
DESCRIPTION
Adds a new device to an existing VM.
PARAMETERS
-DeviceType <String>
Specifies the type of device that is to be added to the VM. Accepted values are:
CD/DVD Drive
Hard Disk
Network Adapter
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-VmId <String>
ID (managed object reference) of the VM to which the device is to be added.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-DiskSizeMb <Int64>
Size of the new hard disk, in MB.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-DiskProvision <String>
Provision type for the new hard disk. Allowed values are:
Thick Provision Lazy Zeroed
Thick Provision Eager Zeroed
Thin Provision
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-Connection <Hashtable>
Specifies connection information to the vCenter server. For example:
@{ServerUrl='<vCenter Server URL>';User='<user>';Password='<password>';LicenseKey=<license
key>;SkipCertificateValidation=$false}
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-ConnectAtPowerOn [<Boolean>]
Specifies if the drive should be connected when the VM powers on.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-NetworkId <String>
ID (managed object reference) of the network to be assigned to the new network adapter.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-NetworkAdapterType <String>
The type of network adapter to be added. This should be one of the NICs available for the Compute Resource (or
Cluster Compute Resource) owner of the Resource Pool of the VM, and it should be supported by the operating
system of the VM. Accepted values are:
VirtualE1000
VirtualE1000e
VirtualPCNet32
VirtualVmxnet
VirtualVmxnet2
VirtualVmxnet3
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-CdDriveType <String>
The type of CD/DVD drive that is to be added to the VM. This parameter is only available when DeviceType is
CD/DVD Drive. Accepted values are:
Client Device - connect the device to a physical CD/DVD device on the system from which you access the vSphere
Client
Host Device - connect the device to a physical CD/DVD device on the host.
Datastore ISO File - connect the device to an ISO file that is stored on a datastore accessible to the host.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-IsoFilePath <String>
Location of the datastore ISO file for the device, in the form [<datastore name>] <ISO file Path>. For example:
[DS-DEV-01] ISO/windows/ windows_10_x64.iso
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-IsoDatastoreId [<String>]
ID (managed object reference) of the datastore where the ISO file is stored. The datastore must correspond to
the datastore specified in the ISO File Path.
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-HostDevicePath <String>
Location of host device.
Required? true
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
System.Int32
The Device Key of the newly added device.
RELATED LINKS