Search code examples
google-cloud-platformterraformcloudfedorafedora-coreos

GCP Metadata Larger 256kb


i need to use metadata user-data for few instances (on linux FCOS) larger than 256kb, but i got:

is too large: maximum size 262144 character

https://cloud.google.com/compute/docs/metadata/setting-custom-metadata#limitations

It's possible to:

  • anyhow use larger than 256kb metadata user-data?
  • or fetch user-data for instance from a remote server e.g.: I could upload this user-data to any HTTP server?

Solution

  • I found.. solution via remote ignition file.

    I tried increasing the 256kb per single metadata limit via google support but they cant increase this for me.

    Workaround via remote ignition file:

    1. In Fedora CoreOS user-data add the below snippet
    2. On Nginx share a big ignition file larger than 256kb
    3. Start instance, instance will connect to remote Nginx to get big ignition file
    {
      "ignition": {
        "config": {
          "merge": [
            {
              "source": "http://xxxx/file.ign"
            }
          ]
        },
        "version": "3.2.0"
      }
    }