Add-XenVM

Last published : Nov 12, 2026
Adds to fields of a VM object.

Syntax

Add-XenVM [-VM] <VM> [-PassThru] [-VCPUsParams <KeyValuePair[string, string]>]
    [-HVMBootParams <KeyValuePair[string, string]>]
    [-XenstoreData <KeyValuePair[string, string]>] [-Tags <string>]
    [-VCPUsParamsLive <KeyValuePair[string, string]>]
    [-NVRAM <KeyValuePair[string, string]>]
    [-BlockedOperations {snapshot | clone | copy | create_template | revert | checkpoint | snapshot_with_quiesce | provision | start | start_on | pause | unpause | clean_shutdown | clean_reboot | hard_shutdown | power_state_reset | hard_reboot | suspend | csvm | resume | resume_on | pool_migrate | migrate_send | get_boot_record | send_sysrq | send_trigger | query_services | shutdown | call_plugin | changing_memory_live | awaiting_memory_live | changing_dynamic_range | changing_static_range | changing_memory_limits | changing_shadow_memory | changing_shadow_memory_live | changing_VCPUs | changing_VCPUs_live | changing_NVRAM | assert_operation_valid | data_source_op | update_allowed_operations | make_into_template | import | export | metadata_export | reverting | destroy | create_vtpm | sysprep | unknown}]
    [-OtherConfig <KeyValuePair[string, string]>]
    [-Platform <KeyValuePair[string, string]>] [-BestEffort] [-SessionOpaqueRef <string>]
    [-WhatIf] [-Confirm] [<CommonParameters>]
Add-XenVM [-Ref] <XenRef[VM]> [-PassThru] [-VCPUsParams <KeyValuePair[string, string]>]
    [-HVMBootParams <KeyValuePair[string, string]>]
    [-XenstoreData <KeyValuePair[string, string]>] [-Tags <string>]
    [-VCPUsParamsLive <KeyValuePair[string, string]>]
    [-NVRAM <KeyValuePair[string, string]>]
    [-BlockedOperations {snapshot | clone | copy | create_template | revert | checkpoint | snapshot_with_quiesce | provision | start | start_on | pause | unpause | clean_shutdown | clean_reboot | hard_shutdown | power_state_reset | hard_reboot | suspend | csvm | resume | resume_on | pool_migrate | migrate_send | get_boot_record | send_sysrq | send_trigger | query_services | shutdown | call_plugin | changing_memory_live | awaiting_memory_live | changing_dynamic_range | changing_static_range | changing_memory_limits | changing_shadow_memory | changing_shadow_memory_live | changing_VCPUs | changing_VCPUs_live | changing_NVRAM | assert_operation_valid | data_source_op | update_allowed_operations | make_into_template | import | export | metadata_export | reverting | destroy | create_vtpm | sysprep | unknown}]
    [-OtherConfig <KeyValuePair[string, string]>]
    [-Platform <KeyValuePair[string, string]>] [-BestEffort] [-SessionOpaqueRef <string>]
    [-WhatIf] [-Confirm] [<CommonParameters>]
Add-XenVM [-Uuid] <guid> [-PassThru] [-VCPUsParams <KeyValuePair[string, string]>]
    [-HVMBootParams <KeyValuePair[string, string]>]
    [-XenstoreData <KeyValuePair[string, string]>] [-Tags <string>]
    [-VCPUsParamsLive <KeyValuePair[string, string]>]
    [-NVRAM <KeyValuePair[string, string]>]
    [-BlockedOperations {snapshot | clone | copy | create_template | revert | checkpoint | snapshot_with_quiesce | provision | start | start_on | pause | unpause | clean_shutdown | clean_reboot | hard_shutdown | power_state_reset | hard_reboot | suspend | csvm | resume | resume_on | pool_migrate | migrate_send | get_boot_record | send_sysrq | send_trigger | query_services | shutdown | call_plugin | changing_memory_live | awaiting_memory_live | changing_dynamic_range | changing_static_range | changing_memory_limits | changing_shadow_memory | changing_shadow_memory_live | changing_VCPUs | changing_VCPUs_live | changing_NVRAM | assert_operation_valid | data_source_op | update_allowed_operations | make_into_template | import | export | metadata_export | reverting | destroy | create_vtpm | sysprep | unknown}]
    [-OtherConfig <KeyValuePair[string, string]>]
    [-Platform <KeyValuePair[string, string]>] [-BestEffort] [-SessionOpaqueRef <string>]
    [-WhatIf] [-Confirm] [<CommonParameters>]
Add-XenVM [-Name] <string> [-PassThru] [-VCPUsParams <KeyValuePair[string, string]>]
    [-HVMBootParams <KeyValuePair[string, string]>]
    [-XenstoreData <KeyValuePair[string, string]>] [-Tags <string>]
    [-VCPUsParamsLive <KeyValuePair[string, string]>]
    [-NVRAM <KeyValuePair[string, string]>]
    [-BlockedOperations {snapshot | clone | copy | create_template | revert | checkpoint | snapshot_with_quiesce | provision | start | start_on | pause | unpause | clean_shutdown | clean_reboot | hard_shutdown | power_state_reset | hard_reboot | suspend | csvm | resume | resume_on | pool_migrate | migrate_send | get_boot_record | send_sysrq | send_trigger | query_services | shutdown | call_plugin | changing_memory_live | awaiting_memory_live | changing_dynamic_range | changing_static_range | changing_memory_limits | changing_shadow_memory | changing_shadow_memory_live | changing_VCPUs | changing_VCPUs_live | changing_NVRAM | assert_operation_valid | data_source_op | update_allowed_operations | make_into_template | import | export | metadata_export | reverting | destroy | create_vtpm | sysprep | unknown}]
    [-OtherConfig <KeyValuePair[string, string]>]
    [-Platform <KeyValuePair[string, string]>] [-BestEffort] [-SessionOpaqueRef <string>]
    [-WhatIf] [-Confirm] [<CommonParameters>]

Description

Adds values to the collection-valued fields of a VM. Each optional parameter listed below corresponds to a field that can be added to.

Parameters

-Async

If set, the operation runs asynchronously and returns a Task object that can be used to track its progress. Available only for those fields whose underlying operation supports asynchronous invocation.
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

-BlockedOperations

Update list of operations which have been explicitly blocked and an error code
Attribute Value
Type KeyValuePair[vm_operations, string]
Required False
Position Named
Accepts pipeline input False
Accepted values snapshot, clone, copy, create_template, revert, checkpoint, snapshot_with_quiesce, provision, start, start_on, pause, unpause, clean_shutdown, clean_reboot, hard_shutdown, power_state_reset, hard_reboot, suspend, csvm, resume, resume_on, pool_migrate, migrate_send, get_boot_record, send_sysrq, send_trigger, query_services, shutdown, call_plugin, changing_memory_live, awaiting_memory_live, changing_dynamic_range, changing_static_range, changing_memory_limits, changing_shadow_memory, changing_shadow_memory_live, changing_VCPUs, changing_VCPUs_live, changing_NVRAM, assert_operation_valid, data_source_op, update_allowed_operations, make_into_template, import, export, metadata_export, reverting, destroy, create_vtpm, sysprep, unknown

-Confirm

Prompts for confirmation before running the cmdlet.
Attribute Value
Type SwitchParameter
Required False
Position Named
Accepts pipeline input False
Aliases cf

-HVMBootParams

Add the given key-value pair to the HVM/boot\_params field of the given VM.
Attribute Value
Type KeyValuePair[string, string]
Required False
Position Named
Accepts pipeline input False

-NVRAM

This parameter has no documentation.
Attribute Value
Type KeyValuePair[string, string]
Required False
Position Named
Accepts pipeline input False

-Name

The name of the VM to operate on.
Attribute Value
Type string
Required True
Position 0
Accepts pipeline input True (ByPropertyName)
Aliases name_label

-OtherConfig

Add the given key-value pair to the other\_config field of the given VM.
Attribute Value
Type KeyValuePair[string, string]
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

-Platform

Add the given key-value pair to the platform field of the given VM.
Attribute Value
Type KeyValuePair[string, string]
Required False
Position Named
Accepts pipeline input False

-Ref

The VM object to operate on, specified by its opaque reference.
Attribute Value
Type XenRef[VM]
Required True
Position 0
Accepts pipeline input True (ByPropertyName)
Aliases opaque_ref

-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

-Tags

Add the given value to the tags field of the given VM. If the value is already in that Set, then do nothing.
Attribute Value
Type string
Required False
Position Named
Accepts pipeline input False

-Uuid

The UUID of the VM to operate on.
Attribute Value
Type guid
Required True
Position 0
Accepts pipeline input True (ByPropertyName)

-VCPUsParams

Add the given key-value pair to the VCPUs/params field of the given VM.
Attribute Value
Type KeyValuePair[string, string]
Required False
Position Named
Accepts pipeline input False

-VCPUsParamsLive

Add the given key-value pair to VM.VCPUs\_params, and apply that value on the running VM
Attribute Value
Type KeyValuePair[string, string]
Required False
Position Named
Accepts pipeline input False

-VM

The VM object to operate on.
Attribute Value
Type VM
Required True
Position 0
Accepts pipeline input True (ByValue)

-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

-XenstoreData

Add the given key-value pair to the xenstore\_data field of the given VM.
Attribute Value
Type KeyValuePair[string, string]
Required False
Position Named
Accepts pipeline input False

Inputs

  • VM
  • XenRef[VM]
  • guid
  • string

Outputs

  • VM
  • Task
  • void

Examples

Example 1: Add to the VCPUsParams field

PS> $entry = [System.Collections.Generic.KeyValuePair[string,string]]::new("region", "emea")
PS> Add-XenVM -VCPUsParams $entry -Name "Demo VM"
Adds a value to the VCPUsParams field of a VM. The parameter takes one entry of the map; a hashtable does not bind to it.

Example 2: Add to the HVMBootParams field

PS> $entry = [System.Collections.Generic.KeyValuePair[string,string]]::new("region", "emea")
PS> Add-XenVM -HVMBootParams $entry -Name "Demo VM"
Adds a value to the HVMBootParams field of a VM. The parameter takes one entry of the map; a hashtable does not bind to it.

Example 3: Add to the XenstoreData field

PS> $entry = [System.Collections.Generic.KeyValuePair[string,string]]::new("region", "emea")
PS> Add-XenVM -XenstoreData $entry -Name "Demo VM"
Adds a value to the XenstoreData field of a VM. The parameter takes one entry of the map; a hashtable does not bind to it.
  • Class: VM
  • Using the XenServer PowerShell module