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

add vagrant architecture support #491

Merged
merged 8 commits into from
Feb 14, 2024
Merged

add vagrant architecture support #491

merged 8 commits into from
Feb 14, 2024

Conversation

Stromweld
Copy link
Contributor

@Stromweld Stromweld commented Feb 5, 2024

Description

added vagrant cpu architecture support when specifying boxes and providers
https://developer.hashicorp.com/vagrant/vagrant-cloud/boxes/architecture
https://app.vagrantup.com/bento/boxes/ubuntu-23.10

When not specified Vagrant defaults to the system CPU architecture for box downloads

Check List

Signed-off-by: Corey Hemminger <[email protected]>
Signed-off-by: Corey Hemminger <[email protected]>
Signed-off-by: Corey Hemminger <[email protected]>
@Stromweld
Copy link
Contributor Author

Not sure what is going on with that last failing spec test.

lib/kitchen/driver/vagrant.rb Outdated Show resolved Hide resolved
@tas50
Copy link
Member

tas50 commented Feb 6, 2024

Without really digging into things too much here it looks like winrm is failing, but the winrm support we have here is 9 years old and probably not necessary anymore. Vagrant natively supports that. I'm not sure we need the plugin anymore. That should probably all get refactored away and a major version bump of this cut.

Signed-off-by: Tim Smith <[email protected]>
@Stromweld Stromweld marked this pull request as draft February 6, 2024 17:15
@Stromweld
Copy link
Contributor Author

Tested this as working. Test setup M3 macbook pro kitchen file without box_arch specified:

❯ kitchen converge almalinux-9
-----> Starting Test Kitchen (v3.6.0)
-----> Creating <default-almalinux-9>...
       The box 'bento/almalinux-9' does not exist. Please double check and
       try again. You can see the boxes that are installed with
       `vagrant box list`.
       There are no installed boxes! Use `vagrant box add` to add some.
       Bringing machine 'default' up with 'parallels' provider...
       ==> default: Box 'bento/almalinux-9' could not be found. Attempting to find and install...
           default: Box Provider: parallels
           default: Box Version: >= 0
       ==> default: Loading metadata for box 'bento/almalinux-9'
           default: URL: https://vagrantcloud.com/api/v2/vagrant/bento/almalinux-9
       ==> default: Adding box 'bento/almalinux-9' (v202401.31.0) for provider: parallels (arm64)
           default: Downloading: https://vagrantcloud.com/bento/boxes/almalinux-9/versions/202401.31.0/providers/parallels/arm64/vagrant.box
==> default: Successfully added box 'bento/almalinux-9' (v202401.31.0) for 'parallels (arm64)'!
       ==> default: Registering VM image from the base box 'bento/almalinux-9'...
       ==> default: Creating new virtual machine as a linked clone of the box image...
==> default: Unregistering the box VM image...
       ==> default: Setting the default configuration for VM...
       ==> default: Checking if box 'bento/almalinux-9' version '202401.31.0' is up to date...
       ==> default: Setting the name of the VM: default-almalinux-9_default_1707243269841_47715
       ==> default: Preparing network interfaces based on configuration...
           default: Adapter 0: shared
           default: Adapter 1: bridged
       ==> default: Clearing any previously set network interfaces...
       ==> default: Booting VM...
       ==> default: Waiting for machine to boot. This may take a few minutes...
           default: SSH address: 10.211.55.38:22
           default: SSH username: vagrant
           default: SSH auth method: private key
           default: 
           default: Vagrant insecure key detected. Vagrant will automatically replace
           default: this with a newly generated keypair for better security.
           default: 
           default: Inserting generated public key within guest...
           default: Removing insecure key from the guest if it's present...
           default: Key inserted! Disconnecting and reconnecting using new SSH key...
       ==> default: Machine booted and ready!
❯ vagrant box list
bento/almalinux-9 (parallels, 202401.31.0, (arm64))

Same machine specifying box_arch: amd64:

❯ kitchen create almalinux-9
-----> Starting Test Kitchen (v3.6.0)
-----> Creating <default-almalinux-9>...
       The box 'bento/almalinux-9' does not exist. Please double check and
       try again. You can see the boxes that are installed with
       `vagrant box list`.
       There are no installed boxes! Use `vagrant box add` to add some.
       Bringing machine 'default' up with 'parallels' provider...
       ==> default: Box 'bento/almalinux-9' could not be found. Attempting to find and install...
           default: Box Provider: parallels
           default: Box Version: >= 0
       ==> default: Loading metadata for box 'bento/almalinux-9'
           default: URL: https://vagrantcloud.com/api/v2/vagrant/bento/almalinux-9
       ==> default: Adding box 'bento/almalinux-9' (v202401.31.0) for provider: parallels (amd64)
           default: Downloading: https://vagrantcloud.com/bento/boxes/almalinux-9/versions/202401.31.0/providers/parallels/amd64/vagrant.box
==> default: Successfully added box 'bento/almalinux-9' (v202401.31.0) for 'parallels (amd64)'!
       ==> default: Registering VM image from the base box 'bento/almalinux-9'...
       ==> default: Creating new virtual machine as a linked clone of the box image...
==> default: Unregistering the box VM image...
       ==> default: Setting the default configuration for VM...
       ==> default: Checking if box 'bento/almalinux-9' version '202401.31.0' is up to date...
       ==> default: Setting the name of the VM: default-almalinux-9_default_1707243947586_85790
       ==> default: Preparing network interfaces based on configuration...
           default: Adapter 0: shared
           default: Adapter 1: bridged
       ==> default: Clearing any previously set network interfaces...
       ==> default: Booting VM...
       There was an error while command execution. The command and stderr is shown below.
       
       Command: ["/usr/local/bin/prlctl", "start", "6b21a851-096c-4f0b-81ab-be9794255a45"]
       
       Stderr: Failed to start the VM: Unable to start "default-almalinux-9_default_1707243947586_85790" because your Mac is equipped with the Apple M series chip that does not support Intel-based operating systems. To create a compatible virtual machine, use an ISO or VHDX image file with an ARM-based operating system.
❯ vagrant box list
bento/almalinux-9 (parallels, 202401.31.0, (amd64))

@Stromweld Stromweld marked this pull request as ready for review February 6, 2024 18:37
@Stromweld Stromweld requested a review from tas50 February 13, 2024 23:32
@tas50 tas50 merged commit cdd8999 into test-kitchen:main Feb 14, 2024
5 checks passed
@Stromweld Stromweld deleted the vagrant-arch branch February 14, 2024 14:40
@Stromweld
Copy link
Contributor Author

@tas50 would you be able to cut a new major release of this driver?

@tas50
Copy link
Member

tas50 commented Feb 14, 2024

I was planning to do a new one when I get into my office this morning

@Stromweld
Copy link
Contributor Author

cool thanks

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

Successfully merging this pull request may close these issues.

2 participants