New-PveNodesLxc
Create or restore a container.
API: POST /nodes/{node}/lxc, Proxmox VE API viewer
Aliases: New-PveLxc
Syntax
Section titled “Syntax”New-PveNodesLxc [-PveTicket <PveTicket>] [-Arch <string>] [-Bwlimit <float>] [-Cmode <string>] [-Console <bool>] [-Cores <int>] [-Cpulimit <float>] [-Cpuunits <int>] [-Debug_ <bool>] [-Description <string>] [-DevN <hashtable>] [-Entrypoint <string>] [-Env <string>] [-Features <string>] [-Force <bool>] [-HaManaged <bool>] [-Hookscript <string>] [-Hostname <string>] [-IgnoreUnpackErrors <bool>] [-Lock <string>] [-Memory <int>] [-MpN <hashtable>] [-Nameserver <string>] [-NetN <hashtable>] -Node <string> [-Onboot <bool>] -Ostemplate <string> [-Ostype <string>] [-Password <SecureString>] [-Pool <string>] [-Protection <bool>] [-Restore <bool>] [-Rootfs <string>] [-Searchdomain <string>] [-SshPublicKeys <string>] [-Start <bool>] [-Startup <string>] [-Storage <string>] [-Swap <int>] [-Tags <string>] [-Template <bool>] [-Timezone <string>] [-Tty <int>] [-Unique <bool>] [-Unprivileged <bool>] [-UnusedN <hashtable>] -Vmid <int> [<CommonParameters>]Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
-PveTicket |
PveTicket |
No | Ticket data connection. |
-Arch |
string |
No | OS architecture type. Values: amd64, i386, arm64, armhf, riscv32, riscv64. |
-Bwlimit |
float |
No | Override I/O bandwidth limit (in KiB/s). |
-Cmode |
string |
No | Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to ‘console’ it tries to attach to /dev/console instead. If you set cmode to ‘shell’, it simply invokes a shell inside the container (no login). Values: shell, console, tty. |
-Console |
bool |
No | Attach a console device (/dev/console) to the container. |
-Cores |
int |
No | The number of cores assigned to the container. A container can use all available cores by default. |
-Cpulimit |
float |
No | Limit of CPU usage. NOTE: If the computer has 2 CPUs, it has a total of ‘2’ CPU time. Value ‘0’ indicates no CPU limit. |
-Cpuunits |
int |
No | CPU weight for a container, will be clamped to [1, 10000] in cgroup v2. |
-Debug_ |
bool |
No | Try to be more verbose. For now this only enables debug log-level on start. |
-Description |
string |
No | Description for the Container. Shown in the web-interface CT’s summary. This is saved as comment inside the configuration file. |
-DevN |
hashtable |
No | Device to pass through to the container. |
-Entrypoint |
string |
No | Command to run as init, optionally with arguments; may start with an absolute path, relative path, or a binary in $PATH. |
-Env |
string |
No | The container runtime environment as NUL-separated list. Replaces any lxc.environment.runtime entries in the config. |
-Features |
string |
No | Allow containers access to advanced features. |
-Force |
bool |
No | Allow to overwrite existing container. |
-HaManaged |
bool |
No | Add the CT as a HA resource after it was created. |
-Hookscript |
string |
No | Script that will be executed during various steps in the containers lifetime. |
-Hostname |
string |
No | Set a host name for the container. |
-IgnoreUnpackErrors |
bool |
No | Ignore errors when extracting the template. |
-Lock |
string |
No | Lock/unlock the container. Values: backup, create, destroyed, disk, fstrim, migrate, mounted, rollback, snapshot, snapshot-delete. |
-Memory |
int |
No | Amount of RAM for the container in MB. |
-MpN |
hashtable |
No | Use volume as container mount point. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. |
-Nameserver |
string |
No | Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. |
-NetN |
hashtable |
No | Specifies network interfaces for the container. |
-Node |
string |
Yes | The cluster node name. |
-Onboot |
bool |
No | Specifies whether a container will be started during system bootup. |
-Ostemplate |
string |
Yes | The OS template or backup file. |
-Ostype |
string |
No | OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf. Value ‘unmanaged’ can be used to skip and OS specific setup. Values: debian, devuan, ubuntu, centos, fedora, opensuse, archlinux, alpine, gentoo, nixos, unmanaged. |
-Password |
SecureString |
No | Sets root password inside container. |
-Pool |
string |
No | Add the VM to the specified pool. |
-Protection |
bool |
No | Sets the protection flag of the container. This will prevent the CT or CT’s disk remove/update operation. |
-Restore |
bool |
No | Mark this as restore task. |
-Rootfs |
string |
No | Use volume as container root. |
-Searchdomain |
string |
No | Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. |
-SshPublicKeys |
string |
No | Setup public SSH keys (one key per line, OpenSSH format). |
-Start |
bool |
No | Start the CT after its creation finished successfully. |
-Startup |
string |
No | Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the ‘up’ or ‘down’ delay in seconds, which specifies a delay to wait before the next VM is started or stopped. |
-Storage |
string |
No | Default Storage. |
-Swap |
int |
No | Amount of SWAP for the container in MB. |
-Tags |
string |
No | Tags of the Container. This is only meta information. |
-Template |
bool |
No | Enable/disable Template. |
-Timezone |
string |
No | Time zone to use in the container. If option isn’t set, then nothing will be done. Can be set to ‘host’ to match the host time zone, or an arbitrary time zone option from /usr/share/zoneinfo/zone.tab. |
-Tty |
int |
No | Specify the number of tty available to the container. |
-Unique |
bool |
No | Assign a unique random ethernet address. |
-Unprivileged |
bool |
No | Makes the container run as unprivileged user. For creation, the default is 1. For restore, the default is the value from the backup. (Should not be modified manually.) |
-UnusedN |
hashtable |
No | Reference to unused volumes. This is used internally, and should not be modified manually. |
-Vmid |
int |
Yes | The (unique) ID of the VM. |
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.
Output
Section titled “Output”A PveResponse: the data returned by Proxmox VE is in .Response.data, the outcome in .IsSuccessStatusCode. See Results and Errors.