https://rancher.com/ logo
#harvester
Title
# harvester
a

adamant-kite-43734

04/25/2023, 11:47 AM
This message was deleted.
r

refined-analyst-8898

04/25/2023, 11:49 AM
Without DHCP you will need network data in cloud config (advanced settings) during node configuration before pool is created.
s

strong-orange-21773

04/25/2023, 11:50 AM
Any link for reference.
r

refined-analyst-8898

04/25/2023, 11:53 AM
s

strong-orange-21773

04/25/2023, 12:09 PM
when I am creating network config, should I use the real interface name like i used when creating network. or which one?
w

witty-jelly-95845

04/25/2023, 12:09 PM
For a practical example see https://community.suse.com/posts/how-to-manage-harvester-030-with-rancher-261-running-in-a-vm-within-harvester (ignore the out of date Harvester & Rancher versions)
s

strong-orange-21773

04/25/2023, 12:12 PM
waiting for community approval
b

bored-farmer-36655

04/25/2023, 12:14 PM
@strong-orange-21773 try this invite (will be quicker) https://community.suse.com/share/TFoce0bPKNzFTb_B?utm_source=manual
🙌 1
r

refined-analyst-8898

04/25/2023, 12:17 PM
Done
s

strong-orange-21773

04/25/2023, 12:22 PM
I see that it is not adding the IP from the network I have created
I added this, but still not working.
do I need delete and recreate the machine or restart with changed network config will do
r

refined-analyst-8898

04/25/2023, 12:38 PM
I understand some cloud-config is only applied during first boot so it's probably necessary to recreate the VM.
It is also possible to restart the cloud-config life cycle with a CLI option like
--clean
, if I remember correctly.
s

strong-orange-21773

04/25/2023, 12:41 PM
thanks
is it possible to have the cloud init network config of the network I created in harvester (vm networks)
Copy code
#cloud-config
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: false
      addresses:
        - 10.1.0.0/16
      gateway4: 10.1.0.1
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4
  vlans:
    vlan1002:
      id: 1002
      link: eth0
do the above format is correct?
I think, it is no cloud ISO file 😞
Copy code
{"component":"virt-launcher","level":"info","msg":"Driver cache mode for /var/run/kubevirt-ephemeral-disks/cloud-init-data/default/ubuntu/noCloud.iso set to none","pos":"converter.go:447","timestamp":"2023-04-25T12:41:15.645943Z"}
{"component":"virt-launcher","level":"info","msg":"generated nocloud iso file /var/run/kubevirt-ephemeral-disks/cloud-init-data/default/ubuntu/noCloud.iso","pos":"cloud-init.go:655","timestamp":"2023-04-25T12:41:16.370144Z"}
=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 \\-device pcie-root-port,port=22,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 \\-device pcie-root-port,port=23,chassis=8,id=pci.8,bus=pcie.0,addr=0x2.0x7 \\-device qemu-xhci,id=usb,bus=pci.2,addr=0x0 \\-device virtio-scsi-pci-non-transitional,id=scsi0,bus=pci.3,addr=0x0 \\-device virtio-serial-pci-non-transitional,id=virtio-serial0,bus=pci.4,addr=0x0 \\-blockdev '{\"driver\":\"host_device\",\"filename\":\"/dev/disk-0\",\"aio\":\"native\",\"node-name\":\"libvirt-2-storage\",\"cache\":{\"direct\":true,\"no-flush\":false},\"auto-read-only\":true,\"discard\":\"unmap\"}' \\-blockdev '{\"node-name\":\"libvirt-2-format\",\"read-only\":false,\"discard\":\"unmap\",\"cache\":{\"direct\":true,\"no-flush\":false},\"driver\":\"raw\",\"file\":\"libvirt-2-storage\"}' \\-device virtio-blk-pci-non-transitional,bus=pci.5,addr=0x0,drive=libvirt-2-format,id=ua-disk-0,bootindex=1,write-cache=on,werror=stop,rerror=stop \\-blockdev '{\"driver\":\"file\",\"filename\":\"/var/run/kubevirt-ephemeral-disks/cloud-init-data/default/ubuntu/noCloud.iso\",\"node-name\":\"libvirt-1-storage\",\"cache\":{\"direct\":true,\"no-flush\":false},\"auto-read-only\":true,\"discard\":\"unmap\"}' \\-blockdev '{\"node-name\":\"libvirt-1-format\",\"read-only\":false,\"discard\":\"unmap\",\"cache\":{\"direct\":true,\"no-flush\":false},\"driver\":\"raw\",\"file\":\"libvirt-1-storage\"}' \\-device virtio-blk-pci-non-transitional,bus=pci.6,addr=0x0,drive=libvirt-1-format,id=ua-cloudinitdisk,write-cache=on,werror=stop,rerror=stop \\-netdev tap,fd=29,id=hostua-default,vhost=on,vhostfd=31 \\-device virtio-net-pci-non-transitional,host_mtu=1500,netdev=hostua-default,id=ua-default,mac=46:92:1c:82:7d:20,bus=pci.1,addr=0x0,romfile= \\-chardev socket,id=charserial0,fd=25,server=on,wait=off \\-device isa-serial,chardev=charserial0,id=serial0 \\-chardev socket,id=charchannel0,fd=27,server=on,wait=off \\-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \\-device usb-tablet,id=ua-tab
r

refined-analyst-8898

04/25/2023, 12:52 PM
That could explain not getting an IP for sure. I'm using openSUSE LEAP cloud image with Harvester OK. You need to specify the IP address for the host. Your network-data example currently shows
10.1.0.0/16
which is the network address, not the host address. You need something like
10.1.0.100/16
for
eth0
.
s

strong-orange-21773

04/25/2023, 1:04 PM
sorry to ask too many question. In the network config, is it possible to use the VLAN info I created ?
also what is the purpose of creating VLAN and mentioning the same during VM creation if we have to mention details in cloud-init config again?
is it for mentioning the static IP. If so when I am creating a cluster do I need to mention IP address for all the nodes creating my pool?
any way we can make the VM to pick the IP from subnets on its own?
r

refined-analyst-8898

04/25/2023, 1:11 PM
I don't believe it's necessary to configure VLAN in network-data because a "VM Network" in Harvester that is tagged to a VLAN will handle the VLAN tagging for all guest VMs on that network. In other words, the guest VM doesn't need to be "aware" of the VLAN for the interface that is attached to a tagged Harvester VM network.
You may enable DHCP if you provide a DHCP server on the same subnet as the Harvester VM network or you may configure a static IP with network-data interface addresses.
s

strong-orange-21773

04/25/2023, 1:13 PM
what should be the interface name?
r

refined-analyst-8898

04/25/2023, 1:15 PM
The correct adapter name will depend on the OS image. It could be like
ethN
or
enpNsN
, or something else. Perhaps the simplest way to discover it is to log in the console and say
ip link sh
.
s

strong-orange-21773

04/25/2023, 1:15 PM
in few OS I see my interface name as eth0 and eth1 and when creating vm network , i see my interface name as enp5s0 and enp6s0
right
so I wanted to attach 10.1.0.2
It is not adding I see net1 and eth0
it is adding the VM network which I mentioned during VM creation and which I created in VM network. but it is not adding any IP as it is not DHCP server. I am passing the IP via cloud init but it is not considering it, I am making a mistake
r

refined-analyst-8898

04/25/2023, 1:43 PM
Now the
addresses
part is missing in network-data, and the adapter name needs to be
eth0
if that is the name used by your cloud image.
This reference is for config spec v2. I'm uncertain whether you can choose either v1 or v2, but certainly the stated version in your network-data will need to match one or the other.
52 Views