From 068bd3a3c846df113bd9f00f6705665c246415eb Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 16 Apr 2026 17:41:34 +0100 Subject: [PATCH 1/4] docs: Flatcar provides vmtoolsd in /usr/bin with a sysext now Signed-off-by: James Le Cuirot --- Documentation/cloud-config-locations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/cloud-config-locations.md b/Documentation/cloud-config-locations.md index df3e2f2..606838f 100644 --- a/Documentation/cloud-config-locations.md +++ b/Documentation/cloud-config-locations.md @@ -21,8 +21,8 @@ On every boot, coreos-cloudinit looks for a config file to configure your host. | `/var/lib/coreos-vagrant/vagrantfile-user-data`| Vagrant OEM scripts automatically store Cloud-Config into this path. | | `/var/lib/waagent/CustomData`| Azure platform uses OEM path for first Cloud-Config initialization and then `/var/lib/waagent/CustomData` to apply your settings. | | `http://169.254.169.254/metadata/v1/user-data` `http://169.254.169.254/2009-04-04/user-data` `https://metadata.packet.net/userdata`|DigitalOcean, EC2 and Packet cloud providers correspondingly use these URLs to download Cloud-Config.| -| `/usr/share/oem/bin/vmtoolsd --cmd "info-get guestinfo.coreos.config.data"` | Cloud-Config provided by [VMware Guestinfo][VMware Guestinfo] | -| `/usr/share/oem/bin/vmtoolsd --cmd "info-get guestinfo.coreos.config.url"` | Cloud-Config URL provided by [VMware Guestinfo][VMware Guestinfo] | +| `vmtoolsd --cmd "info-get guestinfo.coreos.config.data"` | Cloud-Config provided by [VMware Guestinfo][VMware Guestinfo] | +| `vmtoolsd --cmd "info-get guestinfo.coreos.config.url"` | Cloud-Config URL provided by [VMware Guestinfo][VMware Guestinfo] | [VMware Guestinfo]: vmware-guestinfo.md From fb088ff8d30c316435c901351f3b03604cfc8a9b Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 16 Apr 2026 17:42:24 +0100 Subject: [PATCH 2/4] units: Read config from /usr/share/coreos rather than /usr/share/oem /usr/share/oem is a symlink to the OEM partition at /oem these days. However, all OEMs are now being converted to sysexts, which cannot cover /oem. /usr/share/coreos itself is a symlink to /usr/share/flatcar these days, but I'm keeping the coreos name here in line with this being coreos-cloudinit. Signed-off-by: James Le Cuirot --- Documentation/cloud-config-locations.md | 2 +- units/system-config.target | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/cloud-config-locations.md b/Documentation/cloud-config-locations.md index 606838f..7477036 100644 --- a/Documentation/cloud-config-locations.md +++ b/Documentation/cloud-config-locations.md @@ -17,7 +17,7 @@ On every boot, coreos-cloudinit looks for a config file to configure your host. | `/media/configdrive/openstack/latest/user_data` | FAT or ISO9660 filesystem with [config-2](config-drive.md#qemu-virtfs) label and `/media/configdrive/` mount point. It should also contain a `openstack/latest/user_data` relative path. Usually used in installations which are configured by USB Flash sticks or CDROM media. | | Kernel command line: `cloud-config-url=http://example.com/user_data`. | You can find this string using this command `cat /proc/cmdline`. Usually used in [PXE](https://www.flatcar.org/docs/latest/installing/bare-metal/booting-with-pxe/) or [iPXE](https://www.flatcar.org/docs/latest/installing/bare-metal/booting-with-ipxe/) boots. | | `/var/lib/coreos-install/user_data` | When you install Flatcar Container Linux manually using the [flatcar-install](https://www.flatcar.org/docs/latest/installing/bare-metal/installing-to-disk/) tool. Usually used in bare metal installations. | -| `/usr/share/oem/cloud-config.yml` | Path for OEM images. | +| `/usr/share/coreos/cloud-config.yml` | Path for OEM images. | | `/var/lib/coreos-vagrant/vagrantfile-user-data`| Vagrant OEM scripts automatically store Cloud-Config into this path. | | `/var/lib/waagent/CustomData`| Azure platform uses OEM path for first Cloud-Config initialization and then `/var/lib/waagent/CustomData` to apply your settings. | | `http://169.254.169.254/metadata/v1/user-data` `http://169.254.169.254/2009-04-04/user-data` `https://metadata.packet.net/userdata`|DigitalOcean, EC2 and Packet cloud providers correspondingly use these URLs to download Cloud-Config.| diff --git a/units/system-config.target b/units/system-config.target index 99abbf7..fd7700b 100644 --- a/units/system-config.target +++ b/units/system-config.target @@ -6,5 +6,5 @@ Requires=flatcar-setup-environment.service After=flatcar-setup-environment.service # Load OEM cloud-config.yml -Requires=system-cloudinit@usr-share-oem-cloud\x2dconfig.yml.service -After=system-cloudinit@usr-share-oem-cloud\x2dconfig.yml.service +Requires=system-cloudinit@usr-share-coreos-cloud\x2dconfig.yml.service +After=system-cloudinit@usr-share-coreos-cloud\x2dconfig.yml.service From 8b681c27dffd7aff811469e41c16f6e659df353e Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 30 Apr 2026 16:26:30 +0100 Subject: [PATCH 3/4] Drop support for Equinix Metal (Packet) Signed-off-by: James Le Cuirot --- Documentation/cloud-config-locations.md | 2 +- coreos-cloudinit.go | 16 +--- datasource/metadata/packet/metadata.go | 106 ---------------------- network/packet.go | 115 ------------------------ 4 files changed, 3 insertions(+), 236 deletions(-) delete mode 100644 datasource/metadata/packet/metadata.go delete mode 100644 network/packet.go diff --git a/Documentation/cloud-config-locations.md b/Documentation/cloud-config-locations.md index 7477036..6c43aad 100644 --- a/Documentation/cloud-config-locations.md +++ b/Documentation/cloud-config-locations.md @@ -20,7 +20,7 @@ On every boot, coreos-cloudinit looks for a config file to configure your host. | `/usr/share/coreos/cloud-config.yml` | Path for OEM images. | | `/var/lib/coreos-vagrant/vagrantfile-user-data`| Vagrant OEM scripts automatically store Cloud-Config into this path. | | `/var/lib/waagent/CustomData`| Azure platform uses OEM path for first Cloud-Config initialization and then `/var/lib/waagent/CustomData` to apply your settings. | -| `http://169.254.169.254/metadata/v1/user-data` `http://169.254.169.254/2009-04-04/user-data` `https://metadata.packet.net/userdata`|DigitalOcean, EC2 and Packet cloud providers correspondingly use these URLs to download Cloud-Config.| +| `http://169.254.169.254/metadata/v1/user-data` `http://169.254.169.254/2009-04-04/user-data`|DigitalOcean and EC2 cloud providers correspondingly use these URLs to download Cloud-Config.| | `vmtoolsd --cmd "info-get guestinfo.coreos.config.data"` | Cloud-Config provided by [VMware Guestinfo][VMware Guestinfo] | | `vmtoolsd --cmd "info-get guestinfo.coreos.config.url"` | Cloud-Config URL provided by [VMware Guestinfo][VMware Guestinfo] | diff --git a/coreos-cloudinit.go b/coreos-cloudinit.go index 9b30afd..fffe5bb 100644 --- a/coreos-cloudinit.go +++ b/coreos-cloudinit.go @@ -36,7 +36,6 @@ import ( "github.com/flatcar/coreos-cloudinit/datasource/metadata/digitalocean" "github.com/flatcar/coreos-cloudinit/datasource/metadata/ec2" "github.com/flatcar/coreos-cloudinit/datasource/metadata/gce" - "github.com/flatcar/coreos-cloudinit/datasource/metadata/packet" "github.com/flatcar/coreos-cloudinit/datasource/proc_cmdline" "github.com/flatcar/coreos-cloudinit/datasource/url" "github.com/flatcar/coreos-cloudinit/datasource/vmware" @@ -66,7 +65,6 @@ var ( gceMetadataService string cloudSigmaMetadataService bool digitalOceanMetadataService string - packetMetadataService string url string procCmdLine bool vmware bool @@ -92,7 +90,6 @@ func init() { flag.StringVar(&flags.sources.gceMetadataService, "from-gce-metadata", "", "Download GCE data from the provided url") flag.BoolVar(&flags.sources.cloudSigmaMetadataService, "from-cloudsigma-metadata", false, "Download data from CloudSigma server context") flag.StringVar(&flags.sources.digitalOceanMetadataService, "from-digitalocean-metadata", "", "Download DigitalOcean data from the provided url") - flag.StringVar(&flags.sources.packetMetadataService, "from-packet-metadata", "", "Download Packet data from metadata service") flag.StringVar(&flags.sources.url, "from-url", "", "Download user-data from provided url") flag.BoolVar(&flags.sources.procCmdLine, "from-proc-cmdline", false, fmt.Sprintf("Parse %s for '%s=', using the cloud-config served by an HTTP GET to ", proc_cmdline.ProcCmdlineLocation, proc_cmdline.ProcCmdlineCloudConfigFlag)) flag.BoolVar(&flags.sources.vmware, "from-vmware-guestinfo", false, "Read data from VMware guestinfo") @@ -128,9 +125,6 @@ var ( "cloudsigma": { "from-cloudsigma-metadata": "true", }, - "packet": { - "from-packet-metadata": "https://metadata.packet.net/", - }, "vmware": { "from-vmware-guestinfo": "true", "convert-netconf": "vmware", @@ -170,16 +164,15 @@ func main() { switch flags.convertNetconf { case "": case "debian": - case "packet": case "vmware": default: - fmt.Printf("Invalid option to -convert-netconf: '%s'. Supported options: 'debian, packet, vmware'\n", flags.convertNetconf) + fmt.Printf("Invalid option to -convert-netconf: '%s'. Supported options: 'debian, vmware'\n", flags.convertNetconf) os.Exit(2) } dss := getDatasources() if len(dss) == 0 { - fmt.Println("Provide at least one of --from-file, --from-configdrive, --from-ec2-metadata, --from-gce-metadata, --from-cloudsigma-metadata, --from-packet-metadata, --from-digitalocean-metadata, --from-vmware-guestinfo, --from-waagent, --from-url or --from-proc-cmdline") + fmt.Println("Provide at least one of --from-file, --from-configdrive, --from-ec2-metadata, --from-gce-metadata, --from-cloudsigma-metadata, --from-digitalocean-metadata, --from-vmware-guestinfo, --from-waagent, --from-url or --from-proc-cmdline") os.Exit(2) } @@ -319,8 +312,6 @@ func setupNetworkUnits(netConfig interface{}, env *initialize.Environment, netco switch netconf { case "debian": ifaces, err = network.ProcessDebianNetconf(netConfig.([]byte)) - case "packet": - ifaces, err = network.ProcessPacketNetconf(netConfig.(packet.NetworkData)) case "vmware": ifaces, err = network.ProcessVMwareNetconf(netConfig.(map[string]string)) default: @@ -367,9 +358,6 @@ func getDatasources() []datasource.Datasource { if flags.sources.waagent != "" { dss = append(dss, waagent.NewDatasource(flags.sources.waagent)) } - if flags.sources.packetMetadataService != "" { - dss = append(dss, packet.NewDatasource(flags.sources.packetMetadataService)) - } if flags.sources.procCmdLine { dss = append(dss, proc_cmdline.NewDatasource()) } diff --git a/datasource/metadata/packet/metadata.go b/datasource/metadata/packet/metadata.go deleted file mode 100644 index 360a3ef..0000000 --- a/datasource/metadata/packet/metadata.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package packet - -import ( - "encoding/json" - "net" - "strconv" - - "github.com/flatcar/coreos-cloudinit/datasource" - "github.com/flatcar/coreos-cloudinit/datasource/metadata" -) - -const ( - DefaultAddress = "https://metadata.platformequinix.com/" - apiVersion = "metadata" - userdataUrl = "userdata" - metadataPath = "metadata" -) - -type Netblock struct { - Address net.IP `json:"address"` - Cidr int `json:"cidr"` - Netmask net.IP `json:"netmask"` - Gateway net.IP `json:"gateway"` - AddressFamily int `json:"address_family"` - Public bool `json:"public"` -} - -type Nic struct { - Name string `json:"name"` - Mac string `json:"mac"` -} - -type NetworkData struct { - Interfaces []Nic `json:"interfaces"` - Netblocks []Netblock `json:"addresses"` - DNS []net.IP `json:"dns"` -} - -// Metadata that will be pulled from the https://metadata.platformequinix.com/metadata only. We have the opportunity to add more later. -type Metadata struct { - Hostname string `json:"hostname"` - SSHKeys []string `json:"ssh_keys"` - NetworkData NetworkData `json:"network"` -} - -type metadataService struct { - metadata.MetadataService -} - -func NewDatasource(root string) *metadataService { - return &metadataService{MetadataService: metadata.NewDatasource(root, apiVersion, userdataUrl, metadataPath, nil)} -} - -func (ms *metadataService) FetchMetadata() (metadata datasource.Metadata, err error) { - var data []byte - var m Metadata - - if data, err = ms.FetchData(ms.MetadataUrl()); err != nil || len(data) == 0 { - return - } - - if err = json.Unmarshal(data, &m); err != nil { - return - } - - if len(m.NetworkData.Netblocks) > 0 { - for _, Netblock := range m.NetworkData.Netblocks { - if Netblock.AddressFamily == 4 { - if Netblock.Public == true { - metadata.PublicIPv4 = Netblock.Address - } else { - metadata.PrivateIPv4 = Netblock.Address - } - } else { - metadata.PublicIPv6 = Netblock.Address - } - } - } - metadata.Hostname = m.Hostname - metadata.SSHPublicKeys = map[string]string{} - for i, key := range m.SSHKeys { - metadata.SSHPublicKeys[strconv.Itoa(i)] = key - } - - metadata.NetworkConfig = m.NetworkData - - return -} - -func (ms metadataService) Type() string { - return "packet-metadata-service" -} diff --git a/network/packet.go b/network/packet.go deleted file mode 100644 index 1f897c1..0000000 --- a/network/packet.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package network - -import ( - "net" - - "github.com/flatcar/coreos-cloudinit/datasource/metadata/packet" -) - -func ProcessPacketNetconf(netdata packet.NetworkData) ([]InterfaceGenerator, error) { - var nameservers []net.IP - if netdata.DNS != nil { - nameservers = netdata.DNS - } else { - nameservers = append(nameservers, net.ParseIP("8.8.8.8"), net.ParseIP("8.8.4.4")) - } - - generators, err := parseNetwork(netdata, nameservers) - if err != nil { - return nil, err - } - - return generators, nil -} - -func parseNetwork(netdata packet.NetworkData, nameservers []net.IP) ([]InterfaceGenerator, error) { - var interfaces []InterfaceGenerator - var addresses []net.IPNet - var routes []route - for _, netblock := range netdata.Netblocks { - addresses = append(addresses, net.IPNet{ - IP: netblock.Address, - Mask: net.IPMask(netblock.Netmask), - }) - if netblock.Public == false { - routes = append(routes, route{ - destination: net.IPNet{ - IP: net.IPv4(10, 0, 0, 0), - Mask: net.IPv4Mask(255, 0, 0, 0), - }, - gateway: netblock.Gateway, - }) - } else { - if netblock.AddressFamily == 4 { - routes = append(routes, route{ - destination: net.IPNet{ - IP: net.IPv4zero, - Mask: net.IPMask(net.IPv4zero), - }, - gateway: netblock.Gateway, - }) - } else { - routes = append(routes, route{ - destination: net.IPNet{ - IP: net.IPv6zero, - Mask: net.IPMask(net.IPv6zero), - }, - gateway: netblock.Gateway, - }) - } - } - } - - bond := bondInterface{ - logicalInterface: logicalInterface{ - name: "bond0", - config: configMethodStatic{ - addresses: addresses, - nameservers: nameservers, - routes: routes, - }, - }, - options: map[string]string{ - "Mode": "802.3ad", - "LACPTransmitRate": "fast", - "MIIMonitorSec": ".2", - "UpDelaySec": ".2", - "DownDelaySec": ".2", - }, - } - - bond.hwaddr, _ = net.ParseMAC(netdata.Interfaces[0].Mac) - - for index, iface := range netdata.Interfaces { - bond.slaves = append(bond.slaves, iface.Name) - - interfaces = append(interfaces, &physicalInterface{ - logicalInterface: logicalInterface{ - name: iface.Name, - config: configMethodStatic{ - nameservers: nameservers, - }, - children: []networkInterface{&bond}, - configDepth: index, - }, - }) - } - - interfaces = append(interfaces, &bond) - - return interfaces, nil -} From 57e1ded7f779eb4563a721facdbfc12c3345d465 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 30 Apr 2026 16:33:46 +0100 Subject: [PATCH 4/4] Drop support for Rackspace Signed-off-by: James Le Cuirot --- Documentation/cloud-config-oem.md | 12 ++++++------ Documentation/cloud-config.md | 4 ++-- config/config_test.go | 10 +++++----- coreos-cloudinit.go | 4 ---- system/oem_test.go | 12 ++++++------ 5 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Documentation/cloud-config-oem.md b/Documentation/cloud-config-oem.md index 3aed626..277cb86 100644 --- a/Documentation/cloud-config-oem.md +++ b/Documentation/cloud-config-oem.md @@ -26,20 +26,20 @@ For example, the following cloud-config document... #cloud-config coreos: oem: - id: "rackspace" - name: "Rackspace Cloud Servers" + id: "cloudstack" + name: "CloudStack" version-id: "168.0.0" - home-url: "https://www.rackspace.com/cloud/servers/" + home-url: "https://cloudstack.apache.org/" bug-report-url: "https://github.com/flatcar/flatcar/issues" ``` ...would be rendered to the following `/etc/oem-release`: ```yaml -ID=rackspace -NAME="Rackspace Cloud Servers" +ID=cloudstack +NAME="CloudStack" VERSION_ID=168.0.0 -HOME_URL="https://www.rackspace.com/cloud/servers/" +HOME_URL="https://cloudstack.apache.org/" BUG_REPORT_URL="https://github.com/flatcar/flatcar/issues" ``` diff --git a/Documentation/cloud-config.md b/Documentation/cloud-config.md index 0680784..9ca36ab 100644 --- a/Documentation/cloud-config.md +++ b/Documentation/cloud-config.md @@ -86,7 +86,7 @@ Environment="ETCD_PEER_ADDR=192.0.2.13:7001" For more information about the available configuration parameters, see the [etcd documentation][etcd-config]. -_Note: The `$private_ipv4` and `$public_ipv4` substitution variables referenced in other documents are only supported on Amazon EC2, Google Compute Engine, OpenStack, Rackspace, DigitalOcean, and Vagrant._ +_Note: The `$private_ipv4` and `$public_ipv4` substitution variables referenced in other documents are only supported on Amazon EC2, Google Compute Engine, OpenStack, DigitalOcean, and Vagrant._ [etcd-config]: https://etcd.io/docs/v3.5/op-guide/configuration/ @@ -126,7 +126,7 @@ Environment="ETCD_LISTEN_PEER_URLS=http://192.0.2.13:2380,http://192.0.2.13:7001 For more information about the available configuration parameters, see the [etcd2 documentation][etcd2-config]. -_Note: The `$private_ipv4` and `$public_ipv4` substitution variables referenced in other documents are only supported on Amazon EC2, Google Compute Engine, OpenStack, Rackspace, DigitalOcean, and Vagrant._ +_Note: The `$private_ipv4` and `$public_ipv4` substitution variables referenced in other documents are only supported on Amazon EC2, Google Compute Engine, OpenStack, DigitalOcean, and Vagrant._ [etcd2-config]: https://etcd.io/docs/v2.3/configuration/ diff --git a/config/config_test.go b/config/config_test.go index 7d23e79..3ba4f2e 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -287,10 +287,10 @@ coreos: ' oem: - id: rackspace - name: Rackspace Cloud Servers + id: cloudstack + name: CloudStack version_id: 168.0.0 - home_url: https://www.rackspace.com/cloud/servers/ + home_url: https://cloudstack.apache.org/ bug_report_url: https://github.com/flatcar/coreos-overlay ssh_authorized_keys: - foobar @@ -360,8 +360,8 @@ Address=10.209.171.177/19 } } - if cfg.CoreOS.OEM.ID != "rackspace" { - t.Errorf("Failed parsing coreos.oem. Expected ID 'rackspace', got %q.", cfg.CoreOS.OEM.ID) + if cfg.CoreOS.OEM.ID != "cloudstack" { + t.Errorf("Failed parsing coreos.oem. Expected ID 'cloudstack', got %q.", cfg.CoreOS.OEM.ID) } if cfg.Hostname != "trontastic" { diff --git a/coreos-cloudinit.go b/coreos-cloudinit.go index fffe5bb..3e55938 100644 --- a/coreos-cloudinit.go +++ b/coreos-cloudinit.go @@ -115,10 +115,6 @@ var ( "gce": { "from-gce-metadata": "http://metadata.google.internal/", }, - "rackspace-onmetal": { - "from-configdrive": "/media/configdrive", - "convert-netconf": "debian", - }, "azure": { "from-waagent": "/var/lib/waagent", }, diff --git a/system/oem_test.go b/system/oem_test.go index 2400fe9..156a558 100644 --- a/system/oem_test.go +++ b/system/oem_test.go @@ -32,19 +32,19 @@ func TestOEMFile(t *testing.T) { }, { config.OEM{ - ID: "rackspace", - Name: "Rackspace Cloud Servers", + ID: "cloudstack", + Name: "CloudStack", VersionID: "168.0.0", - HomeURL: "https://www.rackspace.com/cloud/servers/", + HomeURL: "https://cloudstack.apache.org/", BugReportURL: "https://github.com/flatcar/coreos-overlay", }, &File{config.File{ Path: "etc/oem-release", RawFilePermissions: "0644", - Content: `ID=rackspace + Content: `ID=cloudstack VERSION_ID=168.0.0 -NAME="Rackspace Cloud Servers" -HOME_URL="https://www.rackspace.com/cloud/servers/" +NAME="CloudStack" +HOME_URL="https://cloudstack.apache.org/" BUG_REPORT_URL="https://github.com/flatcar/coreos-overlay" `, }},