Hi gurus, The page http://wiki.xensource.com/xenwiki/XenParavirtOps says disk devices on domu are always /dev/xvdX. And I failed when I try to map a raw disk to domu with the name /dev/sdb. The line ''phy:sdb,sdb,w'' in domu config file doesn''t take effect. Actually I found a raw disk named /dev/xvdf on the domu. Anybody got any idea why xen4 put such restriction? How to map to other names such as /dev/sdb on domu? Thanks, HUAXIANG FAN Software Engineer II WEBSENSE NETWORK SECURITY TECHNOLOGY R&D (BEIJING) CO. LTD. ph: +8610.5884.4327 fax: +8610.5884.4727 www.websense.cn<http://www.websense.cn> Websense TRITON(tm) For Essential Information Protection(tm) Web Security<http://www.websense.com/content/Regional/SCH/WebSecurityOverview.aspx> | Data Security<http://www.websense.com/content/Regional/SCH/DataSecurity.aspx> | Email Security<http://www.websense.com/content/Regional/SCH/MessagingSecurity.aspx> Protected by Websense Hosted Email Security -- www.websense.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
--- On Wed, 5/11/11, Fan, Huaxiang <hufan@websense.com> wrote: From: Fan, Huaxiang <hufan@websense.com> Subject: [Xen-users] disk devices are always /dev/xvdX To: "xen-users@lists.xensource.com" <xen-users@lists.xensource.com> Date: Wednesday, May 11, 2011, 9:50 PM Hi gurus, The page http://wiki.xensource.com/xenwiki/XenParavirtOps says disk devices on domu are always /dev/xvdX. And I failed when I try to map a raw disk to domu with the name /dev/sdb. The line ‘phy:sdb,sdb,w’ in domu config file doesn’t take effect. Actually I found a raw disk named /dev/xvdf on the domu. Anybody got any idea why xen4 put such restriction? How to map to other names such as /dev/sdb on domu? Thanks, HUAXIANG FAN ------------------- Maverick (10.10) will accept sdX from the xm config. Maybe Natty will too, but not Lucid or Karmic, which want xvdX. See also: http://lists.xensource.com/archives/html/xen-users/2011-01/msg00120.html -- Mark _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thanks Mark, I used the domu kernel built from stable/2.6.32.x git branch. It seems only accept xvdX. Any workaround you can offer to rename xvdX to sdX? Otherwise, we might need to change our codes. Thanks in advance Huaxiang -----Original Message----- From: Mark Pryor [mailto:tlviewer@yahoo.com] Sent: Thursday, May 12, 2011 1:03 PM To: Fan, Huaxiang Cc: xen-users@lists.xensource.com Subject: Re: [Xen-users] disk devices are always /dev/xvdX --- On Wed, 5/11/11, Fan, Huaxiang <hufan@websense.com> wrote: From: Fan, Huaxiang <hufan@websense.com> Subject: [Xen-users] disk devices are always /dev/xvdX To: "xen-users@lists.xensource.com" <xen-users@lists.xensource.com> Date: Wednesday, May 11, 2011, 9:50 PM Hi gurus, The page http://wiki.xensource.com/xenwiki/XenParavirtOps says disk devices on domu are always /dev/xvdX. And I failed when I try to map a raw disk to domu with the name /dev/sdb. The line ‘phy:sdb,sdb,w’ in domu config file doesn’t take effect. Actually I found a raw disk named /dev/xvdf on the domu. Anybody got any idea why xen4 put such restriction? How to map to other names such as /dev/sdb on domu? Thanks, HUAXIANG FAN ------------------- Maverick (10.10) will accept sdX from the xm config. Maybe Natty will too, but not Lucid or Karmic, which want xvdX. See also: http://lists.xensource.com/archives/html/xen-users/2011-01/msg00120.html -- Mark <br>To report this as spam, please forward to spam@websense.com. Thank you. Protected by Websense Email Security Gateway — www.websense.com Protected by Websense Hosted Email Security -- www.websense.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, May 12, 2011 at 12:10 PM, Fan, Huaxiang <hufan@websense.com> wrote:> Thanks Mark, > I used the domu kernel built from stable/2.6.32.x git branch. It seems only accept xvdX. Any workaround you can offer to rename xvdX to sdX? Otherwise, we might need to change our codes.AFAIK there is no way to do that. What change of code do you mean? If it''s OS config files (like grub''s menu.lst, or fstab), then the best practice right now is to use LABEL or UUID so it doesn''t really care what the actual disk names are. Another approach you can take is to create custom udev rules which (for example) create a link /dev/sda to /dev/xvda. See existing udev rules for persistent storage (usually in /etc/udev/rules.d or /lib/udev/rules.d) -- Fajar> > Thanks in advance > Huaxiang > > -----Original Message----- > From: Mark Pryor [mailto:tlviewer@yahoo.com] > > > --- On Wed, 5/11/11, Fan, Huaxiang <hufan@websense.com> wrote: > > From: Fan, Huaxiang <hufan@websense.com> > Subject: [Xen-users] disk devices are always /dev/xvdX > To: "xen-users@lists.xensource.com" <xen-users@lists.xensource.com> > Date: Wednesday, May 11, 2011, 9:50 PM > > > > Hi gurus, > > The page > http://wiki.xensource.com/xenwiki/XenParavirtOps says disk devices on domu are always /dev/xvdX. And I failed when I try to map a raw disk to domu with the name /dev/sdb. The line ‘phy:sdb,sdb,w’ in domu config file doesn’t take effect. Actually I found > a raw disk named /dev/xvdf on the domu. > Anybody got any idea why xen4 put such restriction? How to map to other names such as /dev/sdb on domu? > > Thanks, > > HUAXIANG FAN > ------------------- > > Maverick (10.10) will accept sdX from the xm config. Maybe Natty will too, but not Lucid or Karmic, which want xvdX. > > See also: > http://lists.xensource.com/archives/html/xen-users/2011-01/msg00120.html > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thanks Fajar, We have some bash/python scripts hardcode /dev/sdb and /sys/block/sdb/size. udev rules can not change sysfs, right? Those scripts work on 2.6.18-xen domu, but when we migrate to 2.6.32.39 domu, it seems we are reluctant to adjust those codes. Thanks, Huaxiang -----Original Message----- From: Fajar A. Nugraha [mailto:list@fajar.net] Sent: Thursday, May 12, 2011 1:43 PM To: Fan, Huaxiang Cc: xen-users@lists.xensource.com Subject: Re: [Xen-users] disk devices are always /dev/xvdX On Thu, May 12, 2011 at 12:10 PM, Fan, Huaxiang <hufan@websense.com> wrote:> Thanks Mark, > I used the domu kernel built from stable/2.6.32.x git branch. It seems only accept xvdX. Any workaround you can offer to rename xvdX to sdX? Otherwise, we might need to change our codes.AFAIK there is no way to do that. What change of code do you mean? If it''s OS config files (like grub''s menu.lst, or fstab), then the best practice right now is to use LABEL or UUID so it doesn''t really care what the actual disk names are. Another approach you can take is to create custom udev rules which (for example) create a link /dev/sda to /dev/xvda. See existing udev rules for persistent storage (usually in /etc/udev/rules.d or /lib/udev/rules.d) -- Fajar> > Thanks in advance > Huaxiang > > -----Original Message----- > From: Mark Pryor [mailto:tlviewer@yahoo.com] > > > --- On Wed, 5/11/11, Fan, Huaxiang <hufan@websense.com> wrote: > > From: Fan, Huaxiang <hufan@websense.com> > Subject: [Xen-users] disk devices are always /dev/xvdX > To: "xen-users@lists.xensource.com" <xen-users@lists.xensource.com> > Date: Wednesday, May 11, 2011, 9:50 PM > > > > Hi gurus, > > The page > http://wiki.xensource.com/xenwiki/XenParavirtOps says disk devices on domu are always /dev/xvdX. And I failed when I try to map a raw disk to domu with the name /dev/sdb. The line ''phy:sdb,sdb,w'' in domu config file doesn''t take effect. Actually I found > a raw disk named /dev/xvdf on the domu. > Anybody got any idea why xen4 put such restriction? How to map to other names such as /dev/sdb on domu? > > Thanks, > > HUAXIANG FAN > ------------------- > > Maverick (10.10) will accept sdX from the xm config. Maybe Natty will too, but not Lucid or Karmic, which want xvdX. > > See also: > http://lists.xensource.com/archives/html/xen-users/2011-01/msg00120.html > ><br>To report this as spam, please forward to spam@websense.com. Thank you. Protected by Websense Email Security Gateway - www.websense.com Protected by Websense Hosted Email Security -- www.websense.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fan, Huaxiang wrote:>We have some bash/python scripts hardcode /dev/sdb and >/sys/block/sdb/size. udev rules can not change sysfs, right? Those >scripts work on 2.6.18-xen domu, but when we migrate to 2.6.32.39 >domu, it seems we are reluctant to adjust those codes.Oops. It''s always a good idea to set values like that once at the top of a script, if not in a separate config file. With bash it''s fairly easy to do : config=/etc/default/myscript-settings [ -r "${config} ] && . "${config} || <report an error> It''s even more important to do this if you have several separate scripts that woudl share common settings. Never hard code them throughout the code or you find it causes maintenance problems down the road. It doesn''t need Xen to change device names under you - some recent changes have meant hd* devices changing to sd* devices for example. -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi Simon, Thanks for your teaching! I totally agree with all your points. They are kind of legacy codes. We might put effort to review those codes if we can''t rename xvdb back to sdb elegantly. Thanks, Huaxiang -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Simon Hobson Sent: Thursday, May 12, 2011 3:11 PM To: xen-users@lists.xensource.com Subject: RE: [Xen-users] disk devices are always /dev/xvdX Fan, Huaxiang wrote:>We have some bash/python scripts hardcode /dev/sdb and >/sys/block/sdb/size. udev rules can not change sysfs, right? Those >scripts work on 2.6.18-xen domu, but when we migrate to 2.6.32.39 >domu, it seems we are reluctant to adjust those codes.Oops. It''s always a good idea to set values like that once at the top of a script, if not in a separate config file. With bash it''s fairly easy to do : config=/etc/default/myscript-settings [ -r "${config} ] && . "${config} || <report an error> It''s even more important to do this if you have several separate scripts that woudl share common settings. Never hard code them throughout the code or you find it causes maintenance problems down the road. It doesn''t need Xen to change device names under you - some recent changes have meant hd* devices changing to sd* devices for example. -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users <br>To report this as spam, please forward to spam@websense.com. Thank you. Protected by Websense Email Security Gateway - www.websense.com Protected by Websense Hosted Email Security -- www.websense.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
To change it, I think you can try to change this line in the kernel source : drivers/block/xen-blkfront.c #define DEV_NAME "xvd" /* name in /dev */ But i think there is a good reason to it, probably to avoid conflicts with the scsi driver, so i''m waiting for your feedback :) Le 12/05/2011 06:50, Fan, Huaxiang a écrit :> > Hi gurus, > > The page http://wiki.xensource.com/xenwiki/XenParavirtOps says disk > devices on domu are always /dev/xvdX. And I failed when I try to map a > raw disk to domu with the name /dev/sdb. The line ''phy:sdb,sdb,w'' in > domu config file doesn''t take effect. Actually I found a raw disk > named /dev/xvdf on the domu. > > Anybody got any idea why xen4 put such restriction? How to map to > other names such as /dev/sdb on domu? > > Thanks, > > *HUAXIANG FAN* > Software Engineer II > > *WEBSENSE NETWORK SECURITY TECHNOLOGY R&D (BEIJING) CO. LTD.* > ph: +8610.5884.4327 > fax: +8610.5884.4727 > www.websense.cn <http://www.websense.cn> > > *Websense TRITON^(TM) > For Essential Information Protection^(TM) > **Web Security > <http://www.websense.com/content/Regional/SCH/WebSecurityOverview.aspx> | > Data Security > <http://www.websense.com/content/Regional/SCH/DataSecurity.aspx> | > Email Security > <http://www.websense.com/content/Regional/SCH/MessagingSecurity.aspx> > > * > > > > Protected by Websense Hosted Email Security --- www.websense.com > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
As i had time to lose, i tested it and... it works :) Well at least , it seems to work, the VM launch and i see no errors be carfull to not use scsi_mod in the same time. Le 12/05/2011 12:32, Erwan RENIER a écrit :> To change it, I think you can try to change this line in the kernel > source : drivers/block/xen-blkfront.c > #define DEV_NAME "xvd" /* name in /dev */ > > But i think there is a good reason to it, > probably to avoid conflicts with the scsi driver, > so i''m waiting for your feedback :) > > > Le 12/05/2011 06:50, Fan, Huaxiang a écrit : >> >> Hi gurus, >> >> The page http://wiki.xensource.com/xenwiki/XenParavirtOps says disk >> devices on domu are always /dev/xvdX. And I failed when I try to map >> a raw disk to domu with the name /dev/sdb. The line ''phy:sdb,sdb,w'' >> in domu config file doesn''t take effect. Actually I found a raw disk >> named /dev/xvdf on the domu. >> >> Anybody got any idea why xen4 put such restriction? How to map to >> other names such as /dev/sdb on domu? >> >> Thanks, >> >> *HUAXIANG FAN* >> Software Engineer II >> >> *WEBSENSE NETWORK SECURITY TECHNOLOGY R&D (BEIJING) CO. LTD.* >> ph: +8610.5884.4327 >> fax: +8610.5884.4727 >> www.websense.cn <http://www.websense.cn> >> >> *Websense TRITON^(TM) >> For Essential Information Protection^(TM) >> **Web Security >> <http://www.websense.com/content/Regional/SCH/WebSecurityOverview.aspx> >> | Data Security >> <http://www.websense.com/content/Regional/SCH/DataSecurity.aspx> | >> Email Security >> <http://www.websense.com/content/Regional/SCH/MessagingSecurity.aspx> >> >> * >> >> >> >> Protected by Websense Hosted Email Security --- www.websense.com >> >> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thanks Erwan. since all partitions or raw disk on the domu use blkfront driver, I don''t see where the conflict is. Did you mean the domu would use scsi driver for its mapped partitions or disks from dom0? Thanks, Huaxiang From: Erwan RENIER [mailto:erwan.renier@laposte.net] Sent: Thursday, May 12, 2011 9:14 PM Cc: Fan, Huaxiang; xen-users@lists.xensource.com Subject: Re: [Xen-users] disk devices are always /dev/xvdX As i had time to lose, i tested it and... it works :) Well at least , it seems to work, the VM launch and i see no errors be carfull to not use scsi_mod in the same time. Le 12/05/2011 12:32, Erwan RENIER a écrit : To change it, I think you can try to change this line in the kernel source : drivers/block/xen-blkfront.c #define DEV_NAME "xvd" /* name in /dev */ But i think there is a good reason to it, probably to avoid conflicts with the scsi driver, so i''m waiting for your feedback :) Le 12/05/2011 06:50, Fan, Huaxiang a écrit : Hi gurus, The page http://wiki.xensource.com/xenwiki/XenParavirtOps says disk devices on domu are always /dev/xvdX. And I failed when I try to map a raw disk to domu with the name /dev/sdb. The line ''phy:sdb,sdb,w'' in domu config file doesn''t take effect. Actually I found a raw disk named /dev/xvdf on the domu. Anybody got any idea why xen4 put such restriction? How to map to other names such as /dev/sdb on domu? Thanks, HUAXIANG FAN Software Engineer II WEBSENSE NETWORK SECURITY TECHNOLOGY R&D (BEIJING) CO. LTD. ph: +8610.5884.4327 fax: +8610.5884.4727 www.websense.cn<http://www.websense.cn> Websense TRITON(tm) For Essential Information Protection(tm) Web Security<http://www.websense.com/content/Regional/SCH/WebSecurityOverview.aspx> | Data Security<http://www.websense.com/content/Regional/SCH/DataSecurity.aspx> | Email Security<http://www.websense.com/content/Regional/SCH/MessagingSecurity.aspx> Protected by Websense Hosted Email Security - www.websense.com<http://www.websense.com> _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com<mailto:Xen-users@lists.xensource.com> http://lists.xensource.com/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com<mailto:Xen-users@lists.xensource.com> http://lists.xensource.com/xen-users To report this as spam, please forward to spam@websense.com. Thank you. Protected by Websense Email Security Gateway - www.websense.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
that i don''t know, i didn''t test all possible configurations, And i mixed up, it''s sd_mod that must not be loaded( but sd_mod use scsi_mod ) if they rename the xen devices i suppose you can make configs that use both. Le 13/05/2011 04:07, Fan, Huaxiang a écrit :> > Thanks Erwan. since all partitions or raw disk on the domu use > blkfront driver, I don''t see where the conflict is. Did you mean the > domu would use scsi driver for its mapped partitions or disks from dom0? > > Thanks, > > Huaxiang > > *From:*Erwan RENIER [mailto:erwan.renier@laposte.net] > *Sent:* Thursday, May 12, 2011 9:14 PM > *Cc:* Fan, Huaxiang; xen-users@lists.xensource.com > *Subject:* Re: [Xen-users] disk devices are always /dev/xvdX > > As i had time to lose, i tested it and... it works :) > Well at least , it seems to work, the VM launch and i see no errors > be carfull to not use scsi_mod in the same time. > > Le 12/05/2011 12:32, Erwan RENIER a écrit : > > To change it, I think you can try to change this line in the kernel > source : drivers/block/xen-blkfront.c > #define DEV_NAME "xvd" /* name in /dev */ > > But i think there is a good reason to it, > probably to avoid conflicts with the scsi driver, > so i''m waiting for your feedback :) > > > Le 12/05/2011 06:50, Fan, Huaxiang a écrit : > > Hi gurus, > > The page http://wiki.xensource.com/xenwiki/XenParavirtOps says disk > devices on domu are always /dev/xvdX. And I failed when I try to map a > raw disk to domu with the name /dev/sdb. The line ''phy:sdb,sdb,w'' in > domu config file doesn''t take effect. Actually I found a raw disk > named /dev/xvdf on the domu. > > Anybody got any idea why xen4 put such restriction? How to map to > other names such as /dev/sdb on domu? > > Thanks, > > *HUAXIANG FAN* > Software Engineer II > > *WEBSENSE NETWORK SECURITY TECHNOLOGY R&D (BEIJING) CO. LTD.* > ph: +8610.5884.4327 > fax: +8610.5884.4727 > www.websense.cn <http://www.websense.cn> > > *Websense TRITON^(TM) > For Essential Information Protection^(TM) > **Web Security > <http://www.websense.com/content/Regional/SCH/WebSecurityOverview.aspx> | > Data Security > <http://www.websense.com/content/Regional/SCH/DataSecurity.aspx> | > Email Security > <http://www.websense.com/content/Regional/SCH/MessagingSecurity.aspx> > > > * > > Protected by Websense Hosted Email Security --- www.websense.com > <http://www.websense.com> > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com <mailto:Xen-users@lists.xensource.com> > http://lists.xensource.com/xen-users > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com <mailto:Xen-users@lists.xensource.com> > http://lists.xensource.com/xen-users > > > > To report this as spam, please forward to spam@websense.com. Thank you. > > Protected by Websense Email Security Gateway - www.websense.com > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users