cirruslabs / orchard

Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices
Other
189 stars 13 forks source link

Multiple VMs created using --net-bridged got same IP address #181

Closed eecsmap closed 1 month ago

eecsmap commented 1 month ago

Hi,

I try to create two VMs to communicate with each other by putting them into same host network using bridge mode.

I added --net-bridged en0 to the create command. The first one get created corrected and accessible from the network. However after the second one created, it gets the same IP address when I ssh into it and check the ip using ifconfig. Now when I do orchard ssh vm vm0 I actually either got error message 2024/06/14 11:41:34 wait: remote command exited without exit status or exit signal or actually log into the vm02.

edigaryev commented 1 month ago

Can you check if these VM have the same MAC-address?

This can be done either by checking the System Settings → Network or ifconfig inside of VM, or by looking at the macAddress in ~/.tart/vms/<VM name>/config.json on the host.

eecsmap commented 1 month ago

ah! right, they have the same macAddress. Any suggestion to deal with this case?

edigaryev commented 1 month ago

Tart should normally automatically re-generate a new MAC-address for a new VM on tart clone if it sees that there's already a local VM existing with a duplicate MAC-address.

  1. How are you creating your VMs?
  2. Is there a way to reproduce the behavior you're seeing, or it happens only sometimes?
eecsmap commented 1 month ago

I have multiple workers, and two VM instances are created using same command

orchard create vm --image myrepo/macos13/xcode:14.3.1 vm_01 --restart-policy OnFailure --image-pull-policy Always --net-bridged en0

The two VMs locates on different orchard workers.

edigaryev commented 1 month ago

Oh, so the VMs are created on two different machines, interesting.

Does the collision happen every time, or with some probability?

edigaryev commented 1 month ago

Just realized that could technically happen each time when cloning from an OCI VM image independently on two or more hosts.

We could probably fix this rather easily by adding an additional tart set invocation with --random-mac command-line argument when using --net-bridged.

edigaryev commented 1 month ago

The fix should be now available as a part of the new 0.19.1 release.