Skip to content

New-PveStorage

Create a new storage.

API: POST /storage, Proxmox VE API viewer

New-PveStorage
[-PveTicket <PveTicket>]
[-Authsupported <string>]
[-Base <string>]
[-Blocksize <string>]
[-Bwlimit <string>]
[-ComstarHg <string>]
[-ComstarTg <string>]
[-Content <string>]
[-ContentDirs <string>]
[-CreateBasePath <bool>]
[-CreateSubdirs <bool>]
[-DataPool <string>]
[-Datastore <string>]
[-Disable <bool>]
[-Domain <string>]
[-EncryptionKey <string>]
[-Export <string>]
[-Fingerprint <string>]
[-Format <string>]
[-FsName <string>]
[-Fuse <bool>]
[-IsMountpoint <string>]
[-Iscsiprovider <string>]
[-Keyring <string>]
[-Krbd <bool>]
[-LioTpg <string>]
[-MasterPubkey <string>]
[-MaxProtectedBackups <int>]
[-Mkdir <bool>]
[-Monhost <string>]
[-Mountpoint <string>]
[-Namespace <string>]
[-Nocow <bool>]
[-Nodes <string>]
[-Nowritecache <bool>]
[-Options <string>]
[-Password <SecureString>]
[-Path <string>]
[-Pool <string>]
[-Port <int>]
[-Portal <string>]
[-Preallocation <string>]
[-PruneBackups <string>]
[-Saferemove <bool>]
[-SaferemoveStepsize <int>]
[-SaferemoveThroughput <string>]
[-Server <string>]
[-Share <string>]
[-Shared <bool>]
[-SkipCertVerification <bool>]
[-Smbversion <string>]
[-SnapshotAsVolumeChain <bool>]
[-Sparse <bool>]
-Storage <string>
[-Subdir <string>]
[-TaggedOnly <bool>]
[-Target <string>]
[-Thinpool <string>]
-Type <string>
[-Username <string>]
[-Vgname <string>]
[-ZfsBasePath <string>]
[<CommonParameters>]
Parameter Type Required Description
-PveTicket PveTicket No Ticket data connection.
-Authsupported string No Authsupported.
-Base string No Base volume. This volume is automatically activated.
-Blocksize string No ZFS block size.
-Bwlimit string No Set I/O bandwidth limit for various operations (in KiB/s).
-ComstarHg string No host group for comstar views.
-ComstarTg string No target group for comstar views.
-Content string No Allowed content types. NOTE: the value ‘rootdir’ is used for Containers, and value ‘images’ for VMs.
-ContentDirs string No Overrides for default content type directories.
-CreateBasePath bool No Create the base directory if it doesn’t exist.
-CreateSubdirs bool No Populate the directory with the default structure.
-DataPool string No Data Pool (for erasure coding only)
-Datastore string No Proxmox Backup Server datastore name.
-Disable bool No Flag to disable the storage.
-Domain string No CIFS domain.
-EncryptionKey string No Encryption key. Use ‘autogen’ to generate one automatically without passphrase.
-Export string No NFS export path.
-Fingerprint string No Certificate SHA 256 fingerprint.
-Format string No Default image format. Values: raw, qcow2, subvol, vmdk.
-FsName string No The Ceph filesystem name.
-Fuse bool No Mount CephFS through FUSE.
-IsMountpoint string No Assume the given path is an externally managed mountpoint and consider the storage offline if it is not mounted. Using a boolean (yes/no) value serves as a shortcut to using the target path in this field.
-Iscsiprovider string No iscsi provider.
-Keyring string No Client keyring contents (for external clusters).
-Krbd bool No Always access rbd through krbd kernel module.
-LioTpg string No target portal group for Linux LIO targets.
-MasterPubkey string No Base64-encoded, PEM-formatted public RSA key. Used to encrypt a copy of the encryption-key which will be added to each encrypted backup.
-MaxProtectedBackups int No Maximal number of protected backups per guest. Use ‘-1’ for unlimited.
-Mkdir bool No Create the directory if it doesn’t exist and populate it with default sub-dirs. NOTE: Deprecated, use the ‘create-base-path’ and ‘create-subdirs’ options instead.
-Monhost string No IP addresses of monitors (for external clusters).
-Mountpoint string No mount point.
-Namespace string No Namespace.
-Nocow bool No 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.
-Nodes string No List of nodes for which the storage configuration applies.
-Nowritecache bool No disable write caching on the target.
-Options string No NFS/CIFS mount options (see ‘man nfs’ or ‘man mount.cifs’)
-Password SecureString No Password for accessing the share/datastore.
-Path string No File system path.
-Pool string No Pool.
-Port int No Use this port to connect to the storage instead of the default one (for example, with PBS or ESXi). For NFS and CIFS, use the ‘options’ option to configure the port via the mount options.
-Portal string No iSCSI portal (IP or DNS name with optional port).
-Preallocation string No Preallocation mode for raw and qcow2 images. Using ‘metadata’ on raw images results in preallocation=off. Values: off, metadata, falloc, full.
-PruneBackups string No The retention options with shorter intervals are processed first with --keep-last being the very first one. Each option covers a specific period of time. We say that backups within this period are covered by this option. The next option does not take care of already covered backups and only considers older backups.
-Saferemove bool No Zero-out data when removing LVs.
-SaferemoveStepsize int No Wipe step size in MiB. It will be capped to the maximum supported by the storage. Values: 1, 2, 4, 8, 16, 32.
-SaferemoveThroughput string No Wipe throughput (cstream -t parameter value).
-Server string No Server IP or DNS name.
-Share string No CIFS share.
-Shared bool No 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!
-SkipCertVerification bool No Disable TLS certificate verification, only enable on fully trusted networks!
-Smbversion string No SMB protocol version. ‘default’ if not set, negotiates the highest SMB2+ version supported by both the client and server. Values: default, 2.0, 2.1, 3, 3.0, 3.11.
-SnapshotAsVolumeChain bool No Enable support for creating storage-vendor agnostic snapshot through volume backing-chains.
-Sparse bool No use sparse volumes.
-Storage string Yes The storage identifier.
-Subdir string No Subdir to mount.
-TaggedOnly bool No Only list logical volumes tagged with ‘pve-vm-ID’.
-Target string No iSCSI target.
-Thinpool string No LVM thin pool LV name.
-Type string Yes Storage type. Values: btrfs, cephfs, cifs, dir, esxi, iscsi, iscsidirect, lvm, lvmthin, nfs, pbs, rbd, zfs, zfspool.
-Username string No RBD Id.
-Vgname string No Volume group name.
-ZfsBasePath string No Base path where to look for the created ZFS block devices. Set automatically during creation if not specified. Usually ‘/dev/zvol’.

Every parameter also binds by property name from the pipeline, so an object with node and vmid properties (the output of Get-PveGuest, for one) fills -Node and -Vmid. Without -PveTicket the cmdlet uses the last connection, see Connection.

A PveResponse: the data returned by Proxmox VE is in .Response.data, the outcome in .IsSuccessStatusCode. See Results and Errors.