Skip to contentSkip to conversation

rbd image association

DISCUSSION Roman Alekseev 4 participants 8 messages Jun 3, 2013 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

Is it possible to associate certain rbd device with the appropriate rbd image (for example : image1 > /dev/rbd0)? We always need to map image1 to /dev/rbd0, image2 to /dev/rbd1 etc. Because I'm using /dev/rbd* in some configuration files.

Thanks

Signature · 3 lines
Kind regards,

R. Alekseev
#2 lore raw
In reply to a message not in the archive
Quoted 7 lines · Wolfgang Hennerbichler
Quoted 6 lines · Roman Alekseev

Hi,

Is it possible to associate certain rbd device with the appropriate rbd image (for example : image1 > /dev/rbd0)?
We always need to map image1 to /dev/rbd0, image2 to /dev/rbd1 etc. Because I'm using /dev/rbd* in some configuration files.

Quoted 8 lines

Hi,

I can't remember exactly, but I think there is something like /dev/rbd/<pool>/<imagename> which simply symlinks to /dev/rbdX. This should solve your issue.

Quoted 1 line

Thanks

HTH
Wolfgang

Dear Wolfgang,

I was trying to use the command ln -s /dev/rbd1 image1 but it creates wrong symlink. Most likely there is more specific command to symlink the image and device correctly.

Thanks.

Signature · 3 lines
Kind regards,

R. Alekseev
#3 lore raw
Quoted 14 lines · Roman Alekseev
Quoted 13 lines · Wolfgang Hennerbichler
Quoted 6 lines · Roman Alekseev

Hi,

Is it possible to associate certain rbd device with the appropriate rbd image (for example : image1 > /dev/rbd0)?
We always need to map image1 to /dev/rbd0, image2 to /dev/rbd1 etc. Because I'm using /dev/rbd* in some configuration files.

Hi,

I can't remember exactly, but I think there is something like /dev/rbd/<pool>/<imagename> which simply symlinks to /dev/rbdX. This should solve your issue.

Quoted 1 line

Thanks

Quoted 9 lines
Quoted 3 lines

HTH
Wolfgang

Dear Wolfgang,

I was trying to use the command ln -s /dev/rbd1 image1 but it creates wrong symlink. Most likely there is more specific command to symlink the image and device correctly.

Why are you symlinking? Like Wolfgang mentioned, udev takes care of this for you.

Just use /dev/rbd/pool/imagename which is created by udev.

Quoted 2 lines

Thanks.

Signature · 5 lines
Wido den Hollander
42on B.V.

Phone: +31 (0)20 700 9902
Skype: contact42on
#8 lore raw
In reply to Roman Alekseev
Quoted 5 lines · Roman Alekseev

Dear Wolfgang,

I was trying to use the command ln -s /dev/rbd1 image1 but it creates wrong symlink. Most likely there is more specific command to symlink the image and device correctly.

No, you should not have to do anything manually. I was saying udev should create the symlink for you upon image mapping. If it doesn't, check you udev configuration. It does this for me on ubuntu server.

Quoted 1 line

Thanks.

Wolfgang

Signature · 1 line
http://www.wogri.com
#4 lore raw
In reply to Wido den Hollander
Quoted 1 line · Wido den Hollander

udev takes car

Do you mean we need to create some rules in /etc/udev/rules.d/ directory and after running rbd -p pool map image my image will be mapped with appropriate device?

If so, could you please provide me with the commands which should be presented in that file?

Thanks

Signature · 3 lines
Kind regards,

R. Alekseev
#5 lore raw
Quoted 6 lines · Roman Alekseev
Quoted 1 line · Wido den Hollander

udev takes car

Do you mean we need to create some rules in /etc/udev/rules.d/ directory and after running rbd -p pool map image my image will be mapped with appropriate device?

The ceph package installs a udev rules file in that directory; you shouldn't have to do anything other than the 'rbd map ..' command. If it is not already present, there must be something wrong with the package on the platform you are using. What OS is it?

Quoted 17 lines

If so, could you please provide me with the commands which should be presented in that file?

Thanks

Signature · 8 lines
Kind regards,

R. Alekseev

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw
Quoted 27 lines · Sage Weil
Quoted 5 lines · Roman Alekseev
Quoted 1 line · Wido den Hollander

udev takes car

Do you mean we need to create some rules in /etc/udev/rules.d/ directory and after running rbd -p pool map image my image will be mapped with appropriate device?

The ceph package installs a udev rules file in that directory; you shouldn't have to do anything other than the 'rbd map ..' command. If it is not already present, there must be something wrong with the package on the platform you are using. What OS is it?

Quoted 16 lines

If so, could you please provide me with the commands which should be presented in that file?

Thanks

Signature · 8 lines
Kind regards,

R. Alekseev

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Yep, u're right there is only the file 70-persistent-net.rules in /etc/udev/rules.d/ directory. It is Debian Wheezy 3.2.0-4-amd64

thanks

Signature · 3 lines
Kind regards,

R. Alekseev
#7 lore raw
Quoted 31 lines · Roman Alekseev
Quoted 8 lines · Sage Weil
Quoted 7 lines · Roman Alekseev
Quoted 1 line · Wido den Hollander

udev takes car

Do you mean we need to create some rules in /etc/udev/rules.d/ directory and
after running rbd -p pool map image my image will be mapped with appropriate
device?

Quoted 22 lines

The ceph package installs a udev rules file in that directory; you shouldn't have to do anything other than the 'rbd map ..' command. If it is not already present, there must be something wrong with the package on the platform you are using. What OS is it?

Quoted 17 lines

If so, could you please provide me with the commands which should be presented
in that file?

Thanks

Signature · 8 lines
Kind regards,

R. Alekseev

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Quoted 3 lines

Yep, u're right there is only the file 70-persistent-net.rules in /etc/udev/rules.d/ directory.
It is Debian Wheezy 3.2.0-4-amd64

The file you want is

	/lib/udev/rules.d/50-rbd.rules

which is part of the librbd1 package. dpkg -L librbd1 to verify it is there...

sage