Closed ipa-bak closed 3 years ago
@cppforlife Are there any plans to fix this issue in the upcoming days? It is a blocker for MacOS BigSur support. Reference: https://github.com/cloudfoundry/bosh-deployment/issues/378
Alternatively, if you give me some guidelines so that I can try making a PR.
@cppforlife Are there any plans to fix this issue in the upcoming days? It is a blocker for MacOS BigSur support. Reference: cloudfoundry/bosh-deployment#378
Alternatively, if you give me some guidelines so that I can try making a PR.
I also still have it on my ToDo stack to get this solved, but will not get to it in the next 2+ months. If you think you can do something, I would be happy to test and comment. Note: I am just a user of this; I am not in any way related to the project and have no idea if and how the actual owner(s) of this project accept PRs (two are open since 3 and 4 years).
That said, if you have any questions regarding my findings earlier in this conversation, feel free to ask here and "@"-mention me.
This issue was marked as Stale
because it has been open for 21 days without any activity. If no activity takes place in the coming 7 days it will automatically be close. To prevent this from happening remove the Stale
label or comment below.
Anybody?
So, this repo has been donated by Dmitriy to the Cloud Foundry Foundation, and now the BOSH teams are finally admin on this repository, which allows us to take part in maintaining it. Thus the "stale bbot", the comments, and new PR…
Thanks for the great detailed analysis of the issue and the valuable links. This should be fixed with #20. For the time being, I'll close this and we may re-open if relevant.
TOC
Problem description
A
bosh create-env
with virtualbox-cpi fails.Related:
Attempted action and error received
When deploying a bosh-lite with VirtualBox back-end using
bosh create-env ...
, then at some point bosh tries to attach a new disk to the running director VM. This fails with VirtualBox 6.1+:Analysis
To debug, I replaced the
VBoxManage
binary with a wrapper that logs all arguments before then calling the real thing. Logging all calls toVBoxManage
shows, bosh / the vritualbpx-cpi tried to execute the following commands:Step 21 and subsequent steps 23-25 are not supported by recent VirtualBox version and have only worked by accident in the past, see here: https://www.virtualbox.org/ticket/19251#comment:6 and following comment 7 as well as comment 4 in the thread.
Proposed solution
The virtualbox-cpi should:
pause
/resume
cycle/usr/bin/VBoxManage storageattach <uuid> --storagectl <ctrl_name> --port <port_num> --device 0 --type hdd --medium <file_name>
while the VM is running.Executing above
storageattach
against a running (not paused) Virtualbox VM running Ubuntu (in this case an ancient 16.04) results in the following kernel log messages:As can be seen, the kernel picked up the state change and attached the new disk, in this case as
sdb
. The newly attached disk is visible in the/dev
filesystem:A modern Uuntu 20.04 behaves exactly the same, except it suppresses the error message
SError: { PHYRdyChg DevExch }
about unclean device connect in the kernel log.A disk is removed by
VBoxManage storageattach <uuid> --storagectl <ctrl_name> --port <port_num> --device 0 --type hdd --medium none
Caveats
VBoxManage
interface is currently buggyVBoxManage storageattach <uuid> --storagectl sata0 --port <port_num> --device 0 --hotpluggable on
, essentially turning a "normal" SATA port into an "eSATA" port, which in the physical world supports hot-plugging.--medium
specification (and--medium none
doesn't work either).--hotpluggable on
while attaching the actual disk errors out (VBoxManage returns non-zero), complaining about wrong execution state, claiming the VM must be powered off. However, the disk attach nevertheless succeeds.--hotpluggable
configuration option and simply attach with... --type hdd --medium <file_name>
and detach with... --type hdd --medium none
. Luckily, a virtual controller can't short-circuit. :-)