API Proxmox

A revalider avec PX 5.2.

Gestion Cluster

Commande :

pvesh get /cluster/options

Attention:

Les paramètres affichés, sont les paramètres qui ont été modifiés, les paramètres utilisés par défaut n’apparaissent pas.

Exemple :

pvesh get /cluster/options

Sortie :

200 OK
{
   "keyboard" : "fr"
}

Commande :

pvesh set /cluster/options [Options]

Note:

Options : Voir le détail ci-dessous.

Exemple :

pvesh set /cluster/options -email_from=toto@exemple.fr

Sortie :

200 OK

Options :

Set datacenter options.
-console   (applet | html5 | vv)
           Select the default Console viewer. You can either use the builtin java applet (VNC), an
           external virt-viewer comtatible application (SPICE), or an HTML5 based viewer (noVNC).
-delete    string
           A list of settings you want to delete.
-email_from string
            Specify email address to send notification from (default is root@$hostname)
-http_proxy http://.*
            Specify external http proxy which is used for downloads
            (example: 'http://username:password@host:port/')
-keyboard  (da | de | de-ch | en-gb | en-us | es | fi | fr | fr-be | fr-ca | fr-ch | hu | is | it | ja
           | lt | mk | nl | no | pl | pt | pt-br | sl | sv | tr)
           Default keybord layout for vnc server.
-language  (de | en)
           Default GUI language.
-max_workers integer (1 - N)
           Defines how many workers (per node) are maximal started  on actions like 'stopall VMs' or
           task from the ha-manager.
-migration_unsecure boolean
           Migration is secure using SSH tunnel by default. For secure private networks you can disable
           it to speed up migration.

Commande :

pvesh get /storage [/Options]

Note:

Options : Rajouter le nom du stockage pour obtenir les informations le concernant seulement.
Exemple : pvesh get /storage/nom-du-volume

Exemple :

pvesh get /storage

Sortie :

200 OK
[
   {
      "content" : "images,rootdir",
      "digest" : "cc3b0b34aad25f896e9120df80da9e3f04af81a8",
      "storage" : "local-lvm",
      "thinpool" : "data",
      "type" : "lvmthin",
      "vgname" : "pve"
   },
   {
      "content" : "iso,vztmpl,backup",
      "digest" : "cc3b0b34aad25f896e9120df80da9e3f04af81a8",
      "path" : "/var/lib/vz",
      "storage" : "local",
      "type" : "dir"
   }
]

Commande :

pvesh create /storage -storage=<nom_du_stockage> -type=<type_de_stockage> [Options]

Note:

Nom_du_stockage : c’est le nom à donner au stockage créer.
Type_de_stockage : dir=répertoire local, drbd, nfs etc… Voir les options pour plus de détail.
Options : Voir le détail ci-dessous.

Exemple :

pvesh create /storage -storage=NAS2 -type=nfs -content=iso,images,vztmpl,rootdir -export=/zpool-124154/nas2/ -options="vers=3" -path=/mnt/pve/NAS2 -server=10.16.201.5 -shared=1

Sortie :

200 OK 

Options :

Create a new storage.
-authsupported string
           Authsupported.
-base      string
           Base volume. This volume is automatically activated.
-blocksize string
           block size
-comstar_hg string
           host group for comstar views
-comstar_tg string
           target group for comstar views
-content   string
           Allowed content types. Note: value 'rootdir' is used for Containers, and value 'images'
           for KVM-Qemu VMs.
-disable   boolean
           Flag to disable the storage.
-export    string
           NFS export path.
-format    string
           Default Image format.
-iscsiprovider string
           iscsi provider
-krbd      boolean
           Access rbd through krbd kernel module.
-maxfiles  integer (0 - N)
           Maximal number of backup files per VM. Use '0' for unlimted.
-monhost   string
           Monitors daemon ips.
-nodes     string
           List of cluster node names.
-nowritecache boolean
           disable write caching on the target
-options   string
           NFS mount options (see 'man nfs')
-path      string
           File system path.
-pool      string
           Pool.
-portal    string
           iSCSI portal (IP or DNS name with optional port).
-redundancy integer (1 - 16)	 (default=2)
           The redundancy count specifies the number of nodes to which the resource should be deployed.
           It must be at least 1 and at most the number of nodes in the cluster.
-saferemove boolean
           Zero-out data when removing LVs.
-saferemove_throughput string
           Wipe throughput (cstream -t parameter value).
-server    string
           Server IP or DNS name.
-server[n] string
           Backup volfile server IP or DNS name.
           Requires option(s): server
-shared    boolean
           Mark storage as shared.
-sparse    boolean
           use sparse volumes
-storage   string
           The storage identifier.
-target    string
           iSCSI target.
-thinpool  string
           LVM thin pool LV name.
-transport (rdma | tcp | unix)
           Gluster transport: tcp or rdma
-type      (dir | drbd | glusterfs | iscsi | iscsidirect | lvm | lvmthin | nfs | rbd | sheepdog
           | zfs | zfspool)
           Storage type.
-username  string
           RBD Id.
-vgname    string
           Volume group name.
-volume    string
           Glusterfs Volume.

Commande :

pvesh set /storage/<nom_du_stockage> [Options]

Note:

nom_du_stockage : c’est le nom du stockage créer à modifier.
Options : Voir le détail ci-dessous.

Exemple :

pvesh set /storage/NAS2 -content=images,vztmpl,rootdir

Sortie :

200 OK

Options :

Update storage configuration.
-blocksize string
           block size
-comstar_hg string
           host group for comstar views
-comstar_tg string
           target group for comstar views
-content   string
           Allowed content types. Note: value 'rootdir' is used for Containers, and value 'images' for
           KVM-Qemu VMs.
-delete    string
           A list of settings you want to delete.
-digest    string
           Prevent changes if current configuration file has different SHA1 digest.
           This can be used to prevent concurrent modifications.
-disable   boolean
           Flag to disable the storage.
-format    string
           Default Image format.
-krbd      boolean
           Access rbd through krbd kernel module.
-maxfiles  integer (0 - N)
           Maximal number of backup files per VM. Use '0' for unlimted.
-nodes     string
           List of cluster node names.
-nowritecache boolean
           disable write caching on the target
-options   string
           NFS mount options (see 'man nfs')
-pool      string
           Pool.
-redundancy integer (1 - 16)	 (default=2)
           The redundancy count specifies the number of nodes to which the resource should be deployed.
           It must be at least 1 and at most the number of nodes in the cluster.
-saferemove boolean
           Zero-out data when removing LVs.
-saferemove_throughput string
           Wipe throughput (cstream -t parameter value).
-server    string
           Server IP or DNS name.
-server[n] string
           Backup volfile server IP or DNS name.
           Requires option(s): server
-shared    boolean
           Mark storage as shared.
-sparse    boolean
           use sparse volumes
-transport (rdma | tcp | unix)
           Gluster transport: tcp or rdma
-username  string
           RBD Id.

Commande :

pvesh delete /storage/<nom_du_stockage>

Note:

Nom_du_stockage : c’est le nom du stockage créer à modifier.
Options : Voir le détail ci-dessous.

Important:

Attention, lors de la suppression d’un stockage d’un cluster, c’est sur l’ensemble des noeuds que le stockage est supprimé !

De plus, s’assurer que le stockage a supprimer ne contient plus aucune données concernant des VMs qui fonctionnerait encore, auquel cas, le point de montage reste actif pour que les VMs puissent continuer a fonctionner.

Néanmoins, dès qu’il y aura redémarrage d’un des noeuds, celui-ci ne pourra plus démarrer les VMs qui utilisent un stockage supprimé !

Exemple :

pvesh delete /storage/NAS2

Sortie :

200 OK

Commande :

pvecm add <nom_d_un_noeud> [options]

Note:

Nom_d_un_noeud : Nom de l'un des noeuds du cluster sur lequel on veux ajouter le noeud courant.
Options : Voir le détail ci-dessous.

Exemple :

pvecm add px1

Sortie :

copy corosync auth key 
stopping pve-cluster service 
backup old database 
waiting for quorum...OK 
generating node certificates 
merge known_hosts file 
restart services 
successfully added node 'px2' to cluster.

Options :

Adds the current node to an existing cluster.
<hostname> string
           Hostname (or IP) of an existing cluster member.
-force     boolean
           Do not throw error if node already exists.
-nodeid    integer (1 - N)
           Node id for this node.
-ring0_addr string
           Hostname (or IP) of the corosync ring0 address of this node.
           Defaults to nodes hostname.
-ring1_addr string
           Hostname (or IP) of the corosync ring1 address, this needs an valid configured ring 1
           interface in the cluster.
-votes     integer (0 - N)
           Number of votes for this node

Commande :

pvecm delnode <nom_du_noeud>

Note:

Nom_du_noeud : Nom du noeud a supprimer du cluster.

Attention:

Commande à exécuter sur un noeud du cluster autre que le noeud a supprimer !
Il faut couper les VMs de la machine a supprimer avant retrait du cluster.
Redémarrer le service pve-cluster une fois le noeud supprimé.

Exemple :

pvecm delnode px2

Sortie :

Aucune sortie.

Commande :

pvecm status

Exemple :

pvecm status

Sortie :

Quorum information
------------------
Date:             Fri Feb 26 15:04:25 2016
Quorum provider:  corosync_votequorum
Nodes:            2
Node ID:          0x00000001
Ring ID:          1324
Quorate:          Yes
 
Votequorum information
----------------------
Expected votes:   2
Highest expected: 2
Total votes:      2
Quorum:           2  
Flags:            Quorate 
 
Membership information
----------------------
    Nodeid      Votes Name
0x00000001          1 192.168.1.1 (local)
0x00000002          1 192.168.1.2

Commande :

pvesh get /cluster/status

Exemple :

pvesh get /cluster/status

Sortie :

200 OK
[
   {
      "id" : "cluster",
      "name" : "px-cluster1",
      "nodes" : 2,
      "quorate" : 1,
      "type" : "cluster",
      "version" : 2
   },
   {
      "id" : "node/px2",
      "ip" : "192.168.1.2",
      "level" : "",
      "local" : 0,
      "name" : "px2",
      "nodeid" : 2,
      "online" : 1,
      "type" : "node"
   },
   {
      "id" : "node/px1",
      "ip" : "192.168.1.1",
      "level" : "",
      "local" : 1,
      "name" : "px1",
      "nodeid" : 1,
      "online" : 1,
      "type" : "node"
   }
]

Commande :

pvesh get /cluster/log [Options]

Note:

Options : Voir le détail ci-dessous.

Exemple :

pvesh get /cluster/log -max=3

Sortie :

200 OK
[
   {
      "msg" : "successful auth for user 'root@pam'",
      "node" : "px1",
      "pid" : 811,
      "pri" : 6,
      "tag" : "pvedaemon",
      "time" : 1456493894,
      "uid" : 290,
      "user" : "root@pam"
   },
   {
      "msg" : "successful auth for user 'root@pam'",
      "node" : "px1",
      "pid" : 9827,
      "pri" : 6,
      "tag" : "pvedaemon",
      "time" : 1456492994,
      "uid" : 289,
      "user" : "root@pam"
   },
   {
      "msg" : "successful auth for user 'root@pam'",
      "node" : "px1",
      "pid" : 9786,
      "pri" : 6,
      "tag" : "pvedaemon",
      "time" : 1456492094,
      "uid" : 288,
      "user" : "root@pam"
   }
]

Options :

Read cluster log
-max	     integer (1 - N)
           Maximum number of entries.

Commande :

pvesh get /nodes/nom_du_noeud/syslog [Options]

Note:

Nom_du_noeud : nom du noeud pour lequel on veux obtenir les logs.
Options : Voir le détail ci-dessous.

Exemple :

pvesh get /nodes/px1/sysloglog -limit=3

Sortie :

200 OK
[
   {
      "n" : 1,
      "t" : "-- Logs begin at Wed 2016-02-24 02:01:34 CET, end at Fri 2016-02-26 14:51:01 CET. --"
   },
   {
      "n" : 2,
      "t" : "Feb 24 02:01:34 px1 systemd-journal[315]: Runtime journal is using 8.0M (max allowed 641.4M, trying to leave 962.1M free of 6.2G available → current limit 641.4M)."
   },
   {
      "n" : 3,
      "t" : "Feb 24 02:01:34 px1 systemd-journal[315]: Runtime journal is using 8.0M (max allowed 641.4M, trying to leave 962.1M free of 6.2G available → current limit 641.4M)."
   }
]

Options :

Read system log
-limit     integer (0 - N)
           no description available
-start     integer (0 - N)
           no description available

Conteneur LXC

Les conteneurs LXC sont une alternative légère aux machines virtuelles entièrement virtualisées. Au lieu d'émuler un système d'exploitation complet, les conteneurs utilisent simplement le système d'exploitation de l'hôte sur lequel ils s'exécutent. Cela implique que tous les conteneurs utilisent le même noyau et qu'ils peuvent accéder directement aux ressources de l'hôte.

Ainsi, les conteneurs ne gaspillent pas la puissance du processeur ni la mémoire en raison de l'émulation du noyau. Les coûts d'exécution des conteneurs sont proches de zéro et généralement négligeables. Mais il y a aussi des inconvénients à prendre en compte:

  • Vous ne pouvez utiliser que des systèmes d'exploitation basés sur Linux dans des conteneurs, c'est-à-dire qu'il n'est pas possible d'exécuter FreeBSD ou MS Windows à l'intérieur.
  • Pour des raisons de sécurité, l'accès aux ressources de l'hôte doit être limité. Ceci est fait avec AppArmor, les filtres SecComp et les autres fonctionnalités du noyau. Ce qui signifie que certains appels système ne sont pas autorisés à l'intérieur des conteneurs.

Proxmox VE utilise LXC comme technologie de conteneur sous-jacente. Nous considérons LXC comme une bibliothèque de bas niveau, qui offre d'innombrables options. Il serait trop difficile d’utiliser directement ces outils. Au lieu de cela, nous fournissons un petit wrapper appelé pct, le “Proxmox Container Toolkit”.

La boîte à outils est étroitement associée à Proxmox VE. Cela signifie qu'il est conscient de la configuration du cluster et qu'il peut utiliser les mêmes ressources de réseau et de stockage que les machines virtuelles entièrement virtualisées. Vous pouvez même utiliser le pare-feu Proxmox VE ou gérer des conteneurs à l'aide de la structure HA.

Notre objectif principal est d'offrir un environnement comme on obtiendrait à partir d'une VM, mais sans la surcharge supplémentaire. Nous appelons cela “Conteneurs Système”.

Commande :

pvesh create /nodes/<nom_du_noeud>/lxc -ostemplate <nom_du_template> -vmid <identifiant_du_container> [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel on doit créer le container.
Nom du template : Base du système à installer, penser a mettre le chemin depuis le stockage, c’est a dire le nom du stockage ou est stocké votre image (dans l’exemple NAS), y compris le chemin d’accès au template (vztmpl)
Identifiant du container : Identifiant à attribuer au nouveau container, s’assurer qu’il n’existe pas !
Options : Voir le détail ci-dessous, permet de paramétrer directement le container a la création.

Exemple :

pvesh create /nodes/px1/lxc -ostemplate NAS:vztmpl/debian-8.0-standard_8.0-1_amd64.tar.gz -vmid 106

Sortie :

 

Options :

Create or restore a container.
-arch      (amd64 | i386)   (default=amd64)
           OS architecture type.
-cmode     (console | shell | tty)   (default=tty)
           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).
-console   boolean   (default=1)
           Attach a console device (/dev/console) to the container.
-cpulimit  number (0 - 128)	(default=0)
           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  integer (0 - 500000)   (default=1024)
           CPU weight for a VM. Argument is used in the kernel fair scheduler.
           The larger the number is, the more CPU time this VM gets. 
           Number is relative to the weights of all the other running VMs.
           NOTE: You can disable fair-scheduler configuration by setting this to 0.
-description string
           Container description. Only used on the configuration web interface.
-force     boolean
           Allow to overwrite existing container.
-hostname  string
           Set a host name for the container.
-ignore-unpack-errors boolean
           Ignore errors when extracting the template.
-lock      (backup | migrate | rollback | snapshot)
           Lock/unlock the VM.
-memory    integer (16 - N)	(default=512)
           Amount of RAM for the VM in MB.
-mp[n]     mp=<Path>, [volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>]
           [,size=<DiskSize>]
           Use volume as container mount point (experimental feature).
-nameserver string
           Sets DNS server IP address for a container.
           Create will automatically use the setting from the host if you neither set searchdomain nor
           nameserver.
-net[n]    name=<String> [,bridge=<vmbr<Number>>] [,firewall=<[1|0]>] [,gw=<GatewayIPv4>]
           [,gw6=<GatewayIPv6>] [,hwaddr=<MAC>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>]
           [,mtu=<Number>] [,tag=<VlanNo>] [,trunks=<vlanid[;vlanid...]>]
           Specifies network interfaces for the container.
-onboot    boolean   (default=0)
           Specifies whether a VM will be started during system bootup.
-ostemplate string
           The OS template or backup file.
-ostype    (archlinux | centos | debian | fedora | opensuse | ubuntu)
           OS type. Corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf.
-password  
           Sets root password inside container.
-pool      string
           Add the VM to the specified pool.
-protection boolean	(default=0)
           Sets the protection flag of the container. This will prevent the CT or CTs disk remove/update
           operation.
-restore   boolean
           Mark this as restore task.
-rootfs    [volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>]
           [,size=<DiskSize>]
           Use volume as container root.
-searchdomain string
           Sets DNS search domains for a container. 
           Create will automatically use the setting from the host if you neither set searchdomain nor
           nameserver.
-startup   [[order=]\d+] [,up=\d+] [,down=\d+] 
           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   (default=local)
           Default Storage.
-swap      integer (0 - N)   (default=512)
           Amount of SWAP for the VM in MB.
-template  boolean   (default=0)
           Enable/disable Template.
-tty	     integer (0 - 6)   (default=2)
           Specify the number of tty available to the container
-unprivileged boolean   (default=0)
           Makes the container run as unprivileged user. (Should not be modified manually.)
-unused[n] string
           Reference to unused volumes.
-vmid      integer (1 - N)
           The (unique) ID of the VM.

Commande :

pvesh create /nodes/<nom_du_noeud>/lxc/<identifiant_du_container>/status/start [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel le container se trouve.
Identifiant du container : Identifiant du container à démarrer.
Options : Voir le détail ci-dessous.

Exemple :

pvesh create /nodes/px1/lxc/106/status/start

Sortie :

 

Options :

Start the container.
-skiplock  boolean
           Ignore locks - only root is allowed to use this option.

Commande :

pvesh create /nodes/nom_du_noeud/lxc/identifiant_du_container/status/shutdown [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel le container se trouve.
Identifiant du container : identifiant du container à arrêter.
Options : Voir le détail ci-dessous.

Exemple :

pvesh create /nodes/px1/lxc/106/status/shutdown

Sortie :

 

Options :

Shutdown the container.
-forceStop boolean   (default=0)
           Make sure the Container stops.
-timeout   integer (0 - N)   (default=60)
           Wait maximal timeout seconds.

Commande :

pvesh delete /nodes/nom_du_noeud/lxc/identifiant_du_container

Note:

Nom du noeud : c’est le nom de la machine sur lequel se trouve le container à supprimer.
Identifiant du container : identifiant du container à supprimer.

Exemple :

pvesh delete /nodes/px1/lxc/106

Sortie :

 

Commande :

pvesh get /nodes/nom_du_noeud/lxc/identifiant_du_container/config

Note:

Nom du noeud : c’est le nom de la machine sur lequel se trouve le container.
Identifiant du container : identifiant du container sur lequel on souhaite obtenir les paramètres.

Exemple :

pvesh get /nodes/px1/lxc/106/config

Sortie :

200 OK
{
   "arch" : "amd64",
   "digest" : "2f8da8bfa7738522533d26c14fa389bc686f23b3",
   "hostname" : "CT106",
   "memory" : 512,
   "ostype" : "debian",
   "rootfs" : "local:106/vm-106-disk-1.raw,size=4G",
   "swap" : 512
}

Commande :

pvesh set /nodes/nom_du_noeud/lxc/identifiant_du_container/config [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel se trouve le container.
Identifiant du container : identifiant du container sur lequel on souhaite définir les paramètres.
Options : Voir le détail ci-dessous.

Exemple :

pvesh set /nodes/px1/lxc/106/config -onboot=1

Sortie :

200 OK

Options :

Set container options.
-arch      (amd64 | i386)   (default=amd64)
           OS architecture type.
-cmode     (console | shell | tty)   (default=tty)
           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).
-console   boolean   (default=1)
           Attach a console device (/dev/console) to the container.
-cpulimit  number (0 - 128)	(default=0)
           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  integer (0 - 500000)   (default=1024)
           CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number
           is, the more CPU time this VM gets. Number is relative to the weights of all the other
           running VMs.
           NOTE: You can disable fair-scheduler configuration by setting this to 0.
-delete    string
           A list of settings you want to delete.
-description string
           Container description. Only used on the configuration web interface.
-digest    string
           Prevent changes if current configuration file has different SHA1 digest. This can be used
           to prevent concurrent modifications.
-hostname  string
           Set a host name for the container.
-lock      (backup | migrate | rollback | snapshot)
           Lock/unlock the VM.
-memory    integer (16 - N)	(default=512)
           Amount of RAM for the VM in MB.
-mp[n]     mp=<Path>, [volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>]
           [,size=<DiskSize>]
           Use volume as container mount point (experimental feature).
-nameserver string
           Sets DNS server IP address for a container. Create will automatically use the setting from
           the host if you neither set searchdomain nor nameserver.
-net[n]    name=<String> [,bridge=<vmbr<Number>>] [,firewall=<[1|0]>] [,gw=<GatewayIPv4>]
           [,gw6=<GatewayIPv6>] [,hwaddr=<MAC>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>]
           [,mtu=<Number>] [,tag=<VlanNo>] [,trunks=<vlanid[;vlanid...]>]
           Specifies network interfaces for the container.
-onboot    boolean   (default=0)
           Specifies whether a VM will be started during system bootup.
-ostype    (archlinux | centos | debian | fedora | opensuse | ubuntu)
           OS type. Corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf.
-protection boolean	(default=0)
           Sets the protection flag of the container. This will prevent the CT or CT's disk
           remove/update operation.
-rootfs    [volume=]<volume> [,acl=<acl>] [,backup=<[1|0]>] [,quota=<[0|1]>] [,ro=<ro>]
           [,size=<DiskSize>]
           Use volume as container root.
-searchdomain string
           Sets DNS search domains for a container. Create will automatically use the setting from the
           host if you neither set searchdomain nor nameserver.
-startup   [[order=]\d+] [,up=\d+] [,down=\d+] 
           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.
-swap      integer (0 - N)   (default=512)
           Amount of SWAP for the VM in MB.
-template  boolean   (default=0)
           Enable/disable Template.
-tty	     integer (0 - 6)   (default=2)
           Specify the number of tty available to the container
-unprivileged boolean   (default=0)
           Makes the container run as unprivileged user. (Should not be modified manually.)
-unused[n] string
           Reference to unused volumes.

Commande :

pvesh set /nodes/nom_du_noeud/lxc/identifiant_du_container/resize -disk nom_du_disque -size taille_a_ajouter [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel se trouve le container.
Identifiant du container : identifiant du container sur lequel on souhaite modifier la taille du disque.
Nom du disque : rootfs pour le disque principal, pour les disques secondaire, mp0 à mp9, fonction expérimental !
Taille à ajouter : + la taille souhaitée et le multiplicateur Giga (G), Méga (M) etc…
Options : Voir le détail ci-dessous.

Important:

Attention : la réduction de taille n’est pas supportée !!!
Fonction expérimental…

Exemple :

pvesh set /nodes/px1/lxc/106/resize -disk=rootfs -size=+1G

Sortie :

Image resized.
e2fsck 1.42.12 (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/var/lib/vz/images/106/vm-106-disk-1.raw: 24847/327680 files (0.0% non-contiguous), 195014/1310720 blocks
resize2fs 1.42.12 (29-Aug-2014)
Resizing the filesystem on /var/lib/vz/images/106/vm-106-disk-1.raw to 1572864 (4k) blocks.
The filesystem on /var/lib/vz/images/106/vm-106-disk-1.raw is now 1572864 (4k) blocks long.
 
200 OK

Options :

Resize a container mountpoint.
-digest    string
           Prevent changes if current configuration file has different SHA1 digest.
           This can be used to prevent concurrent modifications.
-disk      (mp0 | mp1 | mp2 | mp3 | mp4 | mp5 | mp6 | mp7 | mp8 | mp9 | rootfs)
           The disk you want to resize.
-size      \+?\d+(\.\d+)?[KMGT]?
           The new size. With the '+' sign the value is added to the actual size of the volume and
           without it, the value is taken as an absolute one. Shrinking disk size is not supported.

Commande :

pvesh create /nodes/nom_du_noeud/vzdump -vmid=identifiant_du_container -mode=mode_de_sauvegarde -compress=mode_de_compression -storage=emplacement_du_stockage -remove=remove [Options]

Note:

Nom_du_noeud : c’est le nom de la machine sur lequel se trouve le container.
Identifiant_du_container : identifiant du container sur lequel on souhaite faire une sauvegarde.
Mode_de_sauvegarde : Suspend = met en pause la machine, Stop = Stoppe la machine et Snapshot = réalise un stop en réalité.
Mode_de_compression : lzo par défaut, gzip ou aucune, voir les options.
Emplacement_du_stockage: emplacement ou mettre la sauvegarde (dans le sens du stockage définit sur Proxmox).
Remove : Définit le nombre de sauvegarde antérieur a conserver, 0 garde tout, et fonction du paramètre maxfiles…
Options : Voir le détail ci-dessous.

Exemple :

pvesh create /nodes/px1/vzdump -vmid=106 -mode=stop -compress=lzo -storage=local -remove=0

Sortie :

INFO: starting new backup job: vzdump 106 --node px1 --mode stop --storage local --compress lzo --remove 0
INFO: Starting Backup of VM 106 (lxc)
INFO: status = running
INFO: backup mode: stop
INFO: ionice priority: 7
INFO: stopping vm
INFO: creating archive '/var/lib/vz/dump/vzdump-lxc-106-2016_02_26-14_00_39.tar.lzo'
INFO: Total bytes written: 559196160 (534MiB, 182MiB/s)
INFO: archive file size: 266MB
INFO: restarting vm
INFO: vm is online again after 11 seconds
INFO: Finished Backup of VM 106 (00:00:11)
INFO: Backup job finished successfully
200 OK
UPID:px1:000003A4:014984E0:56D04C77:vzdump::root@pam:

Options :

Create backup.
-all	     boolean   (default=0)
           Backup all known VMs on this host.
-bwlimit   integer (0 - N)
           Limit I/O bandwidth (KBytes per second).
-compress  (0 | 1 | gzip | lzo)   (default=lzo)
           Compress dump file.
-dumpdir   string
           Store resulting files to specified directory.
-exclude   string
           exclude specified VMs (assumes --all)
-exclude-path string
           exclude certain files/directories (shell globs).
-ionice    integer (0 - 8)
           Set CFQ ionice priority.
-lockwait  integer (0 - N)
           Maximal time to wait for the global lock (minutes).
-mailnotification (always | failure)	 (default=always)
           Specify when to send an email
-mailto    string
           no description available
-maxfiles  integer (1 - N)
           Maximal number of backup files per VM.
-mode      (snapshot | stop | suspend)   (default=stop)
           Backup mode.
-pigz      integer   (default=0)
           Uses pigz instead of gzip when N>0. N=1 uses half of cores, N>1 uses N as thread count.
-quiet     boolean   (default=0)
           Be quiet.
-remove    boolean   (default=1)
           Remove old backup files if there are more than 'maxfiles' backup files.
-script    string
           Use specified hook script.
-size      integer (500 - N)
           LVM snapshot size in MB.
-stdexcludes boolean	 (default=1)
           Exclude temorary files and logs.
-stdout    boolean
           Write tar to stdout, not to a file.
-stop      boolean   (default=0)
           Stop runnig backup jobs on this host.
-stopwait  integer (0 - N)
           Maximal time to wait until a VM is stopped (minutes).
-storage   string
           Store resulting file to this storage.
-tmpdir    string
           Store temporary files to specified directory.
-vmid      string
           The ID of the VM you want to backup.

Conteneur Qemu

Qemu (forme abrégée pour Quick Emulator) est un hyperviseur open source qui émule un ordinateur physique. Du point de vue du système hôte sur lequel Qemu s'exécute, Qemu est un programme utilisateur qui a accès à un certain nombre de ressources locales telles que partitions, fichiers, cartes réseau qui sont ensuite transmises à un ordinateur émulé qui les voit comme de vrais périphériques.

Un système d'exploitation invité fonctionnant sur l'ordinateur émulé accède à ces périphériques et s'exécute en cours d'exécution sur du matériel réel. Par exemple, vous pouvez transmettre une image iso en tant que paramètre à Qemu, et le système d'exploitation exécuté sur l'ordinateur émulé verra un véritable CDROM inséré dans un lecteur de CD.

Qemu peut émuler une grande variété de matériel d'ARM à Sparc, mais Proxmox VE ne concerne que l'émulation de clones PC 32 et 64 bits, car il représente la grande majorité du matériel du serveur. L'émulation des clones PC est également l'une des plus rapides en raison de la disponibilité des extensions de processeurs qui accélèrent considérablement Qemu lorsque l'architecture émulée est identique à l'architecture hôte.

Note:

Vous pouvez parfois rencontrer le terme KVM (machine virtuelle basée sur le noyau). Cela signifie que Qemu s'exécute avec le support des extensions du processeur de virtualisation, via le module Linux kvm. Dans le contexte de Proxmox VE, Qemu et KVM peuvent être utilisés indifféremment, car Qemu dans Proxmox VE essaiera toujours de charger le module kvm.

Qemu dans Proxmox VE s'exécute en tant que processus racine, car il est nécessaire pour accéder aux blocs et aux périphériques PCI.

Commande :

pvesh create /nodes/<nom_du_noeud>/qemu -vmid <identifiant_du_container> [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel on doit créer le container.
Identifiant du container : Identifiant à attribuer au nouveau container, s’assurer qu’il n’existe pas !
Options : Voir le détail ci-dessous, permet de paramétrer directement le container a la création.

Exemple :

pvesh create /nodes/px1/qemu -vmid 106

Sortie :

 

Options :

Create or restore a virtual machine.
-acpi      boolean   (default=1)
           Enable/disable ACPI.
-agent     boolean   (default=0)
           Enable/disable Qemu GuestAgent.
-archive   string
           The backup file.
-args      string
           Note: this option is for experts only. It allows you to pass arbitrary arguments to kvm, 
           for example:
           args: -no-reboot -no-hpet
-autostart boolean   (default=0)
           Automatic restart after crash (currently ignored).
-balloon   integer (0 - N)
           Amount of target RAM for the VM in MB. Using zero disables the ballon driver.
-bios      (ovmf | seabios)	(default=seabios)
           Select BIOS implementation.
-boot      [acdn]{1,4}   (default=cdn)
           Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n).
-bootdisk  (ide|sata|scsi|virtio)\d+
           Enable booting from specified disk.
-cdrom     volume
           This is an alias for option -ide2
-cores     integer (1 - N)   (default=1)
           The number of cores per socket.
-cpu	     
           Emulated CPU type.
-cpulimit  number (0 - 128)	(default=0)
           Limit of CPU usage.
           Note if the computer has 2 CPUs, it has total of '2' CPU time.
           Value '0' indicates no CPU limit.
-cpuunits  integer (0 - 500000)   (default=1000)
           CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is,
           the more CPU time this VM gets. Number is relative to weights of all the other running VMs.
           NOTE: You can disable fair-scheduler configuration by setting this to 0.
-description string
           Description for the VM. Only used on the configuration web interface.
           This is saved as comment inside the configuration file.
-force     boolean
           Allow to overwrite existing VM. Requires option(s): archive
-freeze    boolean
           Freeze CPU at startup (use 'c' monitor command to start execution).
-hostpci[n] [host=]HOSTPCIDEVICE [,rombar=on|off] [,pcie=0|1] [,x-vga=on|off]
           Map host pci devices. HOSTPCIDEVICE syntax is: 'bus:dev.func' (hexadecimal numbers)
           You can us the 'lspci' command to list existing pci devices.
           The 'rombar' option determines whether or not the device's ROM will be visible in the guest's
           memory map (default is 'on').
           Note: This option allows direct access to host hardware. So it is no longer possible to
           migrate such machines - use with special care.
           Experimental: user reported problems with this option.
-hotplug   string   (default=network,disk,usb)
           Selectively enable hotplug features.
           This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory' and
           'usb'.
           Use '0' to disable hotplug completely.
           Value '1' is an alias for the default 'network,disk,usb'.
-ide[n]    [file=]<volume> [,aio=<native|threads>] [,backup=<on|off>] [,bps=<bps>] [,bps_rd=<bps>]
           [,bps_wr=<bps>] [,cache=<none|writethrough|writeback|unsafe|directsync>] [,cyls=<count>]
           [,discard=<ignore|on>] [,format=<drive format>] [,heads=<count>] [,iops=<iops>]
           [,iops_max=<iops>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_wr=<iops>]
           [,iops_wr_max=<iops>] [,mbps=<mbps>] [,mbps_max=<mbps>] [,mbps_rd=<mbps>]
           [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>] [,media=<cdrom|disk>]
           [,model=<model>] [,rerror=<ignore|report|stop>] [,secs=<count>] [,serial=<serial>]
           [,snapshot=<on|off>] [,trans=<none|lba|auto>] [,werror=<enospc|ignore|report|stop>]
           Use volume as IDE hard disk or CD-ROM (n is 0 to 3).
-keyboard  (da | de | de-ch | en-gb | en-us | es | fi | fr | fr-be | fr-ca | fr-ch | hu | is | it | ja
           | lt | mk | nl | no | pl | pt | pt-br | sl | sv | tr)   (default=en-us)
           Keybord layout for vnc server. Default is read from the datacenter configuration file.
-kvm	     boolean   (default=1)
           Enable/disable KVM hardware virtualization.
-localtime boolean
           Set the real time clock to local time. This is enabled by default if ostype indicates a
           Microsoft OS.
-lock      (backup | migrate | rollback | snapshot)
           Lock/unlock the VM.
-machine   (pc|pc(-i440fx)?-\d+\.\d+(\.pxe)?|q35|pc-q35-\d+\.\d+(\.pxe)?)
           Specific the Qemu machine type.
-memory    integer (16 - N)	(default=512)
           Amount of RAM for the VM in MB.
           This is the maximum available memory when you use the balloon device.
-migrate_downtime number (0 - N)   (default=0.1)
           Set maximum tolerated downtime (in seconds) for migrations.
-migrate_speed integer (0 - N)   (default=0)
           Set maximum speed (in MB/s) for migrations. Value 0 is no limit.
-name      string
           Set a name for the VM. Only used on the configuration web interface.
-net[n]    MODEL=XX:XX:XX:XX:XX:XX
           [,bridge=<dev>][,queues=<nbqueues>][,rate=<mbps>][,tag=<vlanid>][,trunks=<vlanid[;vlanid]>]
           [,firewall=0|1],link_down=0|1]
           Specify network devices.
           MODEL is one of: e1000 e1000-82540em e1000-82544gc e1000-82545em i82551 i82557b i82559er
           ne2k_isa ne2k_pci pcnet rtl8139 virtio vmxnet3
           XX:XX:XX:XX:XX:XX should be an unique MAC address. This is automatically generated if not
           specified.
           The bridge parameter can be used to automatically add the interface to a bridge device.
           The Proxmox VE standard bridge is called 'vmbr0'.
           Option 'rate' is used to limit traffic bandwidth from and to this interface. It is specified
           as floating point number, unit is 'Megabytes per second'.
           If you specify no bridge, we create a kvm 'user' (NATed) network device, which provides DHCP
           and DNS services.
           The following addresses are used:
           10.0.2.2 Gateway
           10.0.2.3 DNS Server
           10.0.2.4 SMB Server
           The DHCP server assign addresses to the guest starting from 10.0.2.15.
-numa      boolean   (default=0)
           Enable/disable Numa.
-numa[n]   cpus=<id[-id],memory=<mb>[[,hostnodes=<id[-id]>][,policy=<preferred|bind|interleave>]]
           numa topology
-onboot    boolean   (default=0)
           Specifies whether a VM will be started during system bootup.
-ostype    (l24 | l26 | other | solaris | w2k | w2k3 | w2k8 | win7 | win8 | wvista | wxp)
           Used to enable special optimization/features for specific operating systems:
           other  => unspecified OS
           wxp    => Microsoft Windows XP
           w2k    => Microsoft Windows 2000
           w2k3   => Microsoft Windows 2003
           w2k8   => Microsoft Windows 2008
           wvista => Microsoft Windows Vista
           win7   => Microsoft Windows 7
           win8   => Microsoft Windows 8/2012
           l24    => Linux 2.4 Kernel
           l26    => Linux 2.6/3.X Kernel
           solaris => solaris/opensolaris/openindiania kernel
           other|l24|l26|solaris               ... no special behaviour
           wxp|w2k|w2k3|w2k8|wvista|win7|win8  ... use --localtime switch
-parallel[n] /dev/parport\d+|/dev/usb/lp\d+
           Map host parallel devices (n is 0 to 2).
           Note: This option allows direct access to host hardware. So it is no longer possible to
           migrate such machines - use with special care.
           Experimental: user reported problems with this option.
-pool      string
           Add the VM to the specified pool.
-protection boolean	(default=0)
           Sets the protection flag of the VM. This will prevent the remove operation.
-reboot    boolean   (default=1)
           Allow reboot. If set to '0' the VM exit on reboot.
-sata[n]   [file=]<volume> [,aio=<native|threads>] [,backup=<on|off>] [,bps=<bps>] [,bps_rd=<bps>]
           [,bps_wr=<bps>] [,cache=<none|writethrough|writeback|unsafe|directsync>] [,cyls=<count>]
           [,discard=<ignore|on>] [,format=<drive format>] [,heads=<count>] [,iops=<iops>]
           [,iops_max=<iops>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_wr=<iops>]
           [,iops_wr_max=<iops>] [,mbps=<mbps>] [,mbps_max=<mbps>] [,mbps_rd=<mbps>]
           [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>] [,media=<cdrom|disk>]
           [,rerror=<ignore|report|stop>] [,secs=<count>] [,serial=<serial>] [,snapshot=<on|off>]
           [,trans=<none|lba|auto>] [,werror=<enospc|ignore|report|stop>]
           Use volume as SATA hard disk or CD-ROM (n is 0 to 5).
-scsi[n]   [file=]<volume> [,aio=<native|threads>] [,backup=<on|off>] [,bps=<bps>] [,bps_rd=<bps>]
           [,bps_wr=<bps>] [,cache=<none|writethrough|writeback|unsafe|directsync>] [,cyls=<count>]
           [,discard=<ignore|on>] [,format=<drive format>] [,heads=<count>] [,iops=<iops>]
           [,iops_max=<iops>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_wr=<iops>]
           [,iops_wr_max=<iops>] [,iothread=<off|on>] [,mbps=<mbps>] [,mbps_max=<mbps>]
           [,mbps_rd=<mbps>] [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>]
           [,media=<cdrom|disk>] [,queues=<nbqueues>] [,secs=<count>] [,serial=<serial>]
           [,snapshot=<on|off>] [,trans=<none|lba|auto>] [,werror=<enospc|ignore|report|stop>]
           Use volume as SCSI hard disk or CD-ROM (n is 0 to 13).
-scsihw    (lsi | lsi53c810 | megasas | pvscsi | virtio-scsi-pci | virtio-scsi-single)   (default=lsi)
           scsi controller model
-serial[n] (/dev/.+|socket)
           Create a serial device inside the VM (n is 0 to 3), and pass through a host serial device
           (i.e. /dev/ttyS0), or create a unix socket on the host side (use 'qm terminal' to open a
           terminal connection).
           Note: If you pass through a host serial device, it is no longer possible to migrate such
           machines - use with special care.
           Experimental: user reported problems with this option.
-shares    integer (0 - 50000)   (default=1000)
           Amount of memory shares for auto-ballooning.
           The larger the number is, the more memory this VM gets. Number is relative to weights of all
           other running VMs. Using zero disables auto-ballooning.
-smbios[n] [family=<str>] [,manufacturer=<name>] [,product=<name>] [,serial=<str>] [,sku=<str>]
           [,uuid=<UUID>] [,version=<str>]
           Specify SMBIOS type 1 fields.
-smp	     integer (1 - N)   (default=1)
           The number of CPUs. Please use option -sockets instead.
-sockets   integer (1 - N)   (default=1)
           The number of CPU sockets.
-startdate (now | YYYY-MM-DD | YYYY-MM-DDTHH:MM:SS)	(default=now)
           Set the initial date of the real time clock.
           Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'.
-startup   [[order=]\d+] [,up=\d+] [,down=\d+] 
           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
           Default storage.
-tablet    boolean   (default=1)
           Enable/disable the usb tablet device. This device is usually needed to allow absolute mouse
           positioning with VNC. Else the mouse runs out of sync with normal VNC clients.
           If you are running lots of console-only guests on one host, you may consider disabling this
           to save some context switches. This is turned of by default if you use spice (vga=qxl).
-tdf	     boolean   (default=0)
           Enable/disable time drift fix.
-template  boolean   (default=0)
           Enable/disable Template.
-unique    boolean
           Assign a unique random ethernet address.
           Requires option(s): archive
-unused[n] string
           Reference to unused volumes.
-usb[n]    [host=]<HOSTUSBDEVICE|spice> [,usb3=<yes|no>]
           Configure an USB device (n is 0 to 4). This can be used to pass-through usb devices to the
           guest.
           HOSTUSBDEVICE syntax is:
           'bus-port(.port)*' (decimal numbers) or
           'vendor_id:product_id' (hexadeciaml numbers) or
           'spice'
           You can use the 'lsusb -t' command to list existing usb devices.
           Note: This option allows direct access to host hardware. So it is no longer possible to
           migrate such machines - use with special care.
           The value 'spice' can be used to add a usb redirection devices for spice.
           The 'usb3' option determines whether the device is a USB3 device or not (this does currently
           not work reliably with spice redirection and is then ignored).
-vcpus     integer (1 - N)   (default=0)
           Number of hotplugged vcpus.
-vga	     (cirrus | qxl | qxl2 | qxl3 | qxl4 | serial0 | serial1 | serial2 | serial3 | std | vmware)
           Select VGA type. If you want to use high resolution modes (>=1280x1024x16) then you should
           use option 'std' or 'vmware'. Default is 'std' for win8/win7/w2k8, and 'cirrur' for other OS
           types.
           Option 'qxl' enables the SPICE display sever.
           You can also run without any graphic card using a serial devive as terminal.
-virtio[n] [file=]<volume> [,aio=<native|threads>] [,backup=<on|off>] [,bps=<bps>] [,bps_rd=<bps>]
           [,bps_wr=<bps>] [,cache=<none|writethrough|writeback|unsafe|directsync>] [,cyls=<count>]
           [,discard=<ignore|on>] [,format=<drive format>] [,heads=<count>] [,iops=<iops>]
           [,iops_max=<iops>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_wr=<iops>]
           [,iops_wr_max=<iops>] [,iothread=<off|on>] [,mbps=<mbps>] [,mbps_max=<mbps>]
           [,mbps_rd=<mbps>] [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>]
           [,media=<cdrom|disk>] [,rerror=<ignore|report|stop>] [,secs=<count>] [,serial=<serial>]
           [,snapshot=<on|off>] [,trans=<none|lba|auto>] [,werror=<enospc|ignore|report|stop>]
           Use volume as VIRTIO hard disk (n is 0 to 15).
-vmid      integer (1 - N)
           The (unique) ID of the VM.
-watchdog  [[model=]i6300esb|ib700] [,[action=]reset|shutdown|poweroff|pause|debug|none]
           Create a virtual hardware watchdog device.  Once enabled (by a guest action), the watchdog
           must be periodically polled by an agent inside the guest or else the guest will be restarted
           (or execute the action specified)

Commande :

pvesh create /nodes/nom_du_noeud/qemu/identifiant_du_container/status/start [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel le container se trouve.
Identifiant du container : identifiant du container à démarrer.
Options : Voir le détail ci-dessous.

Exemple :

pvesh create /nodes/px1/qemu/106/status/start

Sortie :

 

Options :

Start virtual machine.
-machine   (pc|pc(-i440fx)?-\d+\.\d+(\.pxe)?|q35|pc-q35-\d+\.\d+(\.pxe)?)
           Specific the Qemu machine type.
-migratedfrom string
           The cluster node name.
-skiplock  boolean
           Ignore locks - only root is allowed to use this option.
-stateuri  string
           Some command save/restore state from this location.

Commande :

pvesh create /nodes/nom_du_noeud/qemu/identifiant_du_container/status/stop [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel le container se trouve.
Identifiant du container : identifiant du container à arrêter.
Options : Voir le détail ci-dessous.

Exemple :

pvesh create /nodes/px1/qemu/106/status/stop

Sortie :

 

Options :

Stop virtual machine.
-keepActive boolean	(default=0)
           Do not decativate storage volumes.
-migratedfrom string
           The cluster node name.
-skiplock  boolean
           Ignore locks - only root is allowed to use this option.
-timeout   integer (0 - N)
           Wait maximal timeout seconds.

Commande :

pvesh delete /nodes/nom_du_noeud/qemu/identifiant_du_container [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel se trouve le container à supprimer.
Identifiant du container : identifiant du container à supprimer.
Options : Voir le détail ci-dessous.

Exemple :

pvesh delete /nodes/px1/qemu/106

Sortie :

 

Options :

Destroy the vm (also delete all used/owned volumes).
-skiplock  boolean
           Ignore locks - only root is allowed to use this option.

Commande :

pvesh get /nodes/nom_du_noeud/qemu/identifiant_du_container/config [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel se trouve le container.
Identifiant du container : identifiant du container sur lequel on souhaite obtenir les paramètres.
Options : Voir le détail ci-dessous.

Exemple :

pvesh get /nodes/px1/qemu/106/config

Sortie :

200 OK
{
   "bootdisk" : "sata0",
   "cores" : 1,
   "cpuunits" : 10024,
   "digest" : "2e42504177a9363babb041cfe940fb9f19ea7676",
   "ide2" : "none,media=cdrom",
   "memory" : 1024,
   "name" : "test-vm",
   "net0" : "e1000=3A:32:61:61:39:35,bridge=vmbr2",
   "net1" : "e1000=62:39:39:34:33:35,bridge=vmbr2",
   "numa" : 1,
   "onboot" : 1,
   "ostype" : "l26",
   "sata0" : "NAS-HA-1:100/vm-100-disk-1.qcow2,size=32G",
   "smbios1" : "uuid=40d7547c-2689-4161-8a26-8199b8d38333",
   "sockets" : 1
}

Options :

Get current virtual machine configuration. This does not include pending configuration changes (see 'pending' API).
-current   boolean   (default=0)
           Get current values (instead of pending values).

Commande :

pvesh set /nodes/nom_du_noeud/qemu/identifiant_du_container/config [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel se trouve le container.
Identifiant du container : identifiant du container sur lequel on souhaite définir les paramètres.
Options : Voir le détail ci-dessous.

Exemple :

pvesh set /nodes/px1/qemu/106/config -onboot=1

Sortie :

update VM 100: -onboot 1
200 OK

Options :

Set virtual machine options (synchrounous API) - You should consider using the POST method instead for
any actions involving hotplug or storage allocation.
-acpi      boolean   (default=1)
           Enable/disable ACPI.
-agent     boolean   (default=0)
           Enable/disable Qemu GuestAgent.
-args      string
           Note: this option is for experts only. It allows you to pass arbitrary arguments to kvm,
           for example:
           args: -no-reboot -no-hpet
-autostart boolean   (default=0)
           Automatic restart after crash (currently ignored).
-balloon   integer (0 - N)
           Amount of target RAM for the VM in MB. Using zero disables the ballon driver.
-bios      (ovmf | seabios)	(default=seabios)
           Select BIOS implementation.
-boot      [acdn]{1,4}   (default=cdn)
           Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n).
-bootdisk  (ide|sata|scsi|virtio)\d+
           Enable booting from specified disk.
-cdrom     volume
           This is an alias for option -ide2
-cores     integer (1 - N)   (default=1)
           The number of cores per socket.
-cpu	     
           Emulated CPU type.
-cpulimit  number (0 - 128)	(default=0)
           Limit of CPU usage.
           Note if the computer has 2 CPUs, it has total of '2' CPU time.
           Value '0' indicates no CPU limit.
-cpuunits  integer (0 - 500000)   (default=1000)
           CPU weight for a VM. Argument is used in the kernel fair scheduler.
           The larger the number is, the more CPU time this VM gets.
           Number is relative to weights of all the other running VMs.
           NOTE: You can disable fair-scheduler configuration by setting this to 0.
-delete    string
           A list of settings you want to delete.
-description string
           Description for the VM. Only used on the configuration web interface.
           This is saved as comment inside the configuration file.
-digest    string
           Prevent changes if current configuration file has different SHA1 digest.
           This can be used to prevent concurrent modifications.
-force     boolean
           Force physical removal. Without this, we simple remove the disk from the config file and
           create an additional configuration entry called 'unused[n]', which contains the volume ID.
           Unlink of unused[n] always cause physical removal.
           Requires option(s): delete
-freeze    boolean
           Freeze CPU at startup (use 'c' monitor command to start execution).
-hostpci[n] [host=]HOSTPCIDEVICE [,rombar=on|off] [,pcie=0|1] [,x-vga=on|off]
           Map host pci devices. HOSTPCIDEVICE syntax is: 'bus:dev.func' (hexadecimal numbers)
           You can us the 'lspci' command to list existing pci devices. The 'rombar' option determines
           whether or not the device's ROM will be visible in the guest's memory map (default is 'on').
           Note: This option allows direct access to host hardware. So it is no longer possible to
           migrate such machines - use with special care.
           Experimental: user reported problems with this option.
-hotplug   string   (default=network,disk,usb)
           Selectively enable hotplug features. This is a comma separated list of hotplug features:
           'network', 'disk', 'cpu', 'memory' and 'usb'.
           Use '0' to disable hotplug completely.
           Value '1' is an alias for the default 'network,disk,usb'.
-ide[n]    [file=]<volume> [,aio=<native|threads>] [,backup=<on|off>] [,bps=<bps>] [,bps_rd=<bps>]
           [,bps_wr=<bps>] [,cache=<none|writethrough|writeback|unsafe|directsync>] [,cyls=<count>]
           [,discard=<ignore|on>] [,format=<drive format>] [,heads=<count>] [,iops=<iops>]
           [,iops_max=<iops>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_wr=<iops>]
           [,iops_wr_max=<iops>] [,mbps=<mbps>] [,mbps_max=<mbps>] [,mbps_rd=<mbps>]
           [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>] [,media=<cdrom|disk>]
           [,model=<model>] [,rerror=<ignore|report|stop>] [,secs=<count>] [,serial=<serial>]
           [,snapshot=<on|off>] [,trans=<none|lba|auto>] [,werror=<enospc|ignore|report|stop>]
           Use volume as IDE hard disk or CD-ROM (n is 0 to 3).
-keyboard  (da | de | de-ch | en-gb | en-us | es | fi | fr | fr-be | fr-ca | fr-ch | hu | is | it | ja
           | lt | mk | nl | no | pl | pt | pt-br | sl | sv | tr)   (default=en-us)
           Keybord layout for vnc server. Default is read from the datacenter configuration file.
-kvm	     boolean   (default=1)
           Enable/disable KVM hardware virtualization.
-localtime boolean
           Set the real time clock to local time. This is enabled by default if ostype indicates a
           Microsoft OS.
-lock      (backup | migrate | rollback | snapshot)
           Lock/unlock the VM.
-machine   (pc|pc(-i440fx)?-\d+\.\d+(\.pxe)?|q35|pc-q35-\d+\.\d+(\.pxe)?)
           Specific the Qemu machine type.
-memory    integer (16 - N)	(default=512)
           Amount of RAM for the VM in MB. This is the maximum available memory when you use the
           balloon device.
-migrate_downtime number (0 - N)   (default=0.1)
           Set maximum tolerated downtime (in seconds) for migrations.
-migrate_speed integer (0 - N)   (default=0)
           Set maximum speed (in MB/s) for migrations. Value 0 is no limit.
-name      string
           Set a name for the VM. Only used on the configuration web interface.
-net[n]    MODEL=XX:XX:XX:XX:XX:XX [,bridge=<dev>][,queues=<nbqueues>][,rate=<mbps>][,tag=<vlanid>]
           [,trunks=<vlanid[;vlanid]>][,firewall=0|1],link_down=0|1]
           Specify network devices.
           MODEL is one of: e1000 e1000-82540em e1000-82544gc e1000-82545em i82551 i82557b i82559er
           ne2k_isa ne2k_pci pcnet rtl8139 virtio vmxnet3
           XX:XX:XX:XX:XX:XX should be an unique MAC address. This is automatically generated if not 
           specified.
           The bridge parameter can be used to automatically add the interface to a bridge device.
           The Proxmox VE standard bridge is called 'vmbr0'.
           Option 'rate' is used to limit traffic bandwidth from and to this interface.
           It is specified as floating point number, unit is 'Megabytes per second'.
           If you specify no bridge, we create a kvm 'user' (NATed) network device, which provides DHCP
           and DNS services.
           The following addresses are used:
           10.0.2.2 Gateway
           10.0.2.3 DNS Server
           10.0.2.4 SMB Server
           The DHCP server assign addresses to the guest starting from 10.0.2.15.
-numa      boolean   (default=0)
           Enable/disable Numa.
-numa[n]   cpus=<id[-id],memory=<mb>[[,hostnodes=<id[-id]>][,policy=<preferred|bind|interleave>]]
           numa topology
-onboot    boolean   (default=0)
           Specifies whether a VM will be started during system bootup.
-ostype    (l24 | l26 | other | solaris | w2k | w2k3 | w2k8 | win7 | win8 | wvista | wxp)
           Used to enable special optimization/features for specific operating systems:
           other  => unspecified OS
           wxp    => Microsoft Windows XP
           w2k    => Microsoft Windows 2000
           w2k3   => Microsoft Windows 2003
           w2k8   => Microsoft Windows 2008
           wvista => Microsoft Windows Vista
           win7   => Microsoft Windows 7
           win8   => Microsoft Windows 8/2012
           l24    => Linux 2.4 Kernel
           l26    => Linux 2.6/3.X Kernel
           solaris => solaris/opensolaris/openindiania kernel
           other|l24|l26|solaris               ... no special behaviour
           wxp|w2k|w2k3|w2k8|wvista|win7|win8  ... use --localtime switch
-parallel[n] /dev/parport\d+|/dev/usb/lp\d+
           Map host parallel devices (n is 0 to 2).
           Note: This option allows direct access to host hardware. So it is no longer possible to
           migrate such machines - use with special care.
           Experimental: user reported problems with this option.
-protection boolean	(default=0)
           Sets the protection flag of the VM. This will prevent the remove operation.
-reboot    boolean   (default=1)
           Allow reboot. If set to '0' the VM exit on reboot.
-revert    string
           Revert a pending change.
-sata[n]   [file=]<volume> [,aio=<native|threads>] [,backup=<on|off>] [,bps=<bps>] [,bps_rd=<bps>]
           [,bps_wr=<bps>] [,cache=<none|writethrough|writeback|unsafe|directsync>] [,cyls=<count>]
           [,discard=<ignore|on>] [,format=<drive format>] [,heads=<count>] [,iops=<iops>]
           [,iops_max=<iops>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_wr=<iops>]
           [,iops_wr_max=<iops>] [,mbps=<mbps>] [,mbps_max=<mbps>] [,mbps_rd=<mbps>]
           [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>] [,media=<cdrom|disk>]
           [,rerror=<ignore|report|stop>] [,secs=<count>] [,serial=<serial>] [,snapshot=<on|off>]
           [,trans=<none|lba|auto>] [,werror=<enospc|ignore|report|stop>]
           Use volume as SATA hard disk or CD-ROM (n is 0 to 5).
-scsi[n]   [file=]<volume> [,aio=<native|threads>] [,backup=<on|off>] [,bps=<bps>] [,bps_rd=<bps>]
           [,bps_wr=<bps>] [,cache=<none|writethrough|writeback|unsafe|directsync>] [,cyls=<count>]
           [,discard=<ignore|on>] [,format=<drive format>] [,heads=<count>] [,iops=<iops>]
           [,iops_max=<iops>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_wr=<iops>]
           [,iops_wr_max=<iops>] [,iothread=<off|on>] [,mbps=<mbps>] [,mbps_max=<mbps>]
           [,mbps_rd=<mbps>] [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>]
           [,media=<cdrom|disk>] [,queues=<nbqueues>] [,secs=<count>] [,serial=<serial>]
           [,snapshot=<on|off>] [,trans=<none|lba|auto>] [,werror=<enospc|ignore|report|stop>]
           Use volume as SCSI hard disk or CD-ROM (n is 0 to 13).
-scsihw    (lsi | lsi53c810 | megasas | pvscsi | virtio-scsi-pci | virtio-scsi-single)   (default=lsi)
           scsi controller model
-serial[n] (/dev/.+|socket)
           Create a serial device inside the VM (n is 0 to 3), and pass through a host serial device
           (i.e. /dev/ttyS0), or create a unix socket on the host side (use 'qm terminal' to open a
           terminal connection).
           Note: If you pass through a host serial device, it is no longer possible to migrate such 
           machines - use with special care.
           Experimental: user reported problems with this option.
-shares    integer (0 - 50000)   (default=1000)
           Amount of memory shares for auto-ballooning. The larger the number is, the more memory this
           VM gets. Number is relative to weights of all other running VMs.
           Using zero disables auto-ballooning
-skiplock  boolean
           Ignore locks - only root is allowed to use this option.
-smbios[n] [family=<str>] [,manufacturer=<name>] [,product=<name>] [,serial=<str>] [,sku=<str>]
           [,uuid=<UUID>] [,version=<str>]
           Specify SMBIOS type 1 fields.
-smp	     integer (1 - N)   (default=1)
           The number of CPUs. Please use option -sockets instead.
-sockets   integer (1 - N)   (default=1)
           The number of CPU sockets.
-startdate (now | YYYY-MM-DD | YYYY-MM-DDTHH:MM:SS)	(default=now)
           Set the initial date of the real time clock.
           Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'.
-startup   [[order=]\d+] [,up=\d+] [,down=\d+] 
           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.
-tablet    boolean   (default=1)
           Enable/disable the usb tablet device.
           This device is usually needed to allow absolute mouse positioning with VNC.
           Else the mouse runs out of sync with normal VNC clients. If you are running lots of
           console-only guests on one host, you may consider disabling this to save some context
           switches.
           This is turned of by default if you use spice (vga=qxl).
-tdf	     boolean   (default=0)
           Enable/disable time drift fix.
-template  boolean   (default=0)
           Enable/disable Template.
-unused[n] string
           Reference to unused volumes.
-usb[n]    [host=]<HOSTUSBDEVICE|spice> [,usb3=<yes|no>]
           Configure an USB device (n is 0 to 4). This can be used to pass-through usb devices to the
           guest.
           HOSTUSBDEVICE syntax is:
           'bus-port(.port)*' (decimal numbers) or
           'vendor_id:product_id' (hexadeciaml numbers) or
           'spice'
           You can use the 'lsusb -t' command to list existing usb devices.
           Note: This option allows direct access to host hardware. So it is no longer possible to
           migrate such machines - use with special care.
           The value 'spice' can be used to add a usb redirection devices for spice.
           The 'usb3' option determines whether the device is a USB3 device or not (this does currently
           not work reliably with spice redirection and is then ignored).
-vcpus     integer (1 - N)   (default=0)
           Number of hotplugged vcpus.
-vga	     (cirrus | qxl | qxl2 | qxl3 | qxl4 | serial0 | serial1 | serial2 | serial3 | std | vmware)
           Select VGA type. If you want to use high resolution modes (>=1280x1024x16) then you should
           use option 'std' or 'vmware'. Default is 'std' for win8/win7/w2k8, and 'cirrur' for other
           OS types.
           Option 'qxl' enables the SPICE display sever.
           You can also run without any graphic card using a serial devive as terminal.
-virtio[n] [file=]<volume> [,aio=<native|threads>] [,backup=<on|off>] [,bps=<bps>] [,bps_rd=<bps>]
           [,bps_wr=<bps>] [,cache=<none|writethrough|writeback|unsafe|directsync>] [,cyls=<count>]
           [,discard=<ignore|on>] [,format=<drive format>] [,heads=<count>] [,iops=<iops>]
           [,iops_max=<iops>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_wr=<iops>]
           [,iops_wr_max=<iops>] [,iothread=<off|on>] [,mbps=<mbps>] [,mbps_max=<mbps>]
           [,mbps_rd=<mbps>] [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>]
           [,media=<cdrom|disk>] [,rerror=<ignore|report|stop>] [,secs=<count>] [,serial=<serial>]
           [,snapshot=<on|off>] [,trans=<none|lba|auto>] [,werror=<enospc|ignore|report|stop>]
           Use volume as VIRTIO hard disk (n is 0 to 15).
-watchdog  [[model=]i6300esb|ib700] [,[action=]reset|shutdown|poweroff|pause|debug|none]
           Create a virtual hardware watchdog device.
           Once enabled (by a guest action), the watchdog must be periodically polled by an agent
           inside the guest or else the guest will be restarted (or execute the action specified)

Commande :

pvesh set /nodes/nom_du_noeud/qemu/identifiant_du_container/ resize -disk nom_du_disque -size taille_a_ajouter [Options]

Note:

Nom du noeud : c’est le nom de la machine sur lequel se trouve le container.
Identifiant du container : identifiant du container sur lequel on souhaite modifier la taille du disque.
Nom du disque : identifiant du disque a redimmensionner.
Taille à ajouter : + la taille souhaitée et le multiplicateur Giga (G), Méga (M) etc…
Options : Voir le détail ci-dessous.

Important:

Attention : la réduction de taille n’est pas supportée !!!
Pour obtenir le nom du disque se référer à la configuration du container (voir l’obtention de la configuration plus haut).

Exemple :

pvesh set /nodes/px1/qemu/100/resize -disk=sata0 -size=+1G

Sortie :

200 OK

Options :

Extend volume size.
-digest    string
           Prevent changes if current configuration file has different SHA1 digest.
           This can be used to prevent concurrent modifications.
-disk      (ide0 | ide1 | ide2 | ide3 | sata0 | sata1 | sata2 | sata3 | sata4 | sata5 | scsi0 | scsi1
           | scsi10 | scsi11 | scsi12 | scsi13 | scsi2 | scsi3 | scsi4 | scsi5 | scsi6 | scsi7 | scsi8
           | scsi9 | virtio0 | virtio1 | virtio10 | virtio11 | virtio12 | virtio13 | virtio14 | virtio15
           | virtio2 | virtio3 | virtio4 | virtio5 | virtio6 | virtio7 | virtio8 | virtio9)
           The disk you want to resize.
-size      \+?\d+(\.\d+)?[KMGT]?
           The new size.
           With the '+' sign the value is added to the actual size of the volume and without it, the
           value is taken as an absolute one. Shrinking disk size is not supported.
-skiplock  boolean
           Ignore locks - only root is allowed to use this option.

Commande :

pvesh create /nodes/nom_du_noeud/vzdump -vmid=identifiant_du_container -mode=mode_de_sauvegarde -compress=mode_de_compression -storage=emplacement_du_stockage -remove=remove [Options]

Note:

Nom_du_noeud : c’est le nom de la machine sur lequel se trouve le container.
Identifiant_du_container : identifiant du container sur lequel on souhaite faire une sauvegarde.
Mode_de_sauvegarde : Suspend = met en pause la machine, Stop = Stoppe la machine et Snapshot = réalise un stop en réalité.
Mode_de_compression : lzo par défaut, gzip ou aucune, voir les options.
Emplacement_du_stockage : emplacement ou mettre la sauvegarde (dans le sens du stockage définit sur Proxmox).
Remove : Définit le nombre de sauvegarde antérieur a conserver, 0 garde tout, et fonction du paramètre maxfiles…
Options : Voir le détail ci-dessous.

Exemple :

pvesh create /nodes/px1/vzdump -vmid=100 -mode=stop -compress=lzo -storage=local -remove=0

Sortie :

INFO: starting new backup job: vzdump 100 --remove 0 --compress lzo --node px1 --storage local --mode stop
INFO: Starting Backup of VM 100 (qemu)
INFO: status = running
INFO: update VM 100: -lock backup
INFO: backup mode: stop
INFO: ionice priority: 7
INFO: stopping vm
INFO: snapshots found (not included into backup)
INFO: creating archive '/var/lib/vz/dump/vzdump-qemu-100-2016_02_26-13_32_58.vma.lzo'
INFO: starting kvm to execute backup task
Running as unit 100.scope.
INFO: started backup task '93ad08bd-2b2f-48b3-ac20-967097c7fcbb'
INFO: resume VM
INFO: status: 0% (199032832/35433480192), sparse 0% (128159744), duration 3, 66/23 MB/s
INFO: status: 1% (404750336/35433480192), sparse 0% (141422592), duration 7, 51/48 MB/s
INFO: status: 2% (718143488/35433480192), sparse 0% (185581568), duration 13, 52/44 MB/s
INFO: status: 3% (1109458944/35433480192), sparse 0% (203128832), duration 21, 48/46 MB/s
INFO: status: 4% (1437204480/35433480192), sparse 0% (265756672), duration 27, 54/44 MB/s
INFO: status: 5% (1799356416/35433480192), sparse 1% (528769024), duration 33, 60/16 MB/s
INFO: status: 6% (2129395712/35433480192), sparse 2% (858480640), duration 38, 66/0 MB/s
INFO: status: 7% (2519072768/35433480192), sparse 3% (1140248576), duration 44, 64/17 MB/s
INFO: status: 8% (2848129024/35433480192), sparse 4% (1469304832), duration 49, 65/0 MB/s
INFO: status: 9% (3251175424/35433480192), sparse 5% (1872351232), duration 55, 67/0 MB/s
…
…
…
INFO: status: 95% (33689042944/35433480192), sparse 89% (31587184640), duration 524, 63/0 MB/s
INFO: status: 96% (34076950528/35433480192), sparse 90% (31975092224), duration 530, 64/0 MB/s
INFO: status: 100% (35433480192/35433480192), sparse 94% (33331621888), duration 535, 271/0 MB/s
INFO: transferred 35433 MB in 535 seconds (66 MB/s)
INFO: archive file size: 991MB
INFO: vm is online again after 541 seconds
INFO: Finished Backup of VM 100 (00:09:02)
INFO: Backup job finished successfully
200 OK
UPID:px1:00000B3C:0146FC0C:56D045FA:vzdump::root@pam:

Options :

Create backup.
-all	     boolean   (default=0)
           Backup all known VMs on this host.
-bwlimit   integer (0 - N)
           Limit I/O bandwidth (KBytes per second).
-compress  (0 | 1 | gzip | lzo)   (default=lzo)
           Compress dump file.
-dumpdir   string
           Store resulting files to specified directory.
-exclude   string
           exclude specified VMs (assumes --all)
-exclude-path string
           exclude certain files/directories (shell globs).
-ionice    integer (0 - 8)
           Set CFQ ionice priority.
-lockwait  integer (0 - N)
           Maximal time to wait for the global lock (minutes).
-mailnotification (always | failure)	 (default=always)
           Specify when to send an email
-mailto    string
           no description available
-maxfiles  integer (1 - N)
           Maximal number of backup files per VM.
-mode      (snapshot | stop | suspend)   (default=stop)
           Backup mode.
-pigz      integer   (default=0)
           Uses pigz instead of gzip when N>0. N=1 uses half of cores, N>1 uses N as thread count.
-quiet     boolean   (default=0)
           Be quiet.
-remove    boolean   (default=1)
           Remove old backup files if there are more than 'maxfiles' backup files.
-script    string
           Use specified hook script.
-size      integer (500 - N)
           LVM snapshot size in MB.
-stdexcludes boolean	 (default=1)
           Exclude temorary files and logs.
-stdout    boolean
           Write tar to stdout, not to a file.
-stop      boolean   (default=0)
           Stop runnig backup jobs on this host.
-stopwait  integer (0 - N)
           Maximal time to wait until a VM is stopped (minutes).
-storage   string
           Store resulting file to this storage.
-tmpdir    string
           Store temporary files to specified directory.
-vmid      string
           The ID of the VM you want to backup.
Ce site web utilise des cookies. En utilisant le site Web, vous acceptez le stockage de cookies sur votre ordinateur. Vous reconnaissez également que vous avez lu et compris notre politique de confidentialité. Si vous n'êtes pas d'accord, quittez le site.En savoir plus