Commit Graph

2154 Commits

Author SHA1 Message Date
Dietmar Maurer
0d18dcfc27 add save/load snapshot information, add basic snapshot handling stubs 2012-09-07 11:51:19 +02:00
Alexandre Derumier
fc46aff9fa add qemu_volume_snapshot_delete
We need to split the delvm monitor command, like savevm, to delete snapshot onlinefor each volume (qcow2,sheepdog,rbd)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:47:05 +02:00
Alexandre Derumier
e8f3f18e3d add qga_unfreezefs
empty for now, need to implement

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:47:00 +02:00
Alexandre Derumier
3d5149c925 add qga_freezefs
empty for now, need to implement

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:46:57 +02:00
Alexandre Derumier
ae2aa1a876 add qemu_snapshot_end
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:46:55 +02:00
Alexandre Derumier
182e97d9b0 add qemu_snapshot_start
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:46:52 +02:00
Alexandre Derumier
9dbd1ee434 add qm snapshot command
qm snapshot <vmid> <action> <snapshotname> --vmstate --freezefs

action : create|rollback|delete

vmstate : save the vmstate

freezefs: freezefs with qemu-ga

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:46:49 +02:00
Alexandre Derumier
1ab0057c8b add qemu_volume_snapshot
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-06 10:42:44 +02:00
Dietmar Maurer
be79c214ac set correct default for new 'agent' option
We do not enable that by default for now.
2012-09-04 06:46:53 +02:00
Dietmar Maurer
bc84dcca7d rename option 'qga' to 'agent' 2012-09-04 06:44:08 +02:00
Alexandre Derumier
ab6a046f6b add qemu guest agent support
this add chardev and virtio-serial devices for communication with guest agent.

vmconfig option :
qga: 1

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-09-04 06:29:10 +02:00
Dietmar Maurer
972511a06a migrate: disable xbzrle for now.
This is not stable, and sometimes cause endless migration (migration never stops).
2012-08-31 11:02:47 +02:00
Dietmar Maurer
94235c592c avoid warning about uninitialized value 2012-08-30 12:15:07 +02:00
Dietmar Maurer
b0b756c14d migrate: tolerate query-migrate errors 2012-08-30 09:28:24 +02:00
Dietmar Maurer
9bf371a66b use mbps instead of bps
The new parser automatically converts old bps to mbps.
2012-08-30 07:57:59 +02:00
Dietmar Maurer
f36ed4f4a0 cleanup: split out parse_size 2012-08-29 13:01:52 +02:00
Dietmar Maurer
03e480fce3 allow to specify sata as boot disk 2012-08-29 09:19:21 +02:00
Alexandre Derumier
e18b0b9964 livemigrate : activate xbzrle cache
This help migrate for vm with of lot of memory access (like database)

live migration tests working:

kvm 1.2 -> kvm 1.2  (xbzrle set on both side)
kvm 1.1 -> kvm 1.2 (xbzrle on target)
kvm 1.1 -> kvm 1.1 (xbzrle not set, qmp command try to set xbzrle but fail)

failing migration

kvm 1.2 -> kvm 1.1 fail, but this is expected.

I tested with a memory benchmark running on the vm with 4GB ram

without xbzrle : migration take 10min, with many network hang
with xbzrle : migration take 1min, no hang

I display xbzrle counters for debug purpose, we can remove them later

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-29 07:55:21 +02:00
Alexandre Derumier
d454d04033 use scsi-generic by default with libiscsi
This add scsi passthrough with libiscsi

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-29 07:50:48 +02:00
Alexandre Derumier
29972af3aa scsihw: add megasas controller
It could be useful for windows7 and windows2008 , as they are no more classic lsi driver for these platform

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-29 07:40:07 +02:00
Dietmar Maurer
2ae10d4e22 fix bug 247: retry qmp open 2012-08-27 13:43:30 +02:00
Dietmar Maurer
14db53662a set default qmp timout to 3 seconds
And allow to pass timeout paramater to vm_qmp_command().
2012-08-27 13:13:36 +02:00
Alexandre Derumier
eb26097ef4 remove qmp socket file on vm_stop_cleanup
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-27 06:59:38 +02:00
Dietmar Maurer
af30308f36 we call vm_stop to target host,
to be sure that kvm process is killed (but it should kill itself),
and deactivate volumes

I slightly modified this patch (orig. from Alexandre) so that it apply cleanly.
2012-08-23 10:28:41 +02:00
Alexandre Derumier
e52bd94c7e live migration: reduce sleep when remaining memory is low
Reduce sleep to 0.3s when remaining memory is lower than the average transfert in 1 iteration.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:37:59 +02:00
Dietmar Maurer
f5eb281ad3 cleanup: detete trailing whitespace 2012-08-23 07:36:48 +02:00
Alexandre Derumier
b67900f17a put target vm in singlestep mode and resume it only when config is moved
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:32:21 +02:00
Dietmar Maurer
d691e6d3ec pve-bridge: use enviroment variable PVE_MIGRATED_FROM
We use environment variable to pass additional information the
the network script.
2012-08-23 07:26:41 +02:00
Alexandre Derumier
7e8dcf2cb0 add migratedfrom param to start vm with conf file an another node
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:18:36 +02:00
Alexandre Derumier
c04b5b04de implement phase2_cleanup
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:17:15 +02:00
Alexandre Derumier
b8d208023b move config file in phase3, when live migration is finished
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-23 07:16:45 +02:00
Dietmar Maurer
7f4a5b5a6e fix bug #236: use correct shutdown timeout 2012-08-21 11:39:17 +02:00
Dietmar Maurer
a265061979 allow only 16 virtio devices
This is the same number we have in 1.9. In future, most users will uses virtio-scsi, so there is no real need to support more devices here.
2012-08-21 10:03:17 +02:00
Alexandre Derumier
9862764175 print_pci_addr : check if $bridges is initialized
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-21 09:59:42 +02:00
Alexandre Derumier
40f28a9fd9 add bridge hotplug
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-20 13:19:16 +02:00
Dietmar Maurer
3c770faaf8 fix description for max number of devices 2012-08-20 12:13:15 +02:00
Alexandre Derumier
5bdcf9379d add pci-bridge support and bump MAX_NET and MAX_VIRTIO to 32 devices
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-20 11:25:48 +02:00
Dietmar Maurer
dab36e1ee9 fix bug 242: re-add old monitor code 2012-08-17 10:34:39 +02:00
Dietmar Maurer
f91b2e4554 fix for resize: final cleanups 2012-08-08 09:25:54 +02:00
Dietmar Maurer
2f48a4f522 fix for resize: only allow to resize one disk. 2012-08-08 08:26:58 +02:00
Dietmar Maurer
3b2773f606 fix for resize: remove useless permission checks 2012-08-08 07:36:51 +02:00
Dietmar Maurer
614e3941a3 fix for resize: avoid conflicting path 2012-08-08 07:34:36 +02:00
Alexandre Derumier
0d02881ce5 qm : add resize
qm resize <vmid> -ide1 +10(G|M|K)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-08 07:25:50 +02:00
Alexandre Derumier
c1175c9264 add qemu_block_resize
this call storage plugin resize first.
storage plugin will
  return undef if we don't need to call qmp block_resize
or
 return 1 if we need to call qmp block_resize

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-08-07 08:11:55 +02:00
Dietmar Maurer
af990afe34 correctly use new disksize() method 2012-08-01 13:44:54 +02:00
Dietmar Maurer
24afaca0b6 add size hint to drive options
We now store the size when we create a drive. This is just a hint, but
good enough to display on the GUI. We can now avoid to query the storage in
vmstatus().
2012-08-01 13:22:43 +02:00
Dietmar Maurer
93ae06e180 Avoid warnings about undefined values 2012-08-01 13:15:57 +02:00
Dietmar Maurer
b1a470ade6 remove more unused subs 2012-08-01 07:29:23 +02:00
Alexandre Derumier
3ea99fc4a1 remove old subs no more used
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-31 11:12:01 +02:00
Alexandre Derumier
cdd2008803 implement virtio-scsi-pci controller
This add the new virtio-scsi controller support.
http://wiki.qemu.org/Features/VirtioSCSI

Guest need kernel >= 3.4 to support. Windows drivers are also available in last virtio-win

Advantages :

- true scsi controller.(like lsi but a lot faster, around 5% slower than virtio-blk)
- multiples disk by controller (256 for now)
- scsi passthrough
- discard support (great for ssd or thinp storages)
- bootable

Hotplug is not yet available in 1.1. (already available in git)

to define lsi or virtio-scsi-pci controller for scsi disk:

scsihw: lsi|virtio-scsi-pci

default is lsi if not defined.
A megasas controller is comming form qemu 1.2, so we'll able to simply add it in the list of scsi controllers

lsi0 and lsi1 controllers have been renamed to generic scsihw0 and scsihw1,
so we can use them for both lsi or virtio-scsi controller type. (and use same pci slot addr).

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-31 11:11:19 +02:00
Dietmar Maurer
eabe0da02d bug fix: allow to set devices directly (-ide1 /dev/XYZ) 2012-07-27 11:59:42 +02:00
Alexandre Derumier
2a7993d9ef replace file_size_info by volume_size_info.
Currently we only find a volume size by using qemu-img info (in file_size_info).

This doesn't works with "virtual" storage like sheepdog,rbd,iscsidirect,nexenta.

This also doesn't work with classic iscsi direct plugin.

So, we need to define a method for each plugin.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-27 10:51:23 +02:00
Dietmar Maurer
373ea5798a migrate: only scan available storages 2012-07-16 10:20:36 +02:00
Alexandre Derumier
0f56d571e4 implement qmp block_set_io_throttle on running vm config update
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-16 09:20:49 +02:00
Alexandre Derumier
f3f323a3fc fixes for qemu_block_set_io_throttle
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-16 09:19:38 +02:00
Dietmar Maurer
522c8f97d7 code cleanup, bump version to 2.0-44 2012-07-16 07:00:28 +02:00
Alexandre Derumier
80b2cbd1b9 migrate: syncdisk : avoid scanning shared storage
Currently we get list from PVE::Storage (for unused volumes), from all storage.
If something goes wrong with the network on host and thenwe can't communicate with a network shared storage(sheepdog,rbd,..),
the vdisk_list die (timeout) and we cannot migrate the vm on another kvm host.(online or offline).

We don't need to scan shared storage, as they are no disk to sync.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-16 06:52:35 +02:00
Dietmar Maurer
a05b47a8a8 migrate: fix warning about uninitialized values
And display acurate byte values instead of KB
2012-07-13 12:37:19 +02:00
Dietmar Maurer
f0002f62f1 fix command timeout 2012-07-13 12:36:40 +02:00
Dietmar Maurer
03a33f3005 new option for vmstatus to query $full informations from KVM using qmp 2012-07-13 09:31:39 +02:00
Dietmar Maurer
7b7c6d1b5d use qmp for everything - remove old monitor code 2012-07-13 09:00:21 +02:00
Dietmar Maurer
ceea9078ad use qmp for vm_devices_list 2012-07-13 08:42:13 +02:00
Dietmar Maurer
9df5cbcc70 implement vm_human_monitor_command using qmp 2012-07-13 07:30:13 +02:00
Dietmar Maurer
26f11676c7 use new QMPClient code 2012-07-13 07:21:34 +02:00
Dietmar Maurer
30a3378acd add PVE::QMPClient.pm
This is experimental code, not used currently.
2012-07-12 12:28:27 +02:00
Alexandre Derumier
ae287df075 qmp_read_available : correctly handle end of response
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-10 10:10:06 +02:00
Dietmar Maurer
bcb7c9cff5 fix whitespace errors 2012-06-26 06:42:18 +02:00
Alexandre Derumier
ce156282e6 convert eject cdrom monitor command to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:39:53 +02:00
Alexandre Derumier
5a7835f572 convert migrate monitor commands to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:38:34 +02:00
Alexandre Derumier
608164747f convert cont monitor command (in vm_start) to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:35:35 +02:00
Alexandre Derumier
ec843725c7 convert migrate_set_downtime monitor command to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:34:56 +02:00
Alexandre Derumier
2f674c7a5f convert migrate_set_speed monitor command to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:34:23 +02:00
Alexandre Derumier
988903cab5 convert system_powerdown and stop nocheck monitor command to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:33:34 +02:00
Alexandre Derumier
816e2c4a53 convert system_reset monitor command to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:31:57 +02:00
Alexandre Derumier
6f1dbbea52 convert block_io_throttle monitor command to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:31:39 +02:00
Alexandre Derumier
2d23ddc5db convert balloon monitor command to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:31:13 +02:00
Alexandre Derumier
12060fe8c3 convert cont monitor command to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:30:45 +02:00
Alexandre Derumier
f77f91f3d4 convert stop monitor command to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:30:29 +02:00
Alexandre Derumier
0eedc444b7 add vm_mon_cmd and vm_mon_cmd_nocheck wrapper
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:29:54 +02:00
Alexandre Derumier
d967756b10 vm_qmp_command : reworks of the sub
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:26:40 +02:00
Alexandre Derumier
f667373f27 qmp_read_avail : reworks
qmp response could me more than 1 json.

we can have 1 json with event info, and 1 json with return infos.

We die if we receive an error message in response.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-26 06:21:02 +02:00
Alexandre Derumier
35cb731c42 check if volume exist on volume update.
for the moment we check only if the real path exist on the host.
This doesn't work for "virtual" device that host doesn't see.(like rbd, virtio-scsi,...).

This add a check if the volid exist in the storage.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-06-25 06:51:17 +02:00
Dietmar Maurer
97d62eb73c fix coding style 2012-05-30 12:08:33 +02:00
Alexandre Derumier
c971c4f221 add basic qmp support
this add qmp socket to kvm process
and anew sub copied from vm_monitor_command:

vm_qmp_command ($vmid, $cmdstr, $nocheck)

$cmdstr could be a simple command to be executed, without argument

vm_qmp_command($vmid,"stop");

or a complex hash with arguments

$cmdstr->{execute}="eject";
$cmdstr->{arguments}->{device}="ide1-cd0";
vm_qmp_command($vmid,$cmdstr);

documentation about qmp commands is here
http://git.qemu.org/?p=qemu.git;a=blob;f=qmp-commands.hx;h=db980fa811325aeca8ad43472ba468702d4a25a2;hb=HEAD

Code must be polish a little more, but it's a start.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-05-30 11:51:16 +02:00
Dietmar Maurer
4fc5242406 fix pool permission checks on create
We do not need Permission.Modify on the pool.
2012-05-30 10:13:51 +02:00
Alexandre Derumier
7e4e69a6d2 die if vdisk_free fail on delete_drive
replace the warn by a die.

 Currently, if we vdisk_free a disk and something goes wrong (network
 storage problem by example), the drive is removed from config and we
 cannot retry to remove it later.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-05-29 07:59:06 +02:00
Dietmar Maurer
f5bdefa483 fix cluster_lock_storage() call 2012-05-24 07:24:24 +02:00
Dietmar Maurer
5d0094ead9 avoid warning if vm does not belong to a pool 2012-05-23 07:42:55 +02:00
Dietmar Maurer
a125592ce0 minor fixes for newer pve-storage versions 2012-05-23 07:24:15 +02:00
Alexandre Derumier
affd2f88ea add diskio throttling option to drive
This add disk io limit to drive options.

I also add the qemu monitor command, but I din't have added yet to Qemu.pm

>From qemu mailing:

Some available features follow as below:
(1) global bps limit.
   -drive bps=xxx            in bytes/s
(2) only read bps limit
   -drive bps_rd=xxx         in bytes/s
(3) only write bps limit
   -drive bps_wr=xxx         in bytes/s
(4) global iops limit
   -drive iops=xxx           in ios/s
(5) only read iops limit
   -drive iops_rd=xxx        in ios/s
(6) only write iops limit
   -drive iops_wr=xxx        in ios/s
(7) the combination of some limits.
   -drive bps=xxx,iops=xxx

Known Limitations:
(1) #1 can not coexist with #2, #3
(2) #4 can not coexist with #5, #6
(3) When bps/iops limits are specified to a small value such as 511 bytes/s,
this VM will hang up. We are considering how to handle this senario.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-05-14 06:48:05 +02:00
Dietmar Maurer
41e7bdb916 removed startall/stopall commands
Because we now support startup priorities, and start/stop order must include containers
2012-04-20 09:30:42 +02:00
Dietmar Maurer
59411c4e10 new startup option to define startup order 2012-04-19 14:28:05 +02:00
Dietmar Maurer
71c11a8301 fix bug #147: allow to set migrate_downtime to 0 2012-04-11 10:54:04 +02:00
Alexandre Derumier
e482cec30b add directsync cache mode
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-04-10 09:21:28 +02:00
Dietmar Maurer
22d646a733 fix bug in storage availability check (migrate) 2012-04-07 08:26:51 +02:00
Dietmar Maurer
b7e0c8bf39 use '-no-kvm-pit-reinjection -no-hpet' for win7 and w2k8 2012-04-05 12:34:33 +02:00
Dietmar Maurer
d7810bc123 fix bug #134: allow to pass file names to qmrestore and 'qm set' 2012-04-02 10:52:05 +02:00
Dietmar Maurer
47152e2ee3 fix bug #12: check storage availability early (migrate) 2012-03-30 09:13:31 +02:00
Dietmar Maurer
8b192abf57 fix bug #121: activate volumes correctly 2012-03-29 11:09:52 +02:00
Dietmar Maurer
036e0e2b4b correctly pass hexadecimal numbers with prefix 0x to kvm
This is related to this change in kvm:

http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commitdiff;h=97aa6e9b8f9df37add21d86fac1a9ca6ce7df9b7
2012-03-29 07:12:43 +02:00
Dietmar Maurer
cce3774992 do not use clusvcadm if we start using 'starturi' parameter 2012-03-27 12:21:15 +02:00
Dietmar Maurer
3be30d6325 avoid recursive calls to clusvcadm 2012-03-27 10:55:59 +02:00
Dietmar Maurer
88fc87b467 fix bug #97: execute 'clusvcadm' commands for HA managed VMs 2012-03-27 10:37:39 +02:00
Dietmar Maurer
191435c643 only wait 1 second to aquire lock on vm_create
Waiting is not necessary, and we want to avoid delays in the GUI.
2012-03-27 09:02:50 +02:00
Dietmar Maurer
18744ba33f corretcly use tag instead of vlan 2012-03-22 06:30:43 +01:00
Derumier Alexandre
5070f384d1 renamme vlan option to tag
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-03-22 06:27:58 +01:00
Dietmar Maurer
fc1ddcdcae use Digest::SHA instead of Digest::SHA1 2012-03-20 12:25:08 +01:00
Derumier Alexandre
3c720aeac6 add vlan for testing
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-03-20 06:12:46 +01:00
Dietmar Maurer
28ef82d3be use scsi inquiry to test if we can use the scsi-block driver
This is basically the same test as done inside the scsi-block driver. This also works for device-mapper multipath devices.
2012-03-19 10:39:43 +01:00
Dietmar Maurer
7fabe17df2 restrict name to DNS format 'dns-name' 2012-03-13 07:00:27 +01:00
Dietmar Maurer
961bfcb224 fix bug 102: remove stale status file on stop 2012-03-01 12:54:06 +01:00
Dietmar Maurer
0581fe4fd6 save description as comment 2012-03-01 08:13:14 +01:00
Dietmar Maurer
3f05af61ff fix lvremove call: avoid 'Not a CODE reference' warning 2012-03-01 06:37:18 +01:00
Dietmar Maurer
684bcdd7a4 revert tablet mice fix 2012-02-29 09:47:31 +01:00
Derumier Alexandre
ce332eeb58 fix tablet mice as default when live migrate
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-02-29 06:49:57 +01:00
Dietmar Maurer
b969cc68fd fix vzdump on stopped vm 2012-02-24 07:40:12 +01:00
Derumier Alexandre
5b805e5081 Support new cpu models
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-02-22 07:18:07 +01:00
Dietmar Maurer
f5782fd0ad fix cdrom permission check 2012-02-20 07:17:47 +01:00
Dietmar Maurer
49f9db93c0 correctly remove cdrom and iscsi devices 2012-02-15 10:48:55 +01:00
Dietmar Maurer
da21653bfb ignore -tdf (avoid kvm warning) - this is no longer needed 2012-02-13 11:18:09 +01:00
Dietmar Maurer
3e21388903 move test for block device to vmtar.c 2012-02-10 07:47:46 +01:00
Dietmar Maurer
a9a94d59f3 only use sparse file scan for files 2012-02-07 11:55:57 +01:00
Dietmar Maurer
6e5c4da7ef fix typo 2012-02-07 10:44:43 +01:00
Dietmar Maurer
efb71b0f8c do not write /etc/mtab when mounting snapshots 2012-02-07 10:41:13 +01:00
Dietmar Maurer
fad02a160f support new lzo compression 2012-02-07 10:40:28 +01:00
Dietmar Maurer
ab6b35dfdf fix typo 2012-02-06 12:52:29 +01:00
Dietmar Maurer
ba68cf0938 use check_volume_access from $rpcenv 2012-02-06 12:36:16 +01:00
Dietmar Maurer
fcbb753e3c use check() instead of check_storage_perm() 2012-02-06 12:19:35 +01:00
Derumier Alexandre
95d6343bfa don't try to hotplug/unplug is device exist/don't exist
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-02-06 07:26:38 +01:00
Dietmar Maurer
502d18a2e7 correctly add/remove VMs to pool 2012-02-03 13:44:12 +01:00
Dietmar Maurer
ae9ca91d80 fix typo 2012-02-03 13:13:47 +01:00
Dietmar Maurer
09d0ee6473 fix CD eject 2012-02-03 10:49:37 +01:00
Dietmar Maurer
ae57f6b352 cleanup update_vm - factor out code to make is simpler 2012-02-03 10:23:50 +01:00
Dietmar Maurer
1858638fe3 replace change_config_nolock with update_config_nolock
We now use cfs_file_write() in order to avoid race conditions between
file IO and cfs operations (read after write works now).
2012-02-02 14:18:41 +01:00
Dietmar Maurer
5d7a6767be cleanup update_vm - carefully reload config after changes
Split out code to delete drive into delete_drive()

Always hotplug after config is written and reloaded.

Do not revert config if hotplug fails.

Do not safe config in add_unused_volume.
2012-02-02 10:57:16 +01:00
Dietmar Maurer
1e68cb191a cleanup update_vm - always reload config
And moved parameter parsing code to top.
2012-02-02 08:35:11 +01:00
Dietmar Maurer
0532bc6391 cleanup update_vm - move param checks to start of function 2012-02-02 07:19:46 +01:00
Dietmar Maurer
a0d1b1a2fe start adding permission checks 2012-02-02 06:57:47 +01:00
Derumier Alexandre
26ee04b6a0 add ahci controller
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-02-02 06:21:47 +01:00
Derumier Alexandre
cdb0931f68 add sata hdd support
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-02-02 06:21:42 +01:00
Derumier Alexandre
5f0c4c32f2 cleanup warning messages
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-30 06:13:14 +01:00
Derumier Alexandre
2630d2a958 add qemu_netdevadd, qemu_netdevdel and add them in hotplug code
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-30 06:06:24 +01:00
Derumier Alexandre
cc4d61824c add print_netdevice_full, print_netdev_full subs
and change code to use it

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-30 05:58:29 +01:00
Derumier Alexandre
3a1e36bb5a add nic hotplug to update_vm
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-30 05:54:54 +01:00
Dietmar Maurer
5d39a18227 add lock around update_vm code 2012-01-27 09:53:48 +01:00
Dietmar Maurer
afdb31d5f8 removed trailing whitespace 2012-01-27 09:35:26 +01:00
Derumier Alexandre
c2a64aa7cf update_vm rework
now we write conf after each option.

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-27 05:55:00 +01:00
Dietmar Maurer
378b359eef use new syntax for permission attribute 2012-01-23 11:59:28 +01:00
Derumier Alexandre
fcdb011702 rework of hotplug/unplug in Qemu.pm
manage errors on more than 1 device
use unused disk for new created disk but failed hotplug

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-23 09:15:57 +01:00
Derumier Alexandre
a4f091a073 add scsi disk hotplug/unplug
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-23 09:14:31 +01:00
Derumier Alexandre
cfc817c710 add lsi controller hotplug
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-23 09:13:01 +01:00
Derumier Alexandre
5e5dcb7362 create qemu_deviceadd, qemu_devicedel, qemu_driveadd, qemu_drivedel, qemu_deviceaddverify, qemu_devicedelverify
and replace code in vm_deviceplug/vm_deviceunplug

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-23 09:09:15 +01:00
Derumier Alexandre
7ebe888a03 print_drivedevice_full : change deviceid: device-scsi to scsi and device-ide to ide
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-23 09:07:21 +01:00
Derumier Alexandre
ec21aa112d rename vm_deviceadd to vm_deviceplug, and vm_devicedel to vm_deviceunplug
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-23 09:06:24 +01:00
Derumier Alexandre
69b6ae0ce3 rename scsicontroller deviceid from scsi0/1 to lsi0/1
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2012-01-23 09:05:34 +01:00
Dietmar Maurer
b6f39da2af use new assemble_vnc_ticket 2012-01-19 09:31:40 +01:00
Dietmar Maurer
f0cab979e5 catch exception when storage does not exists 2012-01-17 13:12:40 +01:00
Dietmar Maurer
254575e971 fix bug #81: do no deactivate volumes in vzdump stop mode
We add a keepActive parameter to stop/shutdown API.
2012-01-17 11:56:56 +01:00
Dietmar Maurer
97439670bc online migration fix: close tunnel later, wait for connection close 2012-01-17 11:25:44 +01:00
Dietmar Maurer
e95fe75f86 use 'da' instead of 'dk' for Danish keyboard
Qemu use that name.
2012-01-09 11:51:28 +01:00
Dietmar Maurer
8610701ae6 add ha flag to status info 2011-12-22 13:18:37 +01:00
Dietmar Maurer
1061648ed4 use timeout flag instead of wait command 2011-12-16 06:35:07 +01:00
Dietmar Maurer
745fed70c0 do not raise exceptions in vm_stop_cleanup 2011-12-16 06:34:35 +01:00
Dietmar Maurer
4d81a1d327 dont raise errors if not needed 2011-12-16 06:32:09 +01:00
Dietmar Maurer
9269013a93 implement forceStop for vm_shutdown 2011-12-15 12:58:29 +01:00
Dietmar Maurer
17eed025b3 use PVE::Tools::run_with_timeout 2011-12-15 11:29:01 +01:00
Derumier Alexandre
231f2e13cb scsi-block auto detection
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-12-13 10:45:39 +01:00
Dietmar Maurer
0888fdce30 fix bootorder 2011-12-08 11:41:58 +01:00
Dietmar Maurer
1c06086781 do not use ehci by default
Because the ehci driver blocks migration (ehci is currently not migratable)
2011-12-08 10:26:59 +01:00
Dietmar Maurer
d68afb26bf improve error message 2011-12-08 10:07:19 +01:00
Dietmar Maurer
72afda82a1 fix migration tunnel 2011-12-08 09:32:09 +01:00
Dietmar Maurer
2b5569777b use cache=none by default (for raw format) 2011-12-07 12:02:34 +01:00
Dietmar Maurer
3b408e826c use new bootindex option 2011-12-07 11:54:31 +01:00
Dietmar Maurer
2ed36a412c code cleanup 2011-12-07 11:41:27 +01:00
Dietmar Maurer
46a84fd400 replace logmsg() with $self->log() 2011-12-07 11:25:20 +01:00
Dietmar Maurer
a3c5221310 fix version parser for qemu-kvm 1.0 2011-12-07 11:16:57 +01:00
Dietmar Maurer
16e903f2dc use new AbstractMigrate.pm 2011-12-07 06:36:20 +01:00
Derumier Alexandre
2b05ac1331 add ide-cd, ide-hd, scsi-cd, scsi-hd, scsi-block to device syntax
ide-cd, ide-hd replace old ide-drive legacy syntax
scsi-cd, iscsi-hd replace old ide-drive legacy syntax
scsi-block is new in qemu 1.0

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-12-07 06:24:36 +01:00
Dietmar Maurer
02d07cf579 fix vm_shutdown bug - pass storecfg parameter 2011-11-30 09:33:43 +01:00
Dietmar Maurer
4bb5a31707 cleanup error messages 2011-11-29 12:43:34 +01:00
Dietmar Maurer
bbbe5146ff fix stopall 2011-11-29 11:14:26 +01:00
Dietmar Maurer
3bcea617bd be more careful when removing snapshots 2011-11-29 06:25:09 +01:00
Dietmar Maurer
b7eeab2151 we can only resume a VM which is running 2011-11-29 06:24:55 +01:00
Dietmar Maurer
a5ed42d347 try to detect errors before starting the background task 2011-11-25 13:25:32 +01:00
Dietmar Maurer
15f231e1c7 do not call check_lock() for sendkey 2011-11-25 13:20:58 +01:00
Dietmar Maurer
ff1a2432c8 activate LVM LVs more carefully
And remove syslog whenever possible (we run most commands as tasks, so
the output is loged anyways)
2011-11-25 08:08:27 +01:00
Dietmar Maurer
48e1a963f4 set correct migrate speed
We overwrite slow kvm default.
2011-11-23 09:13:33 +01:00
Dietmar Maurer
971f27c404 improve error message when archive does not exist 2011-11-23 07:30:43 +01:00
Dietmar Maurer
cf3298e611 fix vzdump stop mode 2011-11-21 06:38:11 +01:00
Dietmar Maurer
ae4915a20d fix cpu usage 2011-11-18 09:35:32 +01:00
Dietmar Maurer
5534dd1ad1 add cache=unsafe mode 2011-11-18 05:48:52 +01:00
Dietmar Maurer
a591eebacb only raise exception when parameter -force is set 2011-11-17 13:36:56 +01:00
Dietmar Maurer
91c94f0a23 implement monitor API 2011-11-09 08:26:46 +01:00
Dietmar Maurer
4f1be36cdc allow node name 'localhost' 2011-11-03 07:39:01 +01:00
Dietmar Maurer
3ada46c9b1 use split_args from PVE::Tools 2011-10-25 12:19:36 +02:00
Dietmar Maurer
2415a44601 use shellquote from PVE::Tools 2011-10-25 11:37:56 +02:00
Dietmar Maurer
5b9d692ae7 allow to pass volume IDs in create_vm (restore) 2011-10-20 11:18:46 +02:00
Dietmar Maurer
bc4dcb99a1 test for CLI when using pipe 2011-10-20 10:51:28 +02:00
Dietmar Maurer
4925fe8ec1 fix shell quoting 2011-10-20 06:39:45 +02:00
Dietmar Maurer
9c502e26f3 enable piped input with qmrestore 2011-10-19 11:27:42 +02:00
Derumier Alexandre
58dc808de2 bugfix scsicontroller
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-19 06:06:09 +02:00
Dietmar Maurer
51586c3a4c implement unique option for restore
Also try to convert old vlanX to new netX syntax.
2011-10-18 09:14:05 +02:00
Dietmar Maurer
a6af7b3e35 destroy old data when restore with --force 2011-10-18 07:42:29 +02:00
Dietmar Maurer
3e16d5fc60 implement qmrestore
Restore is a special case of create_vm.
2011-10-17 13:51:05 +02:00
Dietmar Maurer
66ab1d916c fix vzdump plugin for 2.0 2011-10-14 11:05:06 +02:00
Derumier Alexandre
f19d1c4790 Fix/cleanup disk hotplug
- pass $conf to create_disks sub
- add some checks on results of "drive_del","drive_add","device_del","device_add"
- replace "sleep 2" by iterative sub vm_waitfordevicecleanup

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-14 10:20:05 +02:00
Dietmar Maurer
43779a7baa remove wrong inline comment 2011-10-12 07:42:11 +02:00
Dietmar Maurer
1dc4f49676 further code cleanups 2011-10-11 13:30:18 +02:00
Dietmar Maurer
e8b9c17cac use 'boolean' for hotplug option
cleanup coding style
2011-10-11 13:22:40 +02:00
Derumier Alexandre
2bbed6c09a add a hook to call vm_devicedel with disk is removed from configuration
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-11 13:13:05 +02:00
Derumier Alexandre
2ddd3d2e46 add a hook to call vm_deviceadd when the disk in config file are added
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-11 13:12:46 +02:00
Derumier Alexandre
873c2d698f add vm_devicedel sub
use qm monitor to hot-unplug device.

Currently only virtio disk

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-11 13:12:28 +02:00
Derumier Alexandre
a4dea33125 add vm_deviceadd sub
use qm monitor to hotplug pci device

currently only virtio disk

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-11 13:12:13 +02:00
Derumier Alexandre
86fdcfb229 add vm_devices_list sub
parse qemu "info pci" result

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-11 13:11:54 +02:00
Derumier Alexandre
2ff09f52e8 Add hotplug option
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-11 13:11:05 +02:00
Dietmar Maurer
c6bb9502db add timeout parameter for stop/shotdown 2011-10-11 11:58:34 +02:00
Dietmar Maurer
5fdbe4f023 create background tasks 2011-10-10 13:17:40 +02:00
Dietmar Maurer
be62c45cf9 cleanups 2011-10-05 10:16:20 +02:00
Dietmar Maurer
9f91ff0281 use random_ether_addr() from PVE::Tools 2011-10-05 09:24:49 +02:00
Derumier Alexandre
e5f7f8ed0f remove net6 reservation and add comments for addr1, 2, 29 2011-10-05 06:40:42 +02:00
Derumier Alexandre
f290f8d92b fix net device pci addr 2011-10-04 09:06:56 +02:00
Derumier Alexandre
4513fd8304 fix scsi controllers pci addr 2011-10-04 09:06:52 +02:00
Derumier Alexandre
0a40e8eab5 fix watchdog pci addr
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-04 07:54:21 +02:00
Derumier Alexandre
b78ebef7e7 fix hostpci addr
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-04 07:54:16 +02:00
Derumier Alexandre
13b5a75337 Fix balloon0 device pci addr
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-10-03 07:44:58 +02:00
Dietmar Maurer
32baffb4e0 change default boot order to cdn 2011-09-29 07:43:05 +02:00
Dietmar Maurer
5ee957cced only list 'qemu' VMs 2011-09-26 12:20:05 +02:00
Dietmar Maurer
7878afeb10 cleanup balloon patch - removed debug code 2011-09-16 06:57:54 +02:00
Derumier Alexandre
13a4862059 Balloon ugly hack
add balloon:  parameter to config file

and set balloon at vm start.

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-16 06:40:12 +02:00
Dietmar Maurer
6b64503eb2 fix coding style 2011-09-15 09:11:27 +02:00
Dietmar Maurer
e6c3b671bf fix online migration 2011-09-15 08:31:17 +02:00
Derumier Alexandre
72a063e494 add print_pci_addr
contain devices pci addr and bus mapping
return formated string with bus=pci.x,addr=x

also in this commit, use it for virtio disk

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-15 08:08:47 +02:00
Dietmar Maurer
3ea94c60d2 move code from qmigrate into PVE/QemuMigrate.pm
and make migrate a subcommand of qm
2011-09-14 13:33:34 +02:00
Dietmar Maurer
694fcad480 use new PVE::ProcFSTools::read_proc_pid_stat() 2011-09-14 07:55:34 +02:00
Dietmar Maurer
19672434df delete trailing whitespaces 2011-09-12 12:26:00 +02:00
Dietmar Maurer
7f0b5bebc6 check hvm support before starting VM 2011-09-12 11:03:14 +02:00
Dietmar Maurer
34978be308 fix serial/parallel option - check if device really exists 2011-09-12 08:59:05 +02:00
Dietmar Maurer
e0ab7331aa remove support for old hostusb syntax 2011-09-12 08:41:28 +02:00
Dietmar Maurer
ca0cef2624 Simplify serial/parallel option parser
Remove verify()/parse() methods, because the json schema does
that job already (pattern option)
2011-09-12 07:44:02 +02:00
Dietmar Maurer
2fe1a152f4 Simplify schema for serial/parallel options (use pattern) 2011-09-12 07:08:01 +02:00
Derumier Alexandre
1989a89c95 parallel : new qemu syntax V2
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-12 06:52:34 +02:00
Derumier Alexandre
bae179aa1c serial : new qemu syntax V2
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-12 06:51:47 +02:00
Derumier Alexandre
040b06b73e Hostpci rework v4
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-12 06:50:01 +02:00
Dietmar Maurer
0d29ab3bd2 fix build error 2011-09-09 14:18:11 +02:00
Derumier Alexandre
941e0c42a5 Add scsi controllers V2
only if scsi disk exists

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-09 12:20:19 +02:00
Dietmar Maurer
64e1340181 New method to check if VM uses local resources 2011-09-09 12:13:21 +02:00
Dietmar Maurer
a78ccf26fc Add node parameter to config_file()
That way we can get the filename for VMs on remove nodes.
2011-09-09 09:47:54 +02:00
Dietmar Maurer
0ea9541da0 Add watchdog support 2011-09-08 11:39:56 +02:00
Derumier Alexandre
abb39b66d7 convert old monitor syntax to chardev
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-08 08:27:34 +02:00
Derumier Alexandre
ca916eccfb add print_drivedevice_full sub for disk -device syntax
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-08 08:09:25 +02:00
Derumier Alexandre
3ebfcc8613 change print_drive sub to new device syntax
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-08 08:03:46 +02:00
Derumier Alexandre
f62db2a438 Set max nics=6, max virtio disk=6 and scsi disk to 14 (because we cannot set more than 7 disk by scsi controller)
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
2011-09-08 07:43:49 +02:00
Dietmar Maurer
554ac7e7b7 Add digest to prevent concurrent changes 2011-09-07 11:41:34 +02:00
Dietmar Maurer
1e3baf05f2 imported from svn 'qemu-server/pve2' 2011-08-23 07:47:04 +02:00