diff --git a/kola/tests/etcd/discovery.go b/kola/tests/etcd/discovery.go index 5cd7752bb..f0a316ad0 100644 --- a/kola/tests/etcd/discovery.go +++ b/kola/tests/etcd/discovery.go @@ -38,7 +38,7 @@ func init() { initial_advertise_peer_urls: http://{PRIVATE_IPV4}:2380 discovery: $discovery`), Distros: []string{"cl"}, - ExcludePlatforms: []string{"qemu", "qemu-unpriv"}, + ExcludePlatforms: []string{"qemu-unpriv"}, }) register.Register(®ister.Test{ @@ -54,7 +54,7 @@ etcd: initial_advertise_peer_urls: http://{PRIVATE_IPV4}:2380 discovery: $discovery `), - ExcludePlatforms: []string{"esx", "qemu", "qemu-unpriv"}, // etcd-member requires ct rendering + ExcludePlatforms: []string{"esx", "qemu-unpriv"}, // etcd-member requires ct rendering and networking Distros: []string{"cl"}, }) @@ -73,7 +73,7 @@ etcd: initial_advertise_peer_urls: http://127.0.0.1:2380 `), Distros: []string{"cl"}, - ExcludePlatforms: []string{"qemu", "qemu-unpriv"}, + ExcludePlatforms: []string{"qemu-unpriv"}, }) } diff --git a/kola/tests/flannel/flannel.go b/kola/tests/flannel/flannel.go index fa09eed60..c69ad4d08 100644 --- a/kola/tests/flannel/flannel.go +++ b/kola/tests/flannel/flannel.go @@ -63,7 +63,7 @@ func init() { ClusterSize: 3, Name: "cl.flannel.udp", Distros: []string{"cl"}, - ExcludePlatforms: []string{"qemu", "qemu-unpriv"}, + ExcludePlatforms: []string{"qemu-unpriv"}, UserData: flannelConf.Subst("$type", "udp"), }) @@ -72,7 +72,7 @@ func init() { ClusterSize: 3, Name: "cl.flannel.vxlan", Distros: []string{"cl"}, - ExcludePlatforms: []string{"qemu", "qemu-unpriv"}, + ExcludePlatforms: []string{"qemu-unpriv"}, UserData: flannelConf.Subst("$type", "vxlan"), }) } diff --git a/kola/tests/ignition/security.go b/kola/tests/ignition/security.go index 37eb882de..918a9f763 100644 --- a/kola/tests/ignition/security.go +++ b/kola/tests/ignition/security.go @@ -80,7 +80,7 @@ func init() { // ESX: Currently Ignition does not support static IPs during the initramfs // DO: https://github.com/coreos/bugs/issues/2205 // Packet & QEMU: https://github.com/coreos/ignition/issues/645 - ExcludePlatforms: []string{"esx", "do", "packet", "qemu"}, + ExcludePlatforms: []string{"esx", "do", "packet"}, Distros: []string{"cl", "fcos", "rhcos"}, }) } diff --git a/kola/tests/locksmith/locksmith.go b/kola/tests/locksmith/locksmith.go index 9824d949d..37da4d157 100644 --- a/kola/tests/locksmith/locksmith.go +++ b/kola/tests/locksmith/locksmith.go @@ -46,7 +46,7 @@ etcd: listen_peer_urls: http://{PRIVATE_IPV4}:2380 discovery: $discovery`), Distros: []string{"cl"}, - ExcludePlatforms: []string{"qemu", "qemu-unpriv"}, + ExcludePlatforms: []string{"qemu-unpriv"}, }) register.Register(®ister.Test{ Name: "coreos.locksmith.reboot", diff --git a/platform/local/dnsmasq.go b/platform/local/dnsmasq.go index e0d7a0362..64e906311 100644 --- a/platform/local/dnsmasq.go +++ b/platform/local/dnsmasq.go @@ -89,6 +89,11 @@ leasefile-ro log-facility=- pid-file= +# hardcode DNS servers to avoid using systemd-resolved on the unreachable 127.0.0.53 +dhcp-option=6,1.1.1.1,1.0.0.1,8.8.8.8 +no-resolv +no-hosts + enable-ra # point NTP at this host (0.0.0.0 and :: are special) diff --git a/platform/local/flight.go b/platform/local/flight.go index 0565f0e1e..2a9013257 100644 --- a/platform/local/flight.go +++ b/platform/local/flight.go @@ -50,7 +50,7 @@ func NewLocalFlight(opts *platform.Options, platformName platform.Name) (*LocalF } nsdialer := network.NewNsDialer(nshandle) - bf, err := platform.NewBaseFlightWithDialer(opts, platformName, "", nsdialer) + bf, err := platform.NewBaseFlightWithDialer(opts, platformName, "custom", nsdialer) if err != nil { nshandle.Close() return nil, fmt.Errorf("creating new base flight failed: %v", err) diff --git a/platform/machine/esx/cluster.go b/platform/machine/esx/cluster.go index 2e5bf8c8c..fcb535184 100644 --- a/platform/machine/esx/cluster.go +++ b/platform/machine/esx/cluster.go @@ -90,9 +90,11 @@ Wants=network-online.target [Service] Type=oneshot -Environment=OUTPUT=/run/metadata/coreos +Environment=OUTPUT=/run/metadata/flatcar ExecStart=/usr/bin/mkdir --parent /run/metadata -ExecStart=/usr/bin/bash -c 'echo "COREOS_CUSTOM_PRIVATE_IPV4=$(ip addr show ens192 | grep "inet 10." | grep -Po "inet \K[\d.]+")\nCOREOS_CUSTOM_PUBLIC_IPV4=$(ip addr show ens192 | grep -v "inet 10." | grep -Po "inet \K[\d.]+")" > ${OUTPUT}'`, false) +ExecStart=/usr/bin/bash -c 'echo "COREOS_CUSTOM_PRIVATE_IPV4=$(ip addr show ens192 | grep "inet 10." | grep -Po "inet \K[\d.]+")\nCOREOS_CUSTOM_PUBLIC_IPV4=$(ip addr show ens192 | grep -v "inet 10." | grep -Po "inet \K[\d.]+")" > ${OUTPUT}' +ExecStartPost=/usr/bin/ln -fs /run/metadata/flatcar /run/metadata/coreos +`, false) instance, err := ec.flight.api.CreateDevice(ec.vmname(), conf, ipPairMaybe) if err != nil { diff --git a/platform/machine/qemu/cluster.go b/platform/machine/qemu/cluster.go index aa7f60111..4859fac35 100644 --- a/platform/machine/qemu/cluster.go +++ b/platform/machine/qemu/cluster.go @@ -59,8 +59,8 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo ip := strings.Split(netif.DHCPv4[0].String(), "/")[0] conf, err := qc.RenderUserData(userdata, map[string]string{ - "$public_ipv4": ip, - "$private_ipv4": ip, + "$public_ipv4": "${COREOS_CUSTOM_PUBLIC_IPV4}", + "$private_ipv4": "${COREOS_CUSTOM_PRIVATE_IPV4}", }) if err != nil { qc.mu.Unlock() @@ -68,6 +68,20 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo } qc.mu.Unlock() + conf.AddSystemdUnit("coreos-metadata.service", `[Unit] +Description=QEMU metadata agent +After=nss-lookup.target +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot +Environment=OUTPUT=/run/metadata/flatcar +ExecStart=/usr/bin/mkdir --parent /run/metadata +ExecStart=/usr/bin/bash -c 'echo "COREOS_CUSTOM_PRIVATE_IPV4=`+ip+`\nCOREOS_CUSTOM_PUBLIC_IPV4=`+ip+`\n" > ${OUTPUT}' +ExecStartPost=/usr/bin/ln -fs /run/metadata/flatcar /run/metadata/coreos +`, false) + var confPath string if conf.IsIgnition() { confPath = filepath.Join(dir, "ignition.json")