Skip to contentSkip to conversation

pygrub/hvm boot with alternate script= for block devices

DISCUSSION James Dingwall 3 participants 10 messages Jan 19, 2013 – Jan 22, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

I am doing some experimentation with xen and Ceph and have a problem booting my guest when my disk = [] uses an alternate block script. Installation from a .iso was ok since the boot device was a file but now trying to boot from the rbd neither the hvmbuilder or pygrub can start as they treat the first value after target= as the /dev node to try and use.

My disk parameter looks like:
disk = [ 'format=raw, script=block-rbd, vdev=xvda, access=w, target=image=ubuntu-test' ]

In the pygrub log:
OSError: [Errno 2] No such file or directory: 'image=ubuntu-test'

and there is a similar error trying an HVM boot.

My block-rbd script parses the value passed after target= to dynamically rbd map the image and then call the write_dev function from block-common.sh to save the corresponding /dev name in xenstore. According to the logging that I have in my block-rbd script this isn't even called before pygrub is executed.

Is there a good reason that the block devices aren't connected before pygrub is called so that it can then be invoked with the appropriate /dev device that has been written in xenstore?

Thanks,
James

#1 lore raw
Quoted 10 lines · James Dingwall

Hi,

I am doing some experimentation with xen and Ceph and have a problem booting my guest when my disk = [] uses an alternate block script. Installation from a .iso was ok since the boot device was a file but now
trying to boot from the rbd neither the hvmbuilder or pygrub can start as they treat the first value after target= as the /dev node to try and use.

Yes, this is known problem which I'm trying to solve with this series:

http://lists.xen.org/archives/html/xen-devel/2012-12/msg01753.html

Quoted 8 lines

My disk parameter looks like:
disk = [ 'format=raw, script=block-rbd, vdev=xvda, access=w, target=image=ubuntu-test' ]

In the pygrub log:
OSError: [Errno 2] No such file or directory: 'image=ubuntu-test'

Quoted 7 lines

and there is a similar error trying an HVM boot.

My block-rbd script parses the value passed after target= to dynamically rbd map the image and then call the write_dev function from block-common.sh to save the corresponding /dev name in xenstore. According to the logging that I have in my block-rbd script this isn't even called before pygrub is executed.

The only solution right now will be to use PV guests and boot directly with the kernel (no pygrub)

Quoted 3 lines

Is there a good reason that the block devices aren't connected before pygrub is called so that it can then be invoked with the appropriate /dev device that has been written in xenstore?

#2 lore raw
Quoted 26 lines · Roger Pau Monné
Quoted 10 lines · James Dingwall

Hi,

I am doing some experimentation with xen and Ceph and have a problem booting my guest when my disk = [] uses an alternate block script. Installation from a .iso was ok since the boot device was a file but now
trying to boot from the rbd neither the hvmbuilder or pygrub can start as they treat the first value after target= as the /dev node to try and use.

Yes, this is known problem which I'm trying to solve with this series:

http://lists.xen.org/archives/html/xen-devel/2012-12/msg01753.html

Quoted 10 lines

My disk parameter looks like:
disk = [ 'format=raw, script=block-rbd, vdev=xvda, access=w, target=image=ubuntu-test' ]

In the pygrub log:
OSError: [Errno 2] No such file or directory: 'image=ubuntu-test'

and there is a similar error trying an HVM boot.

Quoted 8 lines
Quoted 5 lines

My block-rbd script parses the value passed after target= to dynamically rbd map the image and then call the write_dev function from block-common.sh to save the corresponding /dev name in xenstore. According to the logging that I have in my block-rbd script this isn't even called before pygrub is executed.

The only solution right now will be to use PV guests and boot directly with the kernel (no pygrub)

Does commenting out the stat & check in the short term allow things to work well enough for James' purposes?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 33 lines · Ian Campbell
Quoted 32 lines · Roger Pau Monné
Quoted 10 lines · James Dingwall

Hi,

I am doing some experimentation with xen and Ceph and have a problem booting my guest when my disk = [] uses an alternate block script. Installation from a .iso was ok since the boot device was a file but now
trying to boot from the rbd neither the hvmbuilder or pygrub can start as they treat the first value after target= as the /dev node to try and use.

Yes, this is known problem which I'm trying to solve with this series:

http://lists.xen.org/archives/html/xen-devel/2012-12/msg01753.html

Quoted 15 lines

My disk parameter looks like:
disk = [ 'format=raw, script=block-rbd, vdev=xvda, access=w, target=image=ubuntu-test' ]

In the pygrub log:
OSError: [Errno 2] No such file or directory: 'image=ubuntu-test'

and there is a similar error trying an HVM boot.

My block-rbd script parses the value passed after target= to dynamically rbd map the image and then call the write_dev function from block-common.sh to save the corresponding /dev name in xenstore. According to the logging that I have in my block-rbd script this isn't even called before pygrub is executed.

Quoted 5 lines
Quoted 2 lines

The only solution right now will be to use PV guests and boot directly with the kernel (no pygrub)

Does commenting out the stat & check in the short term allow things to work well enough for James' purposes?

Current hotplug scripts don't have any need to write the dev in xenstore, they only need to write the device major:minor in the physical-device xenstore backend entry. The only way to solve this (with current hotplug scripts) will be to call libxl_device_disk_add earlier on (before pygrub), fetch "physical-device" from xenstore and translate that back into the physical device it points to, and overwrite pdev_path in libxl_device_disk struct with this value.

I would rather wait for the new interface to be finished rather than adding this "hack" to libxl.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 40 lines · Roger Pau Monne
Quoted 33 lines · Ian Campbell
Quoted 32 lines · Roger Pau Monné
Quoted 10 lines · James Dingwall

Hi,

I am doing some experimentation with xen and Ceph and have a problem booting my guest when my disk = [] uses an alternate block script. Installation from a .iso was ok since the boot device was a file but now
trying to boot from the rbd neither the hvmbuilder or pygrub can start as they treat the first value after target= as the /dev node to try and use.

Yes, this is known problem which I'm trying to solve with this series:

http://lists.xen.org/archives/html/xen-devel/2012-12/msg01753.html

Quoted 15 lines

My disk parameter looks like:
disk = [ 'format=raw, script=block-rbd, vdev=xvda, access=w, target=image=ubuntu-test' ]

In the pygrub log:
OSError: [Errno 2] No such file or directory: 'image=ubuntu-test'

and there is a similar error trying an HVM boot.

My block-rbd script parses the value passed after target= to dynamically rbd map the image and then call the write_dev function from block-common.sh to save the corresponding /dev name in xenstore. According to the logging that I have in my block-rbd script this isn't even called before pygrub is executed.

Quoted 5 lines
Quoted 2 lines

The only solution right now will be to use PV guests and boot directly with the kernel (no pygrub)

Does commenting out the stat & check in the short term allow things to work well enough for James' purposes?

Quoted 7 lines

Current hotplug scripts don't have any need to write the dev in xenstore, they only need to write the device major:minor in the physical-device xenstore backend entry. The only way to solve this (with current hotplug scripts) will be to call libxl_device_disk_add earlier on (before pygrub), fetch "physical-device" from xenstore and translate that back into the physical device it points to, and overwrite pdev_path in libxl_device_disk struct with this value.

OK, I think I follow. Presumably a similar hack would be needed to make the local_attach interface do something useful here too.

Quoted 2 lines

I would rather wait for the new interface to be finished rather than adding this "hack" to libxl.

Fair enough.

In the meantime I suppose James could work around this by logging into rdb manually (or in a script) before starting the domain and specifying /dev/rdbN in the guest config?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
Quoted 52 lines · Ian Campbell
Quoted 40 lines · Roger Pau Monne
Quoted 33 lines · Ian Campbell
Quoted 32 lines · Roger Pau Monné
Quoted 10 lines · James Dingwall

Hi,

I am doing some experimentation with xen and Ceph and have a problem booting my guest when my disk = [] uses an alternate block script. Installation from a .iso was ok since the boot device was a file but now
trying to boot from the rbd neither the hvmbuilder or pygrub can start as they treat the first value after target= as the /dev node to try and use.

Yes, this is known problem which I'm trying to solve with this series:

http://lists.xen.org/archives/html/xen-devel/2012-12/msg01753.html

Quoted 15 lines

My disk parameter looks like:
disk = [ 'format=raw, script=block-rbd, vdev=xvda, access=w, target=image=ubuntu-test' ]

In the pygrub log:
OSError: [Errno 2] No such file or directory: 'image=ubuntu-test'

and there is a similar error trying an HVM boot.

My block-rbd script parses the value passed after target= to dynamically rbd map the image and then call the write_dev function from block-common.sh to save the corresponding /dev name in xenstore. According to the logging that I have in my block-rbd script this isn't even called before pygrub is executed.

Quoted 5 lines
Quoted 2 lines

The only solution right now will be to use PV guests and boot directly with the kernel (no pygrub)

Does commenting out the stat & check in the short term allow things to work well enough for James' purposes?

Quoted 7 lines

Current hotplug scripts don't have any need to write the dev in xenstore, they only need to write the device major:minor in the physical-device xenstore backend entry. The only way to solve this (with current hotplug scripts) will be to call libxl_device_disk_add earlier on (before pygrub), fetch "physical-device" from xenstore and translate that back into the physical device it points to, and overwrite pdev_path in libxl_device_disk struct with this value.

OK, I think I follow. Presumably a similar hack would be needed to make the local_attach interface do something useful here too.

Quoted 8 lines
Quoted 2 lines

I would rather wait for the new interface to be finished rather than adding this "hack" to libxl.

Fair enough.

In the meantime I suppose James could work around this by logging into rdb manually (or in a script) before starting the domain and specifying /dev/rdbN in the guest config?

Yes, I guess that's what most high-level toolstacks (like libvirt or XAPI) do for supporting this kind of backends.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
In reply to Roger Pau Monné
Quoted 9 lines · Roger Pau Monné
Quoted 7 lines · James Dingwall

I am doing some experimentation with xen and Ceph and have a problem booting my guest when my disk = [] uses an alternate block script. Installation from a .iso was ok since the boot device was a file but now
trying to boot from the rbd neither the hvmbuilder or pygrub can start as they treat the first value after target= as the /dev node to try and use.

Quoted 3 lines

Yes, this is known problem which I'm trying to solve with this series:

http://lists.xen.org/archives/html/xen-devel/2012-12/msg01753.html

If these will apply on 4.2.1 then would you like any help testing these patches? I can also try writing a block-rbd script with a similar structure to the iscsi one that you propose in 10/10.

James

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw
Quoted 12 lines · James Dingwall
Quoted 11 lines · Roger Pau Monné
Quoted 9 lines · James Dingwall

I am doing some experimentation with xen and Ceph and have a problem booting my guest when my disk = [] uses an alternate block script. Installation from a .iso was ok since the boot device was a file but now
trying to boot from the rbd neither the hvmbuilder or pygrub can start
as they treat the first value after target= as the /dev node to try and
use.

Quoted 8 lines
Quoted 4 lines

Yes, this is known problem which I'm trying to solve with this series:

http://lists.xen.org/archives/html/xen-devel/2012-12/msg01753.html

If these will apply on 4.2.1 then would you like any help testing these patches? I can also try writing a block-rbd script with a similar structure to the iscsi one that you propose in 10/10.

Haven't tried applying them to 4.2.1 but there hasn't been changes in the device handling code since the release, so I would say that you should be able to apply them without much problem.

If you prefer I can also publish the patches as a branch in my local git repo, so you can fetch them easily (that will be based on top of -unstable)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#8 lore raw
Quoted 22 lines · Roger Pau Monné
Quoted 12 lines · James Dingwall
Quoted 11 lines · Roger Pau Monné
Quoted 9 lines · James Dingwall

I am doing some experimentation with xen and Ceph and have a problem booting my guest when my disk = [] uses an alternate block script. Installation from a .iso was ok since the boot device was a file but now
trying to boot from the rbd neither the hvmbuilder or pygrub can start
as they treat the first value after target= as the /dev node to try and
use.

Quoted 8 lines
Quoted 4 lines

Yes, this is known problem which I'm trying to solve with this series:

http://lists.xen.org/archives/html/xen-devel/2012-12/msg01753.html

If these will apply on 4.2.1 then would you like any help testing these patches? I can also try writing a block-rbd script with a similar structure to the iscsi one that you propose in 10/10.

Quoted 7 lines

Haven't tried applying them to 4.2.1 but there hasn't been changes in the device handling code since the release, so I would say that you should be able to apply them without much problem.

If you prefer I can also publish the patches as a branch in my local git repo, so you can fetch them easily (that will be based on top of -unstable)

If this isn't too much effort for you then I can work (out how to work) with a git branch.

Regards,
James

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#9 lore raw
Quoted 2 lines · James Dingwall

If this isn't too much effort for you then I can work (out how to work) with a git branch.

Hello James,

I'm in the process of rebasing + updating, will publish the new revision on a public git branch.

Thanks, Roger.