Proxmox kvm

Ответить
admin
Администратор
Сообщения: 199
Зарегистрирован: 05 янв 2011, 04:19

Proxmox kvm

Сообщение admin »

Оригинал http://pve.proxmox.com/wiki/Qm_manual


qm(1) Proxmox Documentation qm(1)

NAME
qm - qemu/kvm manager

SYNOPSIS
qm [--skiplock] <command> <vmid> [OPTIONS]

type qm to see a list of valid commands

DESCRIPTION
qm is a script to manage virtual machines with qemu/kvm. You can create
and destroy virtual machines, and control execution
(start/stop/suspend/resume). Besides that, you can use qm to set parameters
in the associated config file. It is also possible to create and delete
virtual disks.

CONFIGURATION
Global server configuration is stored in /etc/pve/qemu-server.cfg.

All configuration files consists of lines in the form

PARAMETER: value

The following defaults can be specified:

keyboard: XX
Keybord layout used for vnc server (for example "fr" for French)

onboot: (yes|no)
Specifies whether a VM will be started during system bootup. Default is
no, meaning the VM will not be started if ONBOOT parameter is omitted.

autostart: (yes|no)
Automatic restart after crash. Default is no. This value is currently
ignored (because we have no monitor).

memory: num
Amount of RAM for the VM in MB. Default value is 512.

cpuunits: num
CPU weight for a VM. Argument is positive non-zero number, passed to and
used in the kernel fair scheduler. The larger the number is, the more CPU
time this VM gets. Maximum value is 500000, minimal is 8. Number is
relative to weights of all the other running VMs. If cpuunits are not
specified, default value of 1000 is used.

NOTE: You can disable fair-scheduler configuration by setting this to 0.

vga: (std|cirrus)
Select VGA type. Default is a Cirrus Logic GD5446 PCI VGA card (cirrus).
If you want to use high resolution modes (>= 1280x1024x16) then you should
use option "std".

tdf: (yes|no)
enable/disable time drift fix [default=yes]

tablet: (yes|no)
enable/disable the usb tablet device [default=yes]. This device is usually
needed to allow absolute mouse positioning. Else the mouse runs out of
sync with normal vnc clients. If you're running lots of console-only
guests on one host, you may consider setting "tablet: no" to save some
context switches.

migrate_downtime: num
set maximum tolerated downtime (in seconds) for migrations. [default=1]

migrate_speed: num
set maximum speed (in MB/s) for migrations. [default=0 (no limit)]

VM CONFIGURATION
Each VM is identified by an unique ID (integer). Configuration for a VM is
stored at "/etc/qemu-server/ID.conf"

Currently, the following parameters are supported:

keyboard: XX
Default is read from global configuration file.

onboot: (yes|no)
Default is read from global configuration file.

autostart: (yes|no)
Default is read from global configuration file.

memory: num
Default is read from global configuration file.

cpuunits: num
Default is read from global configuration file.

migrate_downtime: num
Default is read from global configuration file.

migrate_speed: num
Default is read from global configuration file.

reboot: (yes|no)
Exit instead of rebooting.

name: text
Set a name for the VM. Only used on the configuration web interface.

description: text
Description for the VM. Only used on the configuration web interface.

boot: [a|c|d|n]
boot on floppy (a), hard disk (c), CD-ROM (d), or network (n)
Default is "cad" (disk, floppy, cdrom)

bootdisk: <disk>
enable booting from <disk>
<disk> = <ide0|ide1|ide2|ide3|scsi0|scsi1|scsi2|...

smp: num (please use "sockets" instead)
set the number of CPUs to "num" [default=1]

sockets: num
set the number of CPU sockets to "num" [default=1]

cores: num
set the number of cores per socket to "num" [default=1]

acpi: (yes|no)
enable/disable ACPI [default=yes]

kvm: (yes|no)
enable/disable KVM hardware virtualization [default=yes]

tdf: (yes|no)
Default is read from global configuration file.

tablet: (yes|no)
Default is read from global configuration file.

localtime: (yes|no)
set the real time clock to local time

startdate: (now|YYYY-MM-DD|YYYY-MM-DDTHH-MM-SS)
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". The default value is
"now".

freeze: (yes|no)
freeze CPU at startup (use "c" monitor command to start execution)

vlan0: MODEL=XX:XX:XX:XX:XX:XX[,MODEL=YY:YY:YY:YY:YY:YY]
Specify network devices connected to vlan0. Currently, vlan0 is connected
to vmbr0.

MODEL is one of: ne2k_pci e1000 rtl8139 pcnet virtio ne2k_isa i82551
i82557b i82559er

XX:XX:XX:XX:XX:XX should be an unique MAC address

vlan[1-4094]: MODEL=XX:XX:XX:XX:XX:XX[,MODEL=YY:YY:YY:YY:YY:YY]
Same as vlan0, but vlanX is bridged to vmbrX

vlanu: MODEL=XX:XX:XX:XX:XX:XX[,MODEL=YY:YY:YY:YY:YY:YY]
Same as vlan0, but vlanu uses user mode network stack (NAT). 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 hosts starting from 10.0.2.15.

ostype: (other|wxp|w2k|w2k3|w2k8|wvista|l24|l26)
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
l24 => Linux 2.4 Kernel
l26 => Linux 2.6 Kernel

other|l24|l26 ... no special behaviour
wxp|w2k|w2k3|w2k8|wvista ... use --localtime switch

vga: (std|cirrus)
Default is read from global configuration file.

ide0 - ide3: [volume=]volume,][,media=cdrom|disk]
[,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off]
[,cache=none|writethrough"|writeback] [,format=f][,backup=yes|no]
Use volume as IDE hard disk or CD-ROM.

scsi0 - scsi15: [volume=]volume,][,media=cdrom|disk]
[,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off]
[,cache=none|writethrough"|writeback] [,format=f][,backup=yes|no]
Use volume as SCSI hard disk or CD-ROM.

virtio0 - virtio15: [volume=]volume,][,media=cdrom|disk]
[,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off]
[,cache=none|writethrough"|writeback] [,format=f][,backup=yes|no]
Use file as VIRTIO hard disk.

hostpci: [HOSTPCIDEVICE][,HOSTPCIDEVICE]*
Map host pci devices. HOSTPCIDEVICE syntax is:

"bus:dev.func" (hexadecimal numbers)

You can us the "lspci" command to list existing pci devices.

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

hostusb: [HOSTUSBDEVICE][,HOSTUSBDEVICE]*
Map host usb devices. HOSTUSBDEVICE syntax is:

"bus.addr" (decimal numbers) or
"vendor_id:product_id" (hexadeciaml numbers)

You can us the "lsusb" command to list existing usb devices
(or take a look at "/proc/bus/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.

serial: [SERIALDEVICE][,SERIALDEVICE]*
Experimental: user reported problems with this option

Map host serial devices. SERIALDEVICE syntax is /dev/ttyS*

Note: This option allows direct access to host hardware. So it is no
longer possible to migrate such machines - use with special care.

parallel: [PARALLELDEVICE][,PARALLELDEVICE]*
Experimental: user reported problems with this option

Map host parallel devices. PARALLELDEVICE syntax is /dev/parport*

Note: This option allows direct access to host hardware. So it is no
longer possible to migrate such machines - use with special care.

args: ...
Note: this option is for experts only. It allows you to pass arbitrary
arguments to kvm, for example:

args: -no-reboot -no-hpet

lock: (migrate|backup)
This value is set during online migration (migrate) and vzdump (backup).

Locks
Online migration and backups (vzdump) set a lock to prevent unintentional
action on such VMs. Sometimes you need remove such lock manually
(power failure).


Experimental: user reported problems with this option

hostusb: [HOSTUSBDEVICE][,HOSTUSBDEVICE]*
Map host usb devices. HOSTUSBDEVICE syntax is:

"bus.addr" (decimal numbers) or
"vendor_id:product_id" (hexadeciaml numbers)

You can us the "lsusb" command to list existing usb devices
(or take a look at "/proc/bus/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.

serial: [SERIALDEVICE][,SERIALDEVICE]*
Experimental: user reported problems with this option

Map host serial devices. SERIALDEVICE syntax is /dev/ttyS*

Note: This option allows direct access to host hardware. So it is no
longer possible to migrate such machines - use with special care.

parallel: [PARALLELDEVICE][,PARALLELDEVICE]*
Experimental: user reported problems with this option

Map host parallel devices. PARALLELDEVICE syntax is /dev/parport*

Note: This option allows direct access to host hardware. So it is no
longer possible to migrate such machines - use with special care.

args: ...
Note: this option is for experts only. It allows you to pass arbitrary
arguments to kvm, for example:

args: -no-reboot -no-hpet

lock: (migrate|backup)
This value is set during online migration (migrate) and vzdump (backup).

Locks
Online migration and backups (vzdump) set a lock to prevent unintentional
action on such VMs. Sometimes you need remove such lock manually
(power failure).

qm unlock <vmid>

EXAMPLES
# create a new VM with 4 GB ide disk

qm create 300 -ide0 4 -vlan0 e1000 -cdrom proxmox-mailgateway_2.1.iso

# start the new VM

qm start 300

# send shutdown, then wait until VM is stopped

qm shutdown 300 && qm wait 300

# same as above, but only wait for 40 seconds

qm shutdown 300 && qm wait 300 40

1.1 2010-10-11 qm(1)
Ответить