The only network name accepted is vboxnet0
As a result of #31, when network type is hostonly and a name is specified, then for some reason, only the vboxnet0 is accepted and any other name will produce an error.
Here is a former piece of code that has been kept and has that behaviour:
https://github.com/cloudfoundry/bosh-virtualbox-cpi-release/pull/31/files#diff-388ad6827420e2129237f08af3655515bf7fb084609402c4500deb105649b70dR22-R24
Whereas formerly, one could guess the name of the next “hostonlyif” to be created, and that was accepted to be specified. When the guess was proved being wrong, then an error was returned by the CPI.
Name of created hostonlynet is hardcoded to vboxnet0
With VirtualBox v7+, the CPI creates hostonlynet networks (instead of hostonlyif networks with former version of VirtualBox, v6.x or v5.x)
When no name is specified, the name for the created hostonlynet is hardcoded to vboxnet0.
Here:
https://github.com/cloudfoundry/bosh-virtualbox-cpi-release/pull/31/files#diff-388ad6827420e2129237f08af3655515bf7fb084609402c4500deb105649b70dR12
Here:
https://github.com/cloudfoundry/bosh-virtualbox-cpi-release/pull/31/files#diff-388ad6827420e2129237f08af3655515bf7fb084609402c4500deb105649b70dR79-R82
And there:
https://github.com/cloudfoundry/bosh-virtualbox-cpi-release/pull/31/files#diff-388ad6827420e2129237f08af3655515bf7fb084609402c4500deb105649b70dR97-R102
This implementation is surprising because creating hostonlynet allows to specify a name (whereas creating hostonlyif net does not allow that).
We should allow networks with other names than vboxnet0 to be used.
The only network name accepted is
vboxnet0As a result of #31, when network
typeishostonlyand anameis specified, then for some reason, only thevboxnet0is accepted and any other name will produce an error.Here is a former piece of code that has been kept and has that behaviour:
https://github.com/cloudfoundry/bosh-virtualbox-cpi-release/pull/31/files#diff-388ad6827420e2129237f08af3655515bf7fb084609402c4500deb105649b70dR22-R24
Whereas formerly, one could guess the name of the next “hostonlyif” to be created, and that was accepted to be specified. When the guess was proved being wrong, then an error was returned by the CPI.
Name of created
hostonlynetis hardcoded tovboxnet0With VirtualBox v7+, the CPI creates
hostonlynetnetworks (instead ofhostonlyifnetworks with former version of VirtualBox, v6.x or v5.x)When no
nameis specified, the name for the createdhostonlynetis hardcoded tovboxnet0.Here:
https://github.com/cloudfoundry/bosh-virtualbox-cpi-release/pull/31/files#diff-388ad6827420e2129237f08af3655515bf7fb084609402c4500deb105649b70dR12
Here:
https://github.com/cloudfoundry/bosh-virtualbox-cpi-release/pull/31/files#diff-388ad6827420e2129237f08af3655515bf7fb084609402c4500deb105649b70dR79-R82
And there:
https://github.com/cloudfoundry/bosh-virtualbox-cpi-release/pull/31/files#diff-388ad6827420e2129237f08af3655515bf7fb084609402c4500deb105649b70dR97-R102
This implementation is surprising because creating
hostonlynetallows to specify a name (whereas creatinghostonlyifnet does not allow that).We should allow networks with other names than
vboxnet0to be used.