[pve-devel] [PATCH] add ide-cd, ide-hd, scsi-cd, scsi-hd, scsi-block to device syntax

Alexandre DERUMIER aderumier at odiso.com
Wed Dec 7 09:39:59 CET 2011


Don't know , i didn't have tested this new feature :) . I don't know if it's work with iscsi block device or only local scsi device.

So, I'm waiting your qemu 1.0 package ;)

Maybe you can wait before commit this patch, I'll do more test when the qemu 1.0 package will be available.




Another thing with qemu 1.0:


They are a new cool features I want to test, like built-in iscsi initiator.(but no multipath yet)
So no more need to use initiator on host. (I'm playing with 400 luns,it begin to take a very long time when the host boot.)

something like that
qemu -drive file=iscsi://10.0.01/iqn.qemu.test/1 

I think I will be the best way to access iscsi devices in the future.


But they are a drawback with current config syntax, if we don't have initiator on the host side, we can't list iscsi devices so and we can't have disk id.

So maybe we can change config syntax from by example:

virtio0: nexenta:0.0.1.scsi-3600144f0f62f0e0000004cd953550008,cache=none

to

virtio0: nexenta:1,cache=none   (just put lunid)


Then 
- If we use host initiator, on vm start, just search the iscsi device path.
- If we use the built-in initiator, just pass lunid in parameter.


Also it's correcting a problem with my nexenta san, when I unmap/remap a disk on a lun, (when I rollback a snapshot by example), 
The disk id change, so I need to reedit the vm config to change the disk id.
Don't know for other iscsi san.

So I think finding path from lunid at vm start is the best way.

What do you think about it ?









----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Derumier Alexandre" <aderumier at odiso.com>, pve-devel at pve.proxmox.com 
Envoyé: Mercredi 7 Décembre 2011 06:28:37 
Objet: RE: [pve-devel] [PATCH] add ide-cd, ide-hd, scsi-cd, scsi-hd, scsi-block to device syntax 

Hi Alexandre, 

Do we really need the 'media=block' option? 

I think that it is easy to detect a block device, so we can automatically use 'scsi-block' in that case? 

Or are there disadvantages? 


> -----Original Message----- 
> From: pve-devel-bounces at pve.proxmox.com [mailto:pve-devel- 
> bounces at pve.proxmox.com] On Behalf Of Derumier Alexandre 
> Sent: Dienstag, 06. Dezember 2011 09:52 
> To: pve-devel at pve.proxmox.com 
> Subject: [pve-devel] [PATCH] 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 at odiso.com> 
> --- 
> PVE/QemuServer.pm | 22 ++++++++++++++++++---- 
> 1 files changed, 18 insertions(+), 4 deletions(-) 
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm 
> index 858b292..d42463d 100644 
> --- a/PVE/QemuServer.pm 
> +++ b/PVE/QemuServer.pm 
> @@ -445,7 +445,7 @@ PVE::JSONSchema::register_standard_option("pve-qm- 
> ide", $idedesc); 
> my $scsidesc = { 
> optional => 1, 
> type => 'string', format => 'pve-qm-drive', 
> - typetext => '[volume=]volume,] [,media=cdrom|disk] 
> [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] 
> [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] 
> [,aio=native|threads]', 
> + typetext => '[volume=]volume,] [,media=cdrom|disk|block] 
> [,cyls=c,heads=h,secs=s[,trans=t]] [,snapshot=on|off] 
> [,cache=none|writethrough|writeback|unsafe] [,format=f] [,backup=yes|no] 
> [,aio=native|threads]', 
> description => "Use volume as SCSI hard disk or CD-ROM (n is 0 to 13).", 
> }; 
> PVE::JSONSchema::register_standard_option("pve-qm-scsi", $scsidesc); 
> @@ -872,6 +872,8 @@ sub print_drivedevice_full { 
> my $device = ''; 
> my $maxdev = 0; 
> 
> + 
> + 
> if ($drive->{interface} eq 'virtio') { 
> my $pciaddr = print_pci_addr("$drive->{interface}$drive->{index}"); 
> $device = "virtio-blk-pci,drive=drive-$drive->{interface}$drive- 
> >{index},id=$drive->{interface}$drive->{index}$pciaddr"; 
> @@ -882,8 +884,19 @@ sub print_drivedevice_full { 
> $maxdev = 7; 
> my $controller = int($drive->{index} / $maxdev); 
> my $unit = $drive->{index} % $maxdev; 
> + my $devicetype = ''; 
> + 
> + if($drive->{media} && $drive->{media} eq 'cdrom') { 
> + $devicetype = "cd"; 
> + } 
> + elsif ($drive->{media} && $drive->{media} eq 'block') { 
> + $devicetype = $drive->{media}; 
> + } 
> + else { 
> + $devicetype = "hd"; 
> + } 
> 
> - $device = "scsi-disk,bus=scsi$controller.0,scsi-id=$unit,drive=drive-$drive- 
> >{interface}$drive->{index},id=device-$drive->{interface}$drive->{index}"; 
> + $device = "scsi-$devicetype,bus=scsi$controller.0,scsi-id=$unit,drive=drive- 
> $drive->{interface}$drive->{index},id=device-$drive->{interface}$drive- 
> >{index}"; 
> } 
> 
> elsif ($drive->{interface} eq 'ide'){ 
> @@ -891,8 +904,9 @@ sub print_drivedevice_full { 
> $maxdev = 2; 
> my $controller = int($drive->{index} / $maxdev); 
> my $unit = $drive->{index} % $maxdev; 
> + my $devicetype = ($drive->{media} && $drive->{media} eq 'cdrom') ? "cd" : 
> "hd"; 
> 
> - $device = "ide-drive,bus=ide.$controller,unit=$unit,drive=drive-$drive- 
> >{interface}$drive->{index},id=device-$drive->{interface}$drive->{index}"; 
> + $device = "ide-$devicetype,bus=ide.$controller,unit=$unit,drive=drive- 
> $drive->{interface}$drive->{index},id=device-$drive->{interface}$drive- 
> >{index}"; 
> } 
> 
> if ($drive->{interface} eq 'usb'){ 
> -- 
> 1.7.2.5 
> 
> _______________________________________________ 
> pve-devel mailing list 
> pve-devel at pve.proxmox.com 
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 





-- 

-- 




	
	Alexandre Derumier 
Ingénieur système 
e-mail : aderumier at odiso.com 
Tél : +33 (0)3 20 68 88 90 
Fax : +33 (0)3 20 68 90 81 
45 Bvd du Général Leclerc 
59100 ROUBAIX - FRANCE 













-------------- 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/20111207/9e6db64f/attachment.vcf>


More information about the pve-devel mailing list