[pve-devel] pci slot assignment proposal (hotplug requirement)

Alexandre DERUMIER aderumier at odiso.com
Fri Aug 26 10:53:41 CEST 2011


Hi,
to make hotplug and livemigration works correctly, we need to fix pci slot assignement of the devices and use new qemu --device syntax.


Currently,  pci slots are automaticly assign in order of the devices in the kvm command line.

So sometime, if you add/remove disk or nic, the pci slot can change and can cause some problem.

exemple : on windows, ip config of a nic is registered by pci slot. So if you change your nic card slot, you lost your config. (yes,i known, fucking windows :p)

So, here a proposal for the pci slot, from 0->30.


pci-id: devicetype
-------------------
0: host brige 
1: serial,parallel,usb controller,ide controller 
2: video 
3: balloon 
4 : audio0 
5 : scsi0 (first scsi controller, scsi disk 1->7) 
6 : scsi1 (second scsi controller,scsi disk 8->14) 
7 : watchdog 
8 : future device 
9 : future device 


10 -> 30 : virtio disk controller,nic or device pci-assign (pci passthough).




10 first devices are fixed in proxmox code.
10->30 devices are vitio disk,nic (virtio or not) and device with pci passthrough






Also, we need to specify pci slot in vm config file for virtio disk and nics:

net0: virtio=76:C5:A0:7C:18:08,bridge=vmbr0,bus=0,addr=11
net1: virtio=76:C5:A0:7C:18:08,bridge=vmbr0,bus=0,addr=13
virtio0: local:100/vm-100-disk-1.raw,bus=0,addr=14
virtio1: local:100/vm-100-disk-1.raw,bus=0,addr=30



bus=0 : for the moment, qemu can use only 1 bus, but maybe more in the future.
addr=10->30 : pci slot number.





Also,

for the moment:
my $MAX_VIRTIO_DISKS = 16;
my $MAX_NETS = 32;

this can cause some problems:
first, we can't have 32 net devices. (only 30 pci slots - others controllers).
and we can't add 16 disk + 17 nics.

We need to have a single value, like $MAX_DEVICES

So,I propose $MAX_DEVICES = 20. (must be enough for common mortals ;)



On the pve-manager side, we could simply add a dropdown list "pci slot" to nic and virtio disk forms, with free pci slots.


What do you think about it ?

Regards,

Alexandre


-------------- next part --------------
A non-text attachment was scrubbed...
Name: aderumier.vcf
Type: text/x-vcard
Size: 183 bytes
Desc: not available
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20110826/3511f5f2/attachment.vcf>


More information about the pve-devel mailing list