Giter Club home page Giter Club logo

firebuild-mmds's Introduction

firebuild MMDS metadata library

This library contains the MMDS metadata definition used by firebuild built machines and a program to load the VM configuration on the guest from the MMDS.

manually querying the metadata from guest

curl -H 'Accept: application/json' http://169.254.169.254/latest/meta-data | jq '.'

Example of the output:

{
   "Drives":{
      "1":{
         "DriveID":"1",
         "IsReadOnly":"false",
         "IsRootDevice":"true",
         "PartUUID":"",
         "PathOnHost":"rootfs"
      }
   },
   "Env":{},
   "ImageTag":"combust-labs/etcd:3.4.0",
   "LocalHostname":"focused-edison",
   "Machine":{
      "CPU":"1",
      "CPUTemplate":"",
      "HTEnabled":"false",
      "KernelArgs":"console=ttyS0 noapic reboot=k panic=1 pci=off nomodules rw",
      "Mem":"128",
      "VMLinux":"vmlinux-v5.8"
   },
   "Network":{
      "CniNetworkName":"alpine",
      "Interfaces":{
         "c6:15:a7:48:76:16":{
            "Gateway":"192.168.127.1",
            "HostDeviceName":"tap18",
            "IfName":"",
            "IP":"192.168.127.54",
            "IPAddr":"192.168.127.54/24",
            "IPMask":"ffffff00",
            "IPNet":"ip+net",
            "NameServers":""
         }
      }
   },
   "Users":{
      "alpine":{
         "SSHKeys":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDMY2vE7bgq4p4rCfiFfemkMu4P5pX7QA1qCDXu/3kzD/EO1S7jwBR69OTW5BCiOVgRfl+o2or5rBkDrsd6GKCJd3enqRLVqHazeWRJlRLx4W/uyM7n664SgFQ/Tno3g+NIo06XN8Ijhr0IGVsEF+FFO5rWOGVGANV5vuChd4QLtCGW6uJtNuNl6vCFcRU+wlYU/1QzfnuicTNGVQhsG1AIEhqmGRJYXWypOIE4s09z0T/rtD988678jINdPj3e5Gv5qBEra0IrgDTVncQfWW6m+T04uE88qYFzrgDR8rovljZiPKp3xFsBUK7Zkzkc5PIJJPaswnm4qYL2TuPVm1LnfjacrmZdaaIHepyiWNLZFClzwqz8lQqKLyXIccGELyGDibN8AEe2W7VbAoqNe9PGJSo4ooB5Owy97yyPE0VwTXwXiBZ/tjJu6U+/kDXzdhQFu+sJEoLmCOgh/+nZ1zLuP+qVJ7rWARX/GtsQYXN9ZcI+TnrqNQ33F8/l6J5SX/XSHX7wtHCpCa8JdyF4yRTz05UAGEezWPAXhjgckCkMriyaoEibBcNDMiUSB7ngXgs4EYHf5FyepWZw8UFceMLKrEbcPNRfQxnNmTCUU3F71NAHqEl//RESUnF5I4NgwxQnqBCe0sVhTAfLOfkddET88jpHjn5uOxFAelcPyWBW6Q==\n"
      }
   },
   "VMMID":"pkztxllhbaactacdyhea"
}

vminit

Build vminit for Linux:

make build-vminit

run on the guest

Assuming that the guest VM is started with --mmds flag and MMDS defaults:

sudo vminit

functionality

vminit contacts the MMDS service from the gurst and downloads the MMDS data. After download, it does the following actions:

  • if latest/meta-data/Env map contains any values, if writes the environment file in /etc/profile.d/run-env.sh
  • if latest/meta-data/LocalHostname is not empty, writes the value to /etc/hostname file
  • if rewrites /etc/hosts file to the defaults, additionally:
    • if latest/meta-data/Network/Interfaces contains interfaces and latest/meta-data/LocalHostname is not empty, adds an mapping entry for the interface IP address + hostname such that the VM can resolve its own hostname
  • if latest/meta-data/Users contains user definitions, writes SSH authorized keys files for each respective user

cutting releases

make release

This will create a release on GitHub.

make build-vmlinux

Upload the resulting binary artifact to the release.

firebuild-mmds's People

Contributors

radekg avatar loki-101 avatar

Stargazers

Archer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.