From 836a40272ee7cbaf5ec5607389bbc4f96b7e31a8 Mon Sep 17 00:00:00 2001 From: "daniele.corsini@corsinvest.it" Date: Fri, 26 Apr 2024 20:54:33 +0200 Subject: [PATCH] Bump 8.2 --- .gitignore | 3 +- .../Corsinvest.ProxmoxVE.Api.psd1 | 28 +-- .../Corsinvest.ProxmoxVE.Api.psm1 | 223 +++++++++++++----- README.md | 3 + 4 files changed, 187 insertions(+), 70 deletions(-) diff --git a/.gitignore b/.gitignore index ea7951a..11a8b38 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -setKey.ps1 +doc/PowerSession.exe +doc/prep-video-commands.ps1 diff --git a/Corsinvest.ProxmoxVE.Api/Corsinvest.ProxmoxVE.Api.psd1 b/Corsinvest.ProxmoxVE.Api/Corsinvest.ProxmoxVE.Api.psd1 index d0b0e91..0d9b1ed 100644 --- a/Corsinvest.ProxmoxVE.Api/Corsinvest.ProxmoxVE.Api.psd1 +++ b/Corsinvest.ProxmoxVE.Api/Corsinvest.ProxmoxVE.Api.psd1 @@ -3,7 +3,7 @@ # # Generated by: Daniele Corsini # -# Generated on: 02/03/2024 +# Generated on: 26/04/2024 # @{ @@ -12,7 +12,7 @@ RootModule = 'Corsinvest.ProxmoxVE.Api.psm1' # Version number of this module. -ModuleVersion = '8.1.2' +ModuleVersion = '8.2.0' # Supported PSEditions # CompatiblePSEditions = @() @@ -70,17 +70,16 @@ PowerShellVersion = '6.0' # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = 'Build-PveDocumentation', 'Connect-PveCluster', - 'ConvertFrom-PveUnixTime', 'ConvertTo-PveUnixTime', 'Enter-PveSpice', - 'Get-PveAccess', 'Get-PveAccessAcl', 'Get-PveAccessDomains', - 'Get-PveAccessDomainsIdx', 'Get-PveAccessGroups', - 'Get-PveAccessGroupsIdx', 'Get-PveAccessOpenid', - 'Get-PveAccessPermissions', 'Get-PveAccessRoles', - 'Get-PveAccessRolesIdx', 'Get-PveAccessTfa', 'Get-PveAccessTfaIdx', - 'Get-PveAccessTicket', 'Get-PveAccessUsers', 'Get-PveAccessUsersIdx', - 'Get-PveAccessUsersTfa', 'Get-PveAccessUsersToken', - 'Get-PveAccessUsersTokenIdx', 'Get-PveCluster', 'Get-PveClusterAcme', - 'Get-PveClusterAcmeAccount', 'Get-PveClusterAcmeAccountIdx', - 'Get-PveClusterAcmeChallengeSchema', + 'ConvertFrom-PveUnixTime', 'ConvertTo-PveUnixTime', 'Get-PveAccess', + 'Get-PveAccessAcl', 'Get-PveAccessDomains', 'Get-PveAccessDomainsIdx', + 'Get-PveAccessGroups', 'Get-PveAccessGroupsIdx', + 'Get-PveAccessOpenid', 'Get-PveAccessPermissions', + 'Get-PveAccessRoles', 'Get-PveAccessRolesIdx', 'Get-PveAccessTfa', + 'Get-PveAccessTfaIdx', 'Get-PveAccessTicket', 'Get-PveAccessUsers', + 'Get-PveAccessUsersIdx', 'Get-PveAccessUsersTfa', + 'Get-PveAccessUsersToken', 'Get-PveAccessUsersTokenIdx', + 'Get-PveCluster', 'Get-PveClusterAcme', 'Get-PveClusterAcmeAccount', + 'Get-PveClusterAcmeAccountIdx', 'Get-PveClusterAcmeChallengeSchema', 'Get-PveClusterAcmeDirectories', 'Get-PveClusterAcmeMeta', 'Get-PveClusterAcmePlugins', 'Get-PveClusterAcmePluginsIdx', 'Get-PveClusterAcmeTos', 'Get-PveClusterBackup', @@ -205,6 +204,7 @@ FunctionsToExport = 'Build-PveDocumentation', 'Connect-PveCluster', 'Get-PveNodesServicesState', 'Get-PveNodesStatus', 'Get-PveNodesStorage', 'Get-PveNodesStorageContent', 'Get-PveNodesStorageContentIdx', 'Get-PveNodesStorageIdx', + 'Get-PveNodesStorageImportMetadata', 'Get-PveNodesStoragePrunebackups', 'Get-PveNodesStorageRrd', 'Get-PveNodesStorageRrddata', 'Get-PveNodesStorageStatus', 'Get-PveNodesSubscription', 'Get-PveNodesSyslog', 'Get-PveNodesTasks', @@ -214,7 +214,7 @@ FunctionsToExport = 'Build-PveDocumentation', 'Connect-PveCluster', 'Get-PveNodesVzdumpExtractconfig', 'Get-PvePools', 'Get-PvePoolsIdx', 'Get-PveStorage', 'Get-PveStorageIdx', 'Get-PveTaskIsRunning', 'Get-PveVersion', 'Get-PveVm', 'Get-PveVmSnapshot', 'Invoke-PveRestApi', - 'New-PveAccessDomains', 'New-PveAccessDomainsSync', + 'Invoke-PveSpice', 'New-PveAccessDomains', 'New-PveAccessDomainsSync', 'New-PveAccessGroups', 'New-PveAccessOpenidAuthUrl', 'New-PveAccessOpenidLogin', 'New-PveAccessRoles', 'New-PveAccessTfa', 'New-PveAccessTicket', 'New-PveAccessUsers', diff --git a/Corsinvest.ProxmoxVE.Api/Corsinvest.ProxmoxVE.Api.psm1 b/Corsinvest.ProxmoxVE.Api/Corsinvest.ProxmoxVE.Api.psm1 index 14d6081..ffaaf7d 100644 --- a/Corsinvest.ProxmoxVE.Api/Corsinvest.ProxmoxVE.Api.psm1 +++ b/Corsinvest.ProxmoxVE.Api/Corsinvest.ProxmoxVE.Api.psm1 @@ -422,7 +422,7 @@ DateTime. Return DateTime from Unix Time. } #endregion -Function Enter-PveSpice { +Function Invoke-PveSpice { <# .DESCRIPTION Enter Spice VM. @@ -595,7 +595,7 @@ Ticket data connection. .PARAMETER Node The Name of the node. .OUTPUTS -PSCustomObject. Return Vm Data. +PSCustomObject. Return Node/s data. #> [OutputType([PSCustomObject])] [CmdletBinding()] @@ -636,7 +636,7 @@ range 100:107,-105,200:204 '@all-???' for all VM/CT in specific host (e.g. @all-pve1, @all-\$(hostname)), '@all' for all VM/CT in cluster"; .OUTPUTS -PSCustomObject. Return Vm Data. +PSCustomObject. Return Vm/s data. #> [OutputType([PSCustomObject])] [CmdletBinding()] @@ -719,13 +719,10 @@ function VmCheckIdOrName #all vm in pool return $true } - Elseif($item.IndexOf("@tags-") -eq 0) + Elseif($item.IndexOf("@tag-") -eq 0 -and ($vm.tags + "").Split(",").Contains($item.Substring(6))) { - #tags - if(($vm.tags + "").Split(",").Contains($item.Substring(6))) - { - return $true - } + #all vm in tag + return $true } ElseIf($vm.name -like $item) { #name @@ -1110,6 +1107,7 @@ Set-Alias -Name Backup-PveVzdump -Value New-PveNodesVzdump -PassThru ## API AUTOGENERATED ## ####################### + function Get-PveCluster { <# @@ -2223,7 +2221,7 @@ Disable this target .PARAMETER FromAddress `From` address for the mail .PARAMETER Mailto -List of email recipients +List of email recipients .PARAMETER MailtoUser List of users .PARAMETER Mode @@ -4551,7 +4549,9 @@ Enable or disable the job. .PARAMETER Exclude Exclude specified guest systems (assumes --all) .PARAMETER ExcludePath -Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. +Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. +.PARAMETER Fleecing +Options for backup fleecing (VM only). .PARAMETER Id Job ID (will be autogenerated). .PARAMETER Ionice @@ -4559,9 +4559,9 @@ Set IO priority when using the BFQ scheduler. For snapshot and suspend mode back .PARAMETER Lockwait Maximal time to wait for the global lock (minutes). .PARAMETER Mailnotification -Deprecated':' use 'notification-policy' instead. Enum: always,failure +Deprecated':' use notification targets/matchers instead. Specify when to send a notification mail Enum: always,failure .PARAMETER Mailto -Comma-separated list of email addresses or users that should receive email notifications. Has no effect if the 'notification-target' option is set at the same time. +Deprecated':' Use notification targets/matchers instead. Comma-separated list of email addresses or users that should receive email notifications. .PARAMETER Maxfiles Deprecated':' use 'prune-backups' instead. Maximal number of backup files per guest system. .PARAMETER Mode @@ -4570,10 +4570,12 @@ Backup mode. Enum: snapshot,suspend,stop Only run if executed on this node. .PARAMETER NotesTemplate Template string for generating notes for the backup(s). It can contain variables which will be replaced by their values. Currently supported are {{cluster}}, {{guestname}}, {{node}}, and {{vmid}}, but more might be added in the future. Needs to be a single line, newline and backslash need to be escaped as '\n' and '\\' respectively. +.PARAMETER NotificationMode +Determine which notification system to use. If set to 'legacy-sendmail', vzdump will consider the mailto/mailnotification parameters and send emails to the specified address(es) via the 'sendmail' command. If set to 'notification-system', a notification will be sent via PVE's notification system, and the mailto and mailnotification will be ignored. If set to 'auto' (default setting), an email will be sent if mailto is set, and the notification system will be used if not. Enum: auto,legacy-sendmail,notification-system .PARAMETER NotificationPolicy -Specify when to send a notification Enum: always,failure,never +Deprecated':' Do not use Enum: always,failure,never .PARAMETER NotificationTarget -Determine the target to which notifications should be sent. Can either be a notification endpoint or a notification group. This option takes precedence over 'mailto', meaning that if both are set, the 'mailto' option will be ignored. +Deprecated':' Do not use .PARAMETER Performance Other performance-related settings. .PARAMETER Pigz @@ -4609,7 +4611,7 @@ Store temporary files to specified directory. .PARAMETER Vmid The ID of the guest system you want to backup. .PARAMETER Zstd -Zstd threads. N=0 uses half of the available cores, N>0 uses N as thread count. +Zstd threads. N=0 uses half of the available cores, if N is set to a value bigger than 0, N is used as thread count. .OUTPUTS PveResponse. Return response. #> @@ -4647,6 +4649,9 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [array]$ExcludePath, + [Parameter(ValueFromPipelineByPropertyName)] + [string]$Fleecing, + [Parameter(ValueFromPipelineByPropertyName)] [string]$Id, @@ -4676,6 +4681,10 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [string]$NotesTemplate, + [Parameter(ValueFromPipelineByPropertyName)] + [ValidateSet('auto','legacy-sendmail','notification-system')] + [string]$NotificationMode, + [Parameter(ValueFromPipelineByPropertyName)] [ValidateSet('always','failure','never')] [string]$NotificationPolicy, @@ -4749,6 +4758,7 @@ PveResponse. Return response. if($PSBoundParameters['Enabled']) { $parameters['enabled'] = $Enabled } if($PSBoundParameters['Exclude']) { $parameters['exclude'] = $Exclude } if($PSBoundParameters['ExcludePath']) { $parameters['exclude-path'] = $ExcludePath } + if($PSBoundParameters['Fleecing']) { $parameters['fleecing'] = $Fleecing } if($PSBoundParameters['Id']) { $parameters['id'] = $Id } if($PSBoundParameters['Ionice']) { $parameters['ionice'] = $Ionice } if($PSBoundParameters['Lockwait']) { $parameters['lockwait'] = $Lockwait } @@ -4758,6 +4768,7 @@ PveResponse. Return response. if($PSBoundParameters['Mode']) { $parameters['mode'] = $Mode } if($PSBoundParameters['Node']) { $parameters['node'] = $Node } if($PSBoundParameters['NotesTemplate']) { $parameters['notes-template'] = $NotesTemplate } + if($PSBoundParameters['NotificationMode']) { $parameters['notification-mode'] = $NotificationMode } if($PSBoundParameters['NotificationPolicy']) { $parameters['notification-policy'] = $NotificationPolicy } if($PSBoundParameters['NotificationTarget']) { $parameters['notification-target'] = $NotificationTarget } if($PSBoundParameters['Performance']) { $parameters['performance'] = $Performance } @@ -4863,7 +4874,9 @@ Enable or disable the job. .PARAMETER Exclude Exclude specified guest systems (assumes --all) .PARAMETER ExcludePath -Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. +Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. +.PARAMETER Fleecing +Options for backup fleecing (VM only). .PARAMETER Id The job ID. .PARAMETER Ionice @@ -4871,9 +4884,9 @@ Set IO priority when using the BFQ scheduler. For snapshot and suspend mode back .PARAMETER Lockwait Maximal time to wait for the global lock (minutes). .PARAMETER Mailnotification -Deprecated':' use 'notification-policy' instead. Enum: always,failure +Deprecated':' use notification targets/matchers instead. Specify when to send a notification mail Enum: always,failure .PARAMETER Mailto -Comma-separated list of email addresses or users that should receive email notifications. Has no effect if the 'notification-target' option is set at the same time. +Deprecated':' Use notification targets/matchers instead. Comma-separated list of email addresses or users that should receive email notifications. .PARAMETER Maxfiles Deprecated':' use 'prune-backups' instead. Maximal number of backup files per guest system. .PARAMETER Mode @@ -4882,10 +4895,12 @@ Backup mode. Enum: snapshot,suspend,stop Only run if executed on this node. .PARAMETER NotesTemplate Template string for generating notes for the backup(s). It can contain variables which will be replaced by their values. Currently supported are {{cluster}}, {{guestname}}, {{node}}, and {{vmid}}, but more might be added in the future. Needs to be a single line, newline and backslash need to be escaped as '\n' and '\\' respectively. +.PARAMETER NotificationMode +Determine which notification system to use. If set to 'legacy-sendmail', vzdump will consider the mailto/mailnotification parameters and send emails to the specified address(es) via the 'sendmail' command. If set to 'notification-system', a notification will be sent via PVE's notification system, and the mailto and mailnotification will be ignored. If set to 'auto' (default setting), an email will be sent if mailto is set, and the notification system will be used if not. Enum: auto,legacy-sendmail,notification-system .PARAMETER NotificationPolicy -Specify when to send a notification Enum: always,failure,never +Deprecated':' Do not use Enum: always,failure,never .PARAMETER NotificationTarget -Determine the target to which notifications should be sent. Can either be a notification endpoint or a notification group. This option takes precedence over 'mailto', meaning that if both are set, the 'mailto' option will be ignored. +Deprecated':' Do not use .PARAMETER Performance Other performance-related settings. .PARAMETER Pigz @@ -4921,7 +4936,7 @@ Store temporary files to specified directory. .PARAMETER Vmid The ID of the guest system you want to backup. .PARAMETER Zstd -Zstd threads. N=0 uses half of the available cores, N>0 uses N as thread count. +Zstd threads. N=0 uses half of the available cores, if N is set to a value bigger than 0, N is used as thread count. .OUTPUTS PveResponse. Return response. #> @@ -4962,6 +4977,9 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [array]$ExcludePath, + [Parameter(ValueFromPipelineByPropertyName)] + [string]$Fleecing, + [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string]$Id, @@ -4991,6 +5009,10 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [string]$NotesTemplate, + [Parameter(ValueFromPipelineByPropertyName)] + [ValidateSet('auto','legacy-sendmail','notification-system')] + [string]$NotificationMode, + [Parameter(ValueFromPipelineByPropertyName)] [ValidateSet('always','failure','never')] [string]$NotificationPolicy, @@ -5065,6 +5087,7 @@ PveResponse. Return response. if($PSBoundParameters['Enabled']) { $parameters['enabled'] = $Enabled } if($PSBoundParameters['Exclude']) { $parameters['exclude'] = $Exclude } if($PSBoundParameters['ExcludePath']) { $parameters['exclude-path'] = $ExcludePath } + if($PSBoundParameters['Fleecing']) { $parameters['fleecing'] = $Fleecing } if($PSBoundParameters['Ionice']) { $parameters['ionice'] = $Ionice } if($PSBoundParameters['Lockwait']) { $parameters['lockwait'] = $Lockwait } if($PSBoundParameters['Mailnotification']) { $parameters['mailnotification'] = $Mailnotification } @@ -5073,6 +5096,7 @@ PveResponse. Return response. if($PSBoundParameters['Mode']) { $parameters['mode'] = $Mode } if($PSBoundParameters['Node']) { $parameters['node'] = $Node } if($PSBoundParameters['NotesTemplate']) { $parameters['notes-template'] = $NotesTemplate } + if($PSBoundParameters['NotificationMode']) { $parameters['notification-mode'] = $NotificationMode } if($PSBoundParameters['NotificationPolicy']) { $parameters['notification-policy'] = $NotificationPolicy } if($PSBoundParameters['NotificationTarget']) { $parameters['notification-target'] = $NotificationTarget } if($PSBoundParameters['Performance']) { $parameters['performance'] = $Performance } @@ -6877,7 +6901,7 @@ The ID of the logical PCI mapping. .PARAMETER Map A list of maps for the cluster nodes. .PARAMETER Mdev --- +Marks the device(s) as being capable of providing mediated devices. .OUTPUTS PveResponse. Return response. #> @@ -6983,7 +7007,7 @@ The ID of the logical PCI mapping. .PARAMETER Map A list of maps for the cluster nodes. .PARAMETER Mdev --- +Marks the device(s) as being capable of providing mediated devices. .OUTPUTS PveResponse. Return response. #> @@ -9595,13 +9619,13 @@ Keyboard layout for VNC server. This option is generally not required and is oft .PARAMETER Kvm Enable/disable KVM hardware virtualization. .PARAMETER LiveRestore -Start the VM immediately from the backup and restore in background. PBS only. +Start the VM immediately while importing or restoring in the background. .PARAMETER Localtime Set the real time clock (RTC) to local time. This is enabled by default if the `ostype` indicates a Microsoft Windows OS. .PARAMETER Lock Lock/unlock the VM. Enum: backup,clone,create,migrate,rollback,snapshot,snapshot-delete,suspending,suspended .PARAMETER Machine -Specifies the QEMU machine type. +Specify the QEMU machine. .PARAMETER Memory Memory properties. .PARAMETER MigrateDowntime @@ -12592,7 +12616,7 @@ Set the real time clock (RTC) to local time. This is enabled by default if the ` .PARAMETER Lock Lock/unlock the VM. Enum: backup,clone,create,migrate,rollback,snapshot,snapshot-delete,suspending,suspended .PARAMETER Machine -Specifies the QEMU machine type. +Specify the QEMU machine. .PARAMETER Memory Memory properties. .PARAMETER MigrateDowntime @@ -13131,7 +13155,7 @@ Set the real time clock (RTC) to local time. This is enabled by default if the ` .PARAMETER Lock Lock/unlock the VM. Enum: backup,clone,create,migrate,rollback,snapshot,snapshot-delete,suspending,suspended .PARAMETER Machine -Specifies the QEMU machine type. +Specify the QEMU machine. .PARAMETER Memory Memory properties. .PARAMETER MigrateDowntime @@ -14010,7 +14034,7 @@ Ticket data connection. .PARAMETER ForceCpu Override QEMU's -cpu argument with the given string. .PARAMETER Machine -Specifies the QEMU machine type. +Specify the QEMU machine. .PARAMETER Migratedfrom The cluster node name. .PARAMETER MigrationNetwork @@ -14093,7 +14117,7 @@ function New-PveNodesQemuStatusStop { <# .DESCRIPTION -Stop virtual machine. The qemu process will exit immediately. Thisis akin to pulling the power plug of a running computer and may damage the VM data +Stop virtual machine. The qemu process will exit immediately. This is akin to pulling the power plug of a running computer and may damage the VM data. .PARAMETER PveTicket Ticket data connection. .PARAMETER Keepactive @@ -14102,6 +14126,8 @@ Do not deactivate storage volumes. The cluster node name. .PARAMETER Node The cluster node name. +.PARAMETER OverruleShutdown +Try to abort active 'qmshutdown' tasks before stopping. .PARAMETER Skiplock Ignore locks - only root is allowed to use this option. .PARAMETER Timeout @@ -14126,6 +14152,9 @@ PveResponse. Return response. [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string]$Node, + [Parameter(ValueFromPipelineByPropertyName)] + [switch]$OverruleShutdown, + [Parameter(ValueFromPipelineByPropertyName)] [switch]$Skiplock, @@ -14140,6 +14169,7 @@ PveResponse. Return response. $parameters = @{} if($PSBoundParameters['Keepactive']) { $parameters['keepActive'] = $Keepactive } if($PSBoundParameters['Migratedfrom']) { $parameters['migratedfrom'] = $Migratedfrom } + if($PSBoundParameters['OverruleShutdown']) { $parameters['overrule-shutdown'] = $OverruleShutdown } if($PSBoundParameters['Skiplock']) { $parameters['skiplock'] = $Skiplock } if($PSBoundParameters['Timeout']) { $parameters['timeout'] = $Timeout } @@ -14191,7 +14221,7 @@ function New-PveNodesQemuStatusShutdown { <# .DESCRIPTION -Shutdown virtual machine. This is similar to pressing the power button on a physical machine.This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown. +Shutdown virtual machine. This is similar to pressing the power button on a physical machine. This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown. .PARAMETER PveTicket Ticket data connection. .PARAMETER Forcestop @@ -16185,6 +16215,8 @@ Stop the container. This will abruptly stop all processes running in the contain Ticket data connection. .PARAMETER Node The cluster node name. +.PARAMETER OverruleShutdown +Try to abort active 'vzshutdown' tasks before stopping. .PARAMETER Skiplock Ignore locks - only root is allowed to use this option. .PARAMETER Vmid @@ -16201,6 +16233,9 @@ PveResponse. Return response. [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string]$Node, + [Parameter(ValueFromPipelineByPropertyName)] + [switch]$OverruleShutdown, + [Parameter(ValueFromPipelineByPropertyName)] [switch]$Skiplock, @@ -16210,6 +16245,7 @@ PveResponse. Return response. process { $parameters = @{} + if($PSBoundParameters['OverruleShutdown']) { $parameters['overrule-shutdown'] = $OverruleShutdown } if($PSBoundParameters['Skiplock']) { $parameters['skiplock'] = $Skiplock } return Invoke-PveRestApi -PveTicket $PveTicket -Method Create -Resource "/nodes/$Node/lxc/$Vmid/status/stop" -Parameters $parameters @@ -20366,15 +20402,17 @@ Store resulting files to specified directory. .PARAMETER Exclude Exclude specified guest systems (assumes --all) .PARAMETER ExcludePath -Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. +Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. +.PARAMETER Fleecing +Options for backup fleecing (VM only). .PARAMETER Ionice Set IO priority when using the BFQ scheduler. For snapshot and suspend mode backups of VMs, this only affects the compressor. A value of 8 means the idle priority is used, otherwise the best-effort priority is used with the specified value. .PARAMETER Lockwait Maximal time to wait for the global lock (minutes). .PARAMETER Mailnotification -Deprecated':' use 'notification-policy' instead. Enum: always,failure +Deprecated':' use notification targets/matchers instead. Specify when to send a notification mail Enum: always,failure .PARAMETER Mailto -Comma-separated list of email addresses or users that should receive email notifications. Has no effect if the 'notification-target' option is set at the same time. +Deprecated':' Use notification targets/matchers instead. Comma-separated list of email addresses or users that should receive email notifications. .PARAMETER Maxfiles Deprecated':' use 'prune-backups' instead. Maximal number of backup files per guest system. .PARAMETER Mode @@ -20383,10 +20421,12 @@ Backup mode. Enum: snapshot,suspend,stop Only run if executed on this node. .PARAMETER NotesTemplate Template string for generating notes for the backup(s). It can contain variables which will be replaced by their values. Currently supported are {{cluster}}, {{guestname}}, {{node}}, and {{vmid}}, but more might be added in the future. Needs to be a single line, newline and backslash need to be escaped as '\n' and '\\' respectively. +.PARAMETER NotificationMode +Determine which notification system to use. If set to 'legacy-sendmail', vzdump will consider the mailto/mailnotification parameters and send emails to the specified address(es) via the 'sendmail' command. If set to 'notification-system', a notification will be sent via PVE's notification system, and the mailto and mailnotification will be ignored. If set to 'auto' (default setting), an email will be sent if mailto is set, and the notification system will be used if not. Enum: auto,legacy-sendmail,notification-system .PARAMETER NotificationPolicy -Specify when to send a notification Enum: always,failure,never +Deprecated':' Do not use Enum: always,failure,never .PARAMETER NotificationTarget -Determine the target to which notifications should be sent. Can either be a notification endpoint or a notification group. This option takes precedence over 'mailto', meaning that if both are set, the 'mailto' option will be ignored. +Deprecated':' Do not use .PARAMETER Performance Other performance-related settings. .PARAMETER Pigz @@ -20418,7 +20458,7 @@ Store temporary files to specified directory. .PARAMETER Vmid The ID of the guest system you want to backup. .PARAMETER Zstd -Zstd threads. N=0 uses half of the available cores, N>0 uses N as thread count. +Zstd threads. N=0 uses half of the available cores, if N is set to a value bigger than 0, N is used as thread count. .OUTPUTS PveResponse. Return response. #> @@ -20447,6 +20487,9 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [array]$ExcludePath, + [Parameter(ValueFromPipelineByPropertyName)] + [string]$Fleecing, + [Parameter(ValueFromPipelineByPropertyName)] [int]$Ionice, @@ -20473,6 +20516,10 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [string]$NotesTemplate, + [Parameter(ValueFromPipelineByPropertyName)] + [ValidateSet('auto','legacy-sendmail','notification-system')] + [string]$NotificationMode, + [Parameter(ValueFromPipelineByPropertyName)] [ValidateSet('always','failure','never')] [string]$NotificationPolicy, @@ -20537,6 +20584,7 @@ PveResponse. Return response. if($PSBoundParameters['Dumpdir']) { $parameters['dumpdir'] = $Dumpdir } if($PSBoundParameters['Exclude']) { $parameters['exclude'] = $Exclude } if($PSBoundParameters['ExcludePath']) { $parameters['exclude-path'] = $ExcludePath } + if($PSBoundParameters['Fleecing']) { $parameters['fleecing'] = $Fleecing } if($PSBoundParameters['Ionice']) { $parameters['ionice'] = $Ionice } if($PSBoundParameters['Lockwait']) { $parameters['lockwait'] = $Lockwait } if($PSBoundParameters['Mailnotification']) { $parameters['mailnotification'] = $Mailnotification } @@ -20544,6 +20592,7 @@ PveResponse. Return response. if($PSBoundParameters['Maxfiles']) { $parameters['maxfiles'] = $Maxfiles } if($PSBoundParameters['Mode']) { $parameters['mode'] = $Mode } if($PSBoundParameters['NotesTemplate']) { $parameters['notes-template'] = $NotesTemplate } + if($PSBoundParameters['NotificationMode']) { $parameters['notification-mode'] = $NotificationMode } if($PSBoundParameters['NotificationPolicy']) { $parameters['notification-policy'] = $NotificationPolicy } if($PSBoundParameters['NotificationTarget']) { $parameters['notification-target'] = $NotificationTarget } if($PSBoundParameters['Performance']) { $parameters['performance'] = $Performance } @@ -23135,6 +23184,46 @@ PveResponse. Return response. } } +function Get-PveNodesStorageImportMetadata +{ +<# +.DESCRIPTION +Get the base parameters for creating a guest which imports data from a foreign importable guest, like an ESXi VM +.PARAMETER PveTicket +Ticket data connection. +.PARAMETER Node +The cluster node name. +.PARAMETER Storage +The storage identifier. +.PARAMETER Volume +Volume identifier for the guest archive/entry. +.OUTPUTS +PveResponse. Return response. +#> + [OutputType([PveResponse])] + [CmdletBinding()] + Param( + [Parameter(ValueFromPipelineByPropertyName)] + [PveTicket]$PveTicket, + + [Parameter(Mandatory,ValueFromPipelineByPropertyName)] + [string]$Node, + + [Parameter(Mandatory,ValueFromPipelineByPropertyName)] + [string]$Storage, + + [Parameter(Mandatory,ValueFromPipelineByPropertyName)] + [string]$Volume + ) + + process { + $parameters = @{} + if($PSBoundParameters['Volume']) { $parameters['volume'] = $Volume } + + return Invoke-PveRestApi -PveTicket $PveTicket -Method Get -Resource "/nodes/$Node/storage/$Storage/import-metadata" -Parameters $parameters + } +} + function Get-PveNodesDisks { <# @@ -24599,6 +24688,8 @@ Maximum number of tracked connections. Conntrack established timeout. .PARAMETER NfConntrackTcpTimeoutSynRecv Conntrack syn recv timeout. +.PARAMETER Nftables +Enable nftables based firewall (tech preview) .PARAMETER Node The cluster node name. .PARAMETER Nosmurfs @@ -24662,6 +24753,9 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [int]$NfConntrackTcpTimeoutSynRecv, + [Parameter(ValueFromPipelineByPropertyName)] + [switch]$Nftables, + [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string]$Node, @@ -24703,6 +24797,7 @@ PveResponse. Return response. if($PSBoundParameters['NfConntrackMax']) { $parameters['nf_conntrack_max'] = $NfConntrackMax } if($PSBoundParameters['NfConntrackTcpTimeoutEstablished']) { $parameters['nf_conntrack_tcp_timeout_established'] = $NfConntrackTcpTimeoutEstablished } if($PSBoundParameters['NfConntrackTcpTimeoutSynRecv']) { $parameters['nf_conntrack_tcp_timeout_syn_recv'] = $NfConntrackTcpTimeoutSynRecv } + if($PSBoundParameters['Nftables']) { $parameters['nftables'] = $Nftables } if($PSBoundParameters['Nosmurfs']) { $parameters['nosmurfs'] = $Nosmurfs } if($PSBoundParameters['ProtectionSynflood']) { $parameters['protection_synflood'] = $ProtectionSynflood } if($PSBoundParameters['ProtectionSynfloodBurst']) { $parameters['protection_synflood_burst'] = $ProtectionSynfloodBurst } @@ -25269,7 +25364,7 @@ The cluster node name. .PARAMETER StartallOnbootDelay Initial delay in seconds, before starting all the Virtual Guests with on-boot enabled. .PARAMETER Wakeonlan -MAC address for wake on LAN +Node specific wake on LAN settings. .OUTPUTS PveResponse. Return response. #> @@ -25834,7 +25929,7 @@ Creates a VNC Shell proxy. .PARAMETER PveTicket Ticket data connection. .PARAMETER Cmd -Run specific command or default to login (requires 'root@pam') Enum: ceph_install,login,upgrade +Run specific command or default to login (requires 'root@pam') Enum: upgrade,ceph_install,login .PARAMETER CmdOpts Add parameters to a command. Encoded as null terminated strings. .PARAMETER Height @@ -25855,7 +25950,7 @@ PveResponse. Return response. [PveTicket]$PveTicket, [Parameter(ValueFromPipelineByPropertyName)] - [ValidateSet('ceph_install','login','upgrade')] + [ValidateSet('upgrade','ceph_install','login')] [string]$Cmd, [Parameter(ValueFromPipelineByPropertyName)] @@ -25894,7 +25989,7 @@ Creates a VNC Shell proxy. .PARAMETER PveTicket Ticket data connection. .PARAMETER Cmd -Run specific command or default to login (requires 'root@pam') Enum: ceph_install,login,upgrade +Run specific command or default to login (requires 'root@pam') Enum: upgrade,ceph_install,login .PARAMETER CmdOpts Add parameters to a command. Encoded as null terminated strings. .PARAMETER Node @@ -25909,7 +26004,7 @@ PveResponse. Return response. [PveTicket]$PveTicket, [Parameter(ValueFromPipelineByPropertyName)] - [ValidateSet('ceph_install','login','upgrade')] + [ValidateSet('upgrade','ceph_install','login')] [string]$Cmd, [Parameter(ValueFromPipelineByPropertyName)] @@ -25977,7 +26072,7 @@ Creates a SPICE shell. .PARAMETER PveTicket Ticket data connection. .PARAMETER Cmd -Run specific command or default to login (requires 'root@pam') Enum: ceph_install,login,upgrade +Run specific command or default to login (requires 'root@pam') Enum: upgrade,ceph_install,login .PARAMETER CmdOpts Add parameters to a command. Encoded as null terminated strings. .PARAMETER Node @@ -25994,7 +26089,7 @@ PveResponse. Return response. [PveTicket]$PveTicket, [Parameter(ValueFromPipelineByPropertyName)] - [ValidateSet('ceph_install','login','upgrade')] + [ValidateSet('upgrade','ceph_install','login')] [string]$Cmd, [Parameter(ValueFromPipelineByPropertyName)] @@ -26547,7 +26642,7 @@ Storage index. .PARAMETER PveTicket Ticket data connection. .PARAMETER Type -Only list storage of specific type Enum: btrfs,cephfs,cifs,dir,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,pbs,rbd,zfs,zfspool +Only list storage of specific type Enum: btrfs,cephfs,cifs,dir,esxi,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,pbs,rbd,zfs,zfspool .OUTPUTS PveResponse. Return response. #> @@ -26558,7 +26653,7 @@ PveResponse. Return response. [PveTicket]$PveTicket, [Parameter(ValueFromPipelineByPropertyName)] - [ValidateSet('btrfs','cephfs','cifs','dir','glusterfs','iscsi','iscsidirect','lvm','lvmthin','nfs','pbs','rbd','zfs','zfspool')] + [ValidateSet('btrfs','cephfs','cifs','dir','esxi','glusterfs','iscsi','iscsidirect','lvm','lvmthin','nfs','pbs','rbd','zfs','zfspool')] [string]$Type ) @@ -26644,7 +26739,7 @@ Namespace. .PARAMETER Nocow Set the NOCOW flag on files. Disables data checksumming and causes data errors to be unrecoverable from while allowing direct I/O. Only use this if data does not need to be any more safe than on a single ext4 formatted disk with no underlying raid system. .PARAMETER Nodes -List of cluster node names. +List of nodes for which the storage configuration applies. .PARAMETER Nowritecache disable write caching on the target .PARAMETER Options @@ -26674,7 +26769,9 @@ Backup volfile server IP or DNS name. .PARAMETER Share CIFS share. .PARAMETER Shared -Mark storage as shared. +Indicate that this is a single storage with the same contents on all nodes (or all listed in the 'nodes' option). It will not make the contents of a local storage automatically accessible to other nodes, it just marks an already shared storage as such! +.PARAMETER SkipCertVerification +Disable TLS certificate verification, only enable on fully trusted networks! .PARAMETER Smbversion SMB protocol version. 'default' if not set, negotiates the highest SMB2+ version supported by both the client and server. Enum: default,2.0,2.1,3,3.0,3.11 .PARAMETER Sparse @@ -26692,7 +26789,7 @@ LVM thin pool LV name. .PARAMETER Transport Gluster transport':' tcp or rdma Enum: tcp,rdma,unix .PARAMETER Type -Storage type. Enum: btrfs,cephfs,cifs,dir,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,pbs,rbd,zfs,zfspool +Storage type. Enum: btrfs,cephfs,cifs,dir,esxi,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,pbs,rbd,zfs,zfspool .PARAMETER Username RBD Id. .PARAMETER Vgname @@ -26856,6 +26953,9 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [switch]$Shared, + [Parameter(ValueFromPipelineByPropertyName)] + [switch]$SkipCertVerification, + [Parameter(ValueFromPipelineByPropertyName)] [ValidateSet('default','2.0','2.1','3','3.0','3.11')] [string]$Smbversion, @@ -26883,7 +26983,7 @@ PveResponse. Return response. [string]$Transport, [Parameter(Mandatory,ValueFromPipelineByPropertyName)] - [ValidateNotNullOrEmpty()][ValidateSet('btrfs','cephfs','cifs','dir','glusterfs','iscsi','iscsidirect','lvm','lvmthin','nfs','pbs','rbd','zfs','zfspool')] + [ValidateNotNullOrEmpty()][ValidateSet('btrfs','cephfs','cifs','dir','esxi','glusterfs','iscsi','iscsidirect','lvm','lvmthin','nfs','pbs','rbd','zfs','zfspool')] [string]$Type, [Parameter(ValueFromPipelineByPropertyName)] @@ -26947,6 +27047,7 @@ PveResponse. Return response. if($PSBoundParameters['Server2']) { $parameters['server2'] = $Server2 } if($PSBoundParameters['Share']) { $parameters['share'] = $Share } if($PSBoundParameters['Shared']) { $parameters['shared'] = $Shared } + if($PSBoundParameters['SkipCertVerification']) { $parameters['skip-cert-verification'] = $SkipCertVerification } if($PSBoundParameters['Smbversion']) { $parameters['smbversion'] = $Smbversion } if($PSBoundParameters['Sparse']) { $parameters['sparse'] = $Sparse } if($PSBoundParameters['Storage']) { $parameters['storage'] = $Storage } @@ -27086,7 +27187,7 @@ Namespace. .PARAMETER Nocow Set the NOCOW flag on files. Disables data checksumming and causes data errors to be unrecoverable from while allowing direct I/O. Only use this if data does not need to be any more safe than on a single ext4 formatted disk with no underlying raid system. .PARAMETER Nodes -List of cluster node names. +List of nodes for which the storage configuration applies. .PARAMETER Nowritecache disable write caching on the target .PARAMETER Options @@ -27110,7 +27211,9 @@ Server IP or DNS name. .PARAMETER Server2 Backup volfile server IP or DNS name. .PARAMETER Shared -Mark storage as shared. +Indicate that this is a single storage with the same contents on all nodes (or all listed in the 'nodes' option). It will not make the contents of a local storage automatically accessible to other nodes, it just marks an already shared storage as such! +.PARAMETER SkipCertVerification +Disable TLS certificate verification, only enable on fully trusted networks! .PARAMETER Smbversion SMB protocol version. 'default' if not set, negotiates the highest SMB2+ version supported by both the client and server. Enum: default,2.0,2.1,3,3.0,3.11 .PARAMETER Sparse @@ -27264,6 +27367,9 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [switch]$Shared, + [Parameter(ValueFromPipelineByPropertyName)] + [switch]$SkipCertVerification, + [Parameter(ValueFromPipelineByPropertyName)] [ValidateSet('default','2.0','2.1','3','3.0','3.11')] [string]$Smbversion, @@ -27333,6 +27439,7 @@ PveResponse. Return response. if($PSBoundParameters['Server']) { $parameters['server'] = $Server } if($PSBoundParameters['Server2']) { $parameters['server2'] = $Server2 } if($PSBoundParameters['Shared']) { $parameters['shared'] = $Shared } + if($PSBoundParameters['SkipCertVerification']) { $parameters['skip-cert-verification'] = $SkipCertVerification } if($PSBoundParameters['Smbversion']) { $parameters['smbversion'] = $Smbversion } if($PSBoundParameters['Sparse']) { $parameters['sparse'] = $Sparse } if($PSBoundParameters['Subdir']) { $parameters['subdir'] = $Subdir } @@ -29079,7 +29186,7 @@ When responding to a u2f challenge':' the original challenge string .PARAMETER Description A description to distinguish multiple entries from one another .PARAMETER Password -The current password. +The current password of the user performing the change. .PARAMETER Totp A totp URI. .PARAMETER Type @@ -29143,7 +29250,7 @@ Ticket data connection. .PARAMETER Id A TFA entry id. .PARAMETER Password -The current password. +The current password of the user performing the change. .PARAMETER Userid Full User ID, in the `name@realm` format. .OUTPUTS @@ -29219,7 +29326,7 @@ Whether the entry should be enabled for login. .PARAMETER Id A TFA entry id. .PARAMETER Password -The current password. +The current password of the user performing the change. .PARAMETER Userid Full User ID, in the `name@realm` format. .OUTPUTS @@ -29358,6 +29465,8 @@ function Set-PveAccessPassword Change user password. .PARAMETER PveTicket Ticket data connection. +.PARAMETER ConfirmationPassword +The current password of the user performing the change. .PARAMETER Password The new password. .PARAMETER Userid @@ -29371,6 +29480,9 @@ PveResponse. Return response. [Parameter(ValueFromPipelineByPropertyName)] [PveTicket]$PveTicket, + [Parameter(ValueFromPipelineByPropertyName)] + [SecureString]$ConfirmationPassword, + [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [SecureString]$Password, @@ -29380,6 +29492,7 @@ PveResponse. Return response. process { $parameters = @{} + if($PSBoundParameters['ConfirmationPassword']) { $parameters['confirmation-password'] = (ConvertFrom-SecureString -SecureString $ConfirmationPassword -AsPlainText) } if($PSBoundParameters['Password']) { $parameters['password'] = (ConvertFrom-SecureString -SecureString $Password -AsPlainText) } if($PSBoundParameters['Userid']) { $parameters['userid'] = $Userid } diff --git a/README.md b/README.md index f7fa0e1..93b1af9 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,9 @@ this is a CmdLet for PowerShell to manage Proxmox VE. [Tutorial interactive in VSCode notebook](https://tinyurl.com/cv4pve-api-pwsh-learn) +## Video + + ## Requirement Minimum version requirement for Powershell is 6.0