Set-XenHost
Sets fields of a Host object.
Syntax
Set-XenHost [-XenHost] <Host> [-PassThru] [-NameLabel <string>]
[-NameDescription <string>] [-OtherConfig <hashtable>] [-Logging <hashtable>]
[-SuspendImageSr <XenRef[SR]>] [-CrashDumpSr <XenRef[SR]>] [-Hostname <string>]
[-Address <string>] [-Tags <string[]>] [-LicenseServer <hashtable>]
[-GuestVCPUsParams <hashtable>]
[-Display {enabled | disable_on_reboot | disabled | enable_on_reboot | unknown}]
[-HostnameLive <string>] [-PowerOnMode <KeyValuePair[string, hashtable]>]
[-CpuFeatures <string>] [-SslLegacy <bool>] [-IscsiIqn <string>]
[-Multipathing <bool>] [-UefiCertificates <string>]
[-SchedGran {core | cpu | socket | unknown}]
[-NumaAffinityPolicy {any | best_effort | default_policy | unknown}]
[-HttpsOnly <bool>] [-SshEnabledTimeout <long>] [-ConsoleIdleTimeout <long>]
[-SshAutoMode <bool>] [-MaxCstate <string>]
[-NtpMode {DHCP | Custom | Factory | Disabled | unknown}]
[-NtpCustomServers <string[]>] [-Timezone <string>] [-Servertime <DateTime>]
[-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-XenHost [-Ref] <XenRef[Host]> [-PassThru] [-NameLabel <string>]
[-NameDescription <string>] [-OtherConfig <hashtable>] [-Logging <hashtable>]
[-SuspendImageSr <XenRef[SR]>] [-CrashDumpSr <XenRef[SR]>] [-Hostname <string>]
[-Address <string>] [-Tags <string[]>] [-LicenseServer <hashtable>]
[-GuestVCPUsParams <hashtable>]
[-Display {enabled | disable_on_reboot | disabled | enable_on_reboot | unknown}]
[-HostnameLive <string>] [-PowerOnMode <KeyValuePair[string, hashtable]>]
[-CpuFeatures <string>] [-SslLegacy <bool>] [-IscsiIqn <string>]
[-Multipathing <bool>] [-UefiCertificates <string>]
[-SchedGran {core | cpu | socket | unknown}]
[-NumaAffinityPolicy {any | best_effort | default_policy | unknown}]
[-HttpsOnly <bool>] [-SshEnabledTimeout <long>] [-ConsoleIdleTimeout <long>]
[-SshAutoMode <bool>] [-MaxCstate <string>]
[-NtpMode {DHCP | Custom | Factory | Disabled | unknown}]
[-NtpCustomServers <string[]>] [-Timezone <string>] [-Servertime <DateTime>]
[-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-XenHost [-Uuid] <guid> [-PassThru] [-NameLabel <string>] [-NameDescription <string>]
[-OtherConfig <hashtable>] [-Logging <hashtable>] [-SuspendImageSr <XenRef[SR]>]
[-CrashDumpSr <XenRef[SR]>] [-Hostname <string>] [-Address <string>]
[-Tags <string[]>] [-LicenseServer <hashtable>] [-GuestVCPUsParams <hashtable>]
[-Display {enabled | disable_on_reboot | disabled | enable_on_reboot | unknown}]
[-HostnameLive <string>] [-PowerOnMode <KeyValuePair[string, hashtable]>]
[-CpuFeatures <string>] [-SslLegacy <bool>] [-IscsiIqn <string>]
[-Multipathing <bool>] [-UefiCertificates <string>]
[-SchedGran {core | cpu | socket | unknown}]
[-NumaAffinityPolicy {any | best_effort | default_policy | unknown}]
[-HttpsOnly <bool>] [-SshEnabledTimeout <long>] [-ConsoleIdleTimeout <long>]
[-SshAutoMode <bool>] [-MaxCstate <string>]
[-NtpMode {DHCP | Custom | Factory | Disabled | unknown}]
[-NtpCustomServers <string[]>] [-Timezone <string>] [-Servertime <DateTime>]
[-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-XenHost [-Name] <string> [-PassThru] [-NameLabel <string>] [-NameDescription <string>]
[-OtherConfig <hashtable>] [-Logging <hashtable>] [-SuspendImageSr <XenRef[SR]>]
[-CrashDumpSr <XenRef[SR]>] [-Hostname <string>] [-Address <string>]
[-Tags <string[]>] [-LicenseServer <hashtable>] [-GuestVCPUsParams <hashtable>]
[-Display {enabled | disable_on_reboot | disabled | enable_on_reboot | unknown}]
[-HostnameLive <string>] [-PowerOnMode <KeyValuePair[string, hashtable]>]
[-CpuFeatures <string>] [-SslLegacy <bool>] [-IscsiIqn <string>]
[-Multipathing <bool>] [-UefiCertificates <string>]
[-SchedGran {core | cpu | socket | unknown}]
[-NumaAffinityPolicy {any | best_effort | default_policy | unknown}]
[-HttpsOnly <bool>] [-SshEnabledTimeout <long>] [-ConsoleIdleTimeout <long>]
[-SshAutoMode <bool>] [-MaxCstate <string>]
[-NtpMode {DHCP | Custom | Factory | Disabled | unknown}]
[-NtpCustomServers <string[]>] [-Timezone <string>] [-Servertime <DateTime>]
[-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [<CommonParameters>]
Description
Changes writable fields of a Host. Each optional parameter listed below corresponds to a field that can be set.
Parameters
-Address
Set the address field of the given host.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-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 |
-Confirm
Prompts for confirmation before running the cmdlet.
| Attribute | Value |
|---|---|
| Type | SwitchParameter |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Aliases | cf |
-ConsoleIdleTimeout
Set the console idle timeout for the host
| Attribute | Value |
|---|---|
| Type | long |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-CpuFeatures
Set the CPU features to be used after a reboot, if the given features string is valid.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-CrashDumpSr
Set the crash\_dump\_sr field of the given host.
| Attribute | Value |
|---|---|
| Type | XenRef[SR] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Display
Set the display field of the given host.
| Attribute | Value |
|---|---|
| Type | host_display |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | enabled, disable_on_reboot, disabled, enable_on_reboot, unknown |
-GuestVCPUsParams
Set the guest\_VCPUs\_params field of the given host.
| Attribute | Value |
|---|---|
| Type | hashtable |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Hostname
Set the hostname field of the given host.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-HostnameLive
Sets the host name to the specified string. Both the API and lower-level system hostname are changed immediately.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-HttpsOnly
updates the host firewall to open or close port 80 depending on the value
| Attribute | Value |
|---|---|
| Type | bool |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-IscsiIqn
Sets the initiator IQN for the host
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-LicenseServer
Set the license\_server field of the given host.
| Attribute | Value |
|---|---|
| Type | hashtable |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Logging
Set the logging field of the given host.
| Attribute | Value |
|---|---|
| Type | hashtable |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-MaxCstate
Sets xen's max-cstate on a host. See: https://xenbits.xen.org/docs/unstable/misc/xen-command-line.html#max_cstate-x86. "" means unlimited; "N" means limit to CN; "N,M" means limit to CN with max sub cstate M. Note: Only C0, C1, unlimited are supported currently.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Multipathing
Specifies whether multipathing is enabled
| Attribute | Value |
|---|---|
| Type | bool |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Name
The name of the Host to operate on.
| Attribute | Value |
|---|---|
| Type | string |
| Required | True |
| Position | 0 |
| Accepts pipeline input | True (ByPropertyName) |
| Aliases | name_label |
-NameDescription
Set the name/description field of the given host.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-NameLabel
Set the name/label field of the given host.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-NtpCustomServers
Set the custom NTP servers for the host
| Attribute | Value |
|---|---|
| Type | string[] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-NtpMode
Set the NTP mode for the host
| Attribute | Value |
|---|---|
| Type | host_ntp_mode |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | DHCP, Custom, Factory, Disabled, unknown |
-NumaAffinityPolicy
Set VM placement NUMA affinity policy
| Attribute | Value |
|---|---|
| Type | host_numa_affinity_policy |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | any, best_effort, default_policy, unknown |
-OtherConfig
Set the other\_config field of the given host.
| 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 |
-PowerOnMode
Set the power-on-mode, host, user and password
| Attribute | Value |
|---|---|
| Type | KeyValuePair[string, hashtable] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Ref
The Host object to operate on, specified by its opaque reference.
| Attribute | Value |
|---|---|
| Type | XenRef[Host] |
| Required | True |
| Position | 0 |
| Accepts pipeline input | True (ByPropertyName) |
| Aliases | opaque_ref |
-SchedGran
Sets xen's sched-gran on a host. See: https://xenbits.xen.org/docs/unstable/misc/xen-command-line.html#sched-gran-x86
| Attribute | Value |
|---|---|
| Type | host_sched_gran |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | core, cpu, socket, unknown |
-Servertime
Set the host's system clock when NTP is disabled.
| Attribute | Value |
|---|---|
| Type | DateTime |
| Required | False |
| 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 |
-SshAutoMode
Set the SSH auto mode for the host
| Attribute | Value |
|---|---|
| Type | bool |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-SshEnabledTimeout
Set the SSH service enabled timeout for the host
| Attribute | Value |
|---|---|
| Type | long |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-SslLegacy
Enable/disable SSLv3 for interoperability with older server versions. When this is set to a different value, the host immediately restarts its SSL/TLS listening service; typically this takes less than a second but existing connections to it will be broken. API login sessions will remain valid.
| Attribute | Value |
|---|---|
| Type | bool |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-SuspendImageSr
Set the suspend\_image\_sr field of the given host.
| Attribute | Value |
|---|---|
| Type | XenRef[SR] |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Timezone
Set the host's timezone.
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-UefiCertificates
Sets the UEFI certificates on a host
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Uuid
The UUID of the Host to operate on.
| Attribute | Value |
|---|---|
| Type | guid |
| Required | True |
| Position | 0 |
| Accepts pipeline input | True (ByPropertyName) |
-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 |
-XenHost
The Host object to operate on.
| Attribute | Value |
|---|---|
| Type | Host |
| Required | True |
| Position | 0 |
| Accepts pipeline input | True (ByValue) |
Inputs
-
Host -
XenRef[Host] -
guid -
string
Outputs
-
Host -
Task -
void
Examples
Example 1: Set the NameLabel field
PS> Get-XenHost -Name "Demo Host" | Set-XenHost -NameLabel "new value"
Sets the NameLabel field of a Host.
Example 2: Set the NameDescription field
PS> Get-XenHost -Name "Demo Host" | Set-XenHost -NameDescription "new value"
Sets the NameDescription field of a Host.
Example 3: Set the OtherConfig field
PS> Get-XenHost -Name "Demo Host" | Set-XenHost -OtherConfig @{ "key" = "value" }
Sets the OtherConfig field of a Host.
Related links
-
Class: Host
-
Using the XenServer PowerShell module