Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small breaking change in vbox 7 #30

Closed
damzog opened this issue Jun 19, 2023 · 13 comments · Fixed by #31
Closed

Small breaking change in vbox 7 #30

damzog opened this issue Jun 19, 2023 · 13 comments · Fixed by #31
Assignees

Comments

@damzog
Copy link

damzog commented Jun 19, 2023

Hi,

while trying to setup bosh lite with virtualbox 7 I found that the NatNetwork is not discovered. I think it is because the command VBoxManage list networks has sligthly changed the output format: The network name used to printed as e.g. "NetworkName: NatNetwork". In virtualbox 7 it is "Name: NatNetwork". Therefore it seems that the following code does not find the adapter for the NatNetwork anymore:

func (n *hostNetwork) Find() (bnet.Network, error) {

See also
vbox-6
vbox-7

@ramonskie
Copy link
Contributor

if you think you found the issue and fixed the code you could create a dev release
bosh create-release --force --tarball=virtualbox-cpi.tgz
and then use an ops file with the follwoing to overwrite the virutalbox cpi

- name: cpi
  path: /releases/name=bosh-vritualbox-cpi
  type: replace
  value:
    name: bosh-aws-cpi
    url: file:///home/USERNAME/workspace/bosh/bosh-aws-cpi-release/vrtualbox-cpi.tgz
    version: latest

@damzog
Copy link
Author

damzog commented Jun 19, 2023

@ramonskie thanks for the hint. I worked around the issue by downgrading to vbox 6 which seems to work. However I am facing other issues but this is a different story. I just wanted to note this issue for the records. So if someone happens to do some maintenance work on the cpi he might take a look at it. Finally I managed to upload the images from my private network (from company network it did not work probably because of https://github.com/orgs/community/discussions/28947 ). You can see that also other attribute names were changed. So it might be a little bit of work to make it run.

@rkoster rkoster moved this from Inbox to Waiting for Changes | Open for Contribution in Foundational Infrastructure Working Group Jun 29, 2023
@chombium
Copy link
Contributor

chombium commented Jun 30, 2023

We have started working togather with @ZPascal on this issue and we have a working PoC with VBox 7. The output from the VBox CLI call for listing NAT Networks was changed and now instead of the used one, a new VBoxManage natnetwork list should be used and the parsing of the output should be adjusted.

We are planning to do the changes for VBox 7 and VBox 6.1 as the other, older VBox versions are out of maintenance. What do you think about this?

@rkoster, @beyhan, @ramonskie can someone of you please assign this issue to me. I cannot do it myself.

@chombium
Copy link
Contributor

chombium commented Jul 2, 2023

Thank you very much @ramonskie

@beyhan
Copy link
Member

beyhan commented Jul 3, 2023

Sounds great! We would love to review a pr.

chombium added a commit to chombium/bosh-virtualbox-cpi-release that referenced this issue Jul 4, 2023
The output of the `VBoxManage list natnetworks` CLI command was changed in
VirtualBox v7.x. This change adjusts the parameter names and uses the
`--long` format of the command's output so that the `Enabled` parameter is
present.

The change is compatible with the older VirtualBox version and does not
break the CPI.

Fixes cloudfoundry#30
Co-authored-by: Pascal Zimmermann <pascal.zimmermann@theiotstudio.com>
chombium added a commit to chombium/bosh-virtualbox-cpi-release that referenced this issue Jul 4, 2023
The output of the `VBoxManage list natnetworks` CLI command was changed in
VirtualBox v7.x. This change adjusts the parameter names and uses the
`--long` format of the command's output so that the `Enabled` parameter is
present.

The change is compatible with the older VirtualBox version and does not
break the CPI.

Fixes cloudfoundry#30
Co-authored-by: Pascal Zimmermann <pascal.zimmermann@theiotstudio.com>
chombium added a commit to chombium/bosh-virtualbox-cpi-release that referenced this issue Jul 4, 2023
The output of the `VBoxManage list natnetworks` CLI command was changed in
VirtualBox v7.x. This change adjusts the parameter names and uses the
`--long` format of the command's output so that the `Enabled` parameter is
present.

The change is compatible with the older VirtualBox version and does not
break the CPI.

Fixes cloudfoundry#30

Co-authored-by: Pascal Zimmermann <pascal.zimmermann@theiotstudio.com>
@chombium
Copy link
Contributor

chombium commented Jul 4, 2023

Hi, I've opened a draft PR so that you can see our progress.
We've fixed the NAT Network parsing without breaking the backward compatibility (VBox newer than v6.1).

Up until now we've tested everything on Linux and we're doing tests on MacOS as well. @ZPascal is still testing some things on MacOS where we might need to do some extra changes.
We don't have Windows at hand and we don't know if we should test this on Windows. If so, it would be nice if someone can validate if everything is working properly.

Testing:

Clone needed repos:

bosh create-release --force --tarball=virtualbox-cpi.tgz
  • cpi.yml (adjust the path to the release archive)
- name: cpi
  path: /releases/name=bosh-virtualbox-cpi
  type: replace
  value:
    name: bosh-virtualbox-cpi
    url: file:///path/to/virtualbox-cpi.tgz
    version: latest
  • create BOSH-lite environment:
export BOSH_DEV=/path/to/bosh-deployment
bosh create-env $BOSH_DEV/bosh.yml \
  --state ./state.json \
  -o $BOSH_DEV/virtualbox/cpi.yml \
  -o ./cpi.yml \
  -o $BOSH_DEV/virtualbox/outbound-network.yml \
  -o $BOSH_DEV/bosh-lite.yml \
  -o $BOSH_DEV/bosh-lite-runc.yml \
  -o $BOSH_DEV/uaa.yml \
  -o $BOSH_DEV/credhub.yml \
  -o $BOSH_DEV/jumpbox-user.yml \
  --vars-store ./creds.yml \
  -v director_name=bosh-lite \
  -v internal_ip=192.168.56.6 \
  -v internal_gw=192.168.56.1 \
  -v internal_cidr=192.168.56.0/24 \
  -v outbound_network_name=NatNetwork

@chombium
Copy link
Contributor

chombium commented Jul 5, 2023

The problem on MacOS is a bit bigger. They've changed the commands to list host only interfaces.
The VBoxManage list hostonlyifs command that worked before doesn't work anymore on MacOS, but still works on Linux. One should use VBoxManage list hostonlynets command on MacOS, which is unknown on Linux VBoxManage: error: Unknown subcommand "hostonlynets".

We'll have to add some checks about the OS that the CPI is working on and the VBox version and execute the right command, which will take us some more time. :-/

@ZPascal is working on it.

@ZPascal
Copy link
Contributor

ZPascal commented Aug 8, 2023

I modified the corresponding code base to fix the MAC OS X-related issues, and I've already tested it on my end using the Jammy-based Zookeeper version and running the corresponding Smoke tests. The Bosh Lite setup now works as expected. You can download the tar archive of the new release here and use it for your tests. Please report any related issues. Thank you.

@ZPascal
Copy link
Contributor

ZPascal commented Aug 20, 2023

Hi everyone,

I am having some issues related to the VirtualBox 6.1 test case on Mac OS X. I can't fully test it because my Mac OS X is too new and it is not possible to install the necessary kernel modules on my system.
I have checked the available commands and adjusted the function in general, but for me, it is not possible to test version 6.1 together with a current Mac OS X system. If someone got an old Mac system, that would be nice if the person could validate the functionality.

Oracle's official support also ends at the end of the year, so I wonder if it is really necessary to support VBox 6.1 on Mac OS X?

@ZPascal
Copy link
Contributor

ZPascal commented Aug 24, 2023

I've organised an Windows 11 device and we've performed the setup on the corresponding device. For my understanding it's since 2018 not possible to use Bosh Lite under Windows, because we've faced the following issue.

bosh create-env "%BOSH_DEV%/bosh.yml"  --state ./state.json  -o "%BOSH_DEV%/virtualbox/cpi.yml"  -o ./cpi.yml  -o "%BOSH_DEV%/virtualbox/outbound-network.yml"  -o "%BOSH_DEV%/bosh-lite.yml"  -o "%BOSH_DEV%/bosh-lite-runc.yml"  -o "%BOSH_DEV%/uaa.yml"  -o "%BOSH_DEV%/credhub.yml"  -o "%BOSH_DEV%/jumpbox-user.yml"  --vars-store ./creds.yml  -v director_name=bosh-lite  -v internal_ip=192.168.56.6  -v internal_gw=192.168.56.1  -v internal_cidr=192.168.56.0/24  -v outbound_network_name=NatNetwork
Deployment manifest: 'C:\dev\git\bosh-deployment\bosh.yml'
Deployment state: './state.json'
Started validating
  Downloading release 'bosh'... Skipped [Found in local cache] (00:00:00)
  Validating release 'bosh'... Finished (00:00:01)
  Downloading release 'bpm'... Skipped [Found in local cache] (00:00:00)
  Validating release 'bpm'... Finished (00:00:00)
  Validating release 'bosh-virtualbox-cpi'... Finished (00:00:02)
  Downloading release 'garden-runc'... Finished (00:01:04)
  Validating release 'garden-runc'... Finished (00:00:01)
  Downloading release 'bosh-warden-cpi'... Finished (00:00:29)
  Validating release 'bosh-warden-cpi'... Finished (00:00:00)
  Downloading release 'os-conf'... Finished (00:00:00)
  Validating release 'os-conf'... Finished (00:00:01)
  Downloading release 'uaa'... Finished (00:00:57)
  Validating release 'uaa'... Finished (00:00:00)
  Downloading release 'credhub'... Finished (00:00:30)
  Validating release 'credhub'... Finished (00:00:00)
  Validating cpi release... Finished (00:00:00)
  Validating deployment manifest... Finished (00:00:00)
  Downloading stemcell... Finished (00:00:48)
  Validating stemcell... Finished (00:00:01)
Finished validating (00:04:00)
Started installing CPI
  Compiling package 'golang-1-linux/79f531850e62e3801f1dfa4acd11c421aebe653cd4316f6e49061818071bb617'...[CLI] 2023/08/21 17:14:06 ERROR - Panic: UseIsolatedEnv is not supported on Windows

From my understanding, we can't fix that, because since years, it's not possible to execute the create-env command on Windows.

@wayneeseguin
Copy link

Does that include running from WSL?

@ZPascal
Copy link
Contributor

ZPascal commented Aug 25, 2023

Does that include running from WSL?

No, we've tested the native Windows functionality.

@chombium
Copy link
Contributor

Hi @wayneeseguin when a program runs on Windows under WSL runtime.GOOS = linux, hence, the BOSH VirtualBox CPI should behave the same as on native Linux. TBH, I don't have a Windows machine to test, but I suppose it will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

6 participants