New-XenVMSS
Creates a new VMSS object.
Syntax
New-XenVMSS -HashTable <hashtable> [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>]
[-WhatIf] [-Confirm] [-Async] [<CommonParameters>]
New-XenVMSS -Record <VMSS> [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>]
[-WhatIf] [-Confirm] [-Async] [<CommonParameters>]
New-XenVMSS [-PassThru] [-NameLabel <string>] [-NameDescription <string>]
[-Enabled <bool>] [-Type {snapshot | checkpoint | snapshot_with_quiesce | unknown}]
[-RetainedSnapshots <long>] [-Frequency {hourly | daily | weekly | unknown}]
[-Schedule <hashtable>] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf]
[-Confirm] [-Async] [<CommonParameters>]
Description
Creates a new VMSS object.
VMSS: VM Snapshot Schedule.
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 |
-Enabled
enable or disable this snapshot schedule
| Attribute | Value |
|---|---|
| Type | bool |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Frequency
frequency of taking snapshot from snapshot schedule
| Attribute | Value |
|---|---|
| Type | vmss_frequency |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | hourly, daily, weekly, unknown |
-HashTable
A hashtable of field names to values, from which to create the VMSS.
| Attribute | Value |
|---|---|
| Type | hashtable |
| Required | True |
| Position | Named |
| Accepts pipeline input | False |
-NameDescription
a notes field containing human-readable description
| Attribute | Value |
|---|---|
| Type | string |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-NameLabel
a human-readable name
| Attribute | Value |
|---|---|
| Type | 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 |
-Record
An existing VMSS record whose fields are used to create the new object.
| Attribute | Value |
|---|---|
| Type | VMSS |
| Required | True |
| Position | Named |
| Accepts pipeline input | False |
-RetainedSnapshots
maximum number of snapshots that should be stored at any time
| Attribute | Value |
|---|---|
| Type | long |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
-Schedule
schedule of the snapshot containing 'hour', 'min', 'days'. Date/time-related information is in Local Timezone
| Attribute | Value |
|---|---|
| Type | hashtable |
| 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 |
-Type
type of the snapshot schedule
| Attribute | Value |
|---|---|
| Type | vmss_type |
| Required | False |
| Position | Named |
| Accepts pipeline input | False |
| Accepted values | snapshot, checkpoint, snapshot_with_quiesce, unknown |
-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
-
VMSS -
Task -
void
Examples
Example 1: Create a VMSS from a table of fields
PS> New-XenVMSS -HashTable @{ name_label = "Demo VMSS" } -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 VMSS.
Example 2: Create a VMSS from parameters
PS> New-XenVMSS -NameLabel "new value" -PassThru
The same thing with one parameter per field, which is the form that tab-completes. Get-Help New-XenVMSS -Full lists them all.
Example 3: Create a VMSS from an existing one
PS> $record = Get-XenVMSS | Select-Object -First 1
PS> New-XenVMSS -Record $record -PassThru
-Record takes a whole VMSS record, so an existing object can be used as the template for a new one.
Related links
-
Class: VMSS
-
Using the XenServer PowerShell module