This message was deleted.
# harvester
a
This message was deleted.
b
What kind of image are you using for your VMs? If it is a cloud image, Harvester supports passing in a network-config file: https://cloudinit.readthedocs.io/en/latest/reference/network-config-format-v2.html and when you create your VMs you can pass this is. For example, here's one of mine (it is specific to Ubuntu, since enp1s0 is how the Ubuntu image names its interfaces):
Copy code
network:
  version: 2
  ethernets:
    enp1s0:
      addresses:
      - 172.16.40.21/24
      gateway4: 172.16.40.1
      nameservers:
        addresses:
        - 1.1.1.1
        - 8.8.8.8
Hmm, I typed up my response before I saw your edit. Your new question is too hard to answer without knowing the rest of your networking setup 😅
i
Ok, Well for now i just want to get access working so I can use any image: I just tried with Image rocky-9.3-x86_64-minimal.iso and have tried: ubuntu-20.04.6-live-server-amd64.iso and ubuntu-20.04-server-cloudimg-amd64.img
b
If you're using the management network in masquerade mode, they won't have IP addresses that you can reach outside of the Harvester node. You'll need to configure a VM network attached to one of your Harvester NICs, and you'll need enough public IP addresses to assign to them.
i
Ok so to confirm: 1. connect another ethernet cable to a second server NIC port 2. Create VM Network associated to that Nic port 3. Assign External IPs to that Network 4. CReate New VM on that Network 5. Manually assigne external IP onto enp1s0 (the first nic in the vm) 6. Repeat #4, #5 for other new VMs
Now is ther another Harvester way... As I don't have physical access to the server until next week (to wire up another ethernet cable )
b
You don't need another NIC, you can create multiple VM networks on a single NIC, including the NIC that's currently installed as the management interface
i
Ok thx. I was able to get it working: 1. Harvester node Has Public IP xx.xx.xx.70 2. Harvester management IP is public IP xx.xx.xx.75 3. Created VM Network untagged named "external" 4. Created New VM using ubuntu Cloud Image a. network: b. version: 2 c. ethernets: d. enp1s0: e. dhcp4: true f. enp2s0: g. addresses: h. - xx.xx.xx.74/29 i. gateway4: xx.xx.xx.65 j. nameservers: k. addresses: l. - xx.xx.xx.96 m. - xx.xx.xx.97 5. also Added default route xx.xx.xx.65
🎉 1
🙌 1
direct access to internet is now available for that VM
here's the updated cloudinit to create external accessible vm with static ip Great :) Updates: network: version: 2 ethernets: enp1s0: dhcp4: true enp2s0: addresses: - xx.xx.xx.72/29 nameservers: addresses: - xx.xx.xx.96 - xx.xx.xx.97 routes: - to: xx.xx.xx.64/29 via: 0.0.0.0 scope: link - to: 0.0.0.0/0 via: xx.xx.xx.65 on-link: true