Hardware Data

  • Hardware data holds the details about the hardware that you wish to use with a workflow.
  • A hardware may have multiple network devices that can be used in a worklfow.
  • The details about all those devices is maintained in JSON format as hardware data.

Example

If you have a hardware that has a single network/worker device on it, its hardware data shall be structured like the following:

{
  "id": "0eba0bf8-3772-4b4a-ab9f-6ebe93b90a94",
  "metadata": {
    "bonding_mode": 5,
    "custom": {
      "preinstalled_operating_system_version": {},
      "private_subnets": []
    },
    "facility": {
      "facility_code": "ewr1",
      "plan_slug": "c2.medium.x86",
      "plan_version_slug": ""
    },
    "instance": {
      "crypted_root_password": "redacted",
      "operating_system_version": {
        "distro": "ubuntu",
        "os_slug": "ubuntu_18_04",
        "version": "18.04"
      },
      "storage": {
        "disks": [
          {
            "device": "/dev/sda",
            "partitions": [
              {
                "label": "BIOS",
                "number": 1,
                "size": 4096
              },
              {
                "label": "SWAP",
                "number": 2,
                "size": 3993600
              },
              {
                "label": "ROOT",
                "number": 3,
                "size": 0
              }
            ],
            "wipe_table": true
          }
        ],
        "filesystems": [
          {
            "mount": {
              "create": {
                "options": ["-L", "ROOT"]
              },
              "device": "/dev/sda3",
              "format": "ext4",
              "point": "/"
            }
          },
          {
            "mount": {
              "create": {
                "options": ["-L", "SWAP"]
              },
              "device": "/dev/sda2",
              "format": "swap",
              "point": "none"
            }
          }
        ]
      }
    },
    "manufacturer": {
      "id": "",
      "slug": ""
    },
    "state": ""
  },
  "network": {
    "interfaces": [
      {
        "dhcp": {
          "arch": "x86_64",
          "hostname": "server001",
          "ip": {
            "address": "192.168.1.5",
            "gateway": "192.168.1.1",
            "netmask": "255.255.255.248"
          },
          "lease_time": 86400,
          "mac": "00:00:00:00:00:00",
          "name_servers": [],
          "time_servers": [],
          "uefi": false
        },
        "netboot": {
          "allow_pxe": true,
          "allow_workflow": true,
          "ipxe": {
            "contents": "#!ipxe",
            "url": "http://url/menu.ipxe"
          },
          "osie": {
            "base_url": "",
            "initrd": "",
            "kernel": "vmlinuz-x86_64"
          }
        }
      }
    ]
  }
}

Property Description

The following section explains each property in the above example:

PropertyDescription
idA UUID used to uniquely identify the hardware. The id can be generated using the uuidgen command. If you are in Packet environment, you can get the id from the server overview page.
networkNetwork details
network.Interfaces[]List of network interfaces on the hardware
network.interfaces[].dhcpDHCP details
network.interfaces[].dhcp.macMAC address of the network device (worker)
network.interfaces[].dhcp.ipIP details for DHCP
network.interfaces[].dhcp.ip.addressWorker IP address to be requested over DHCP
network.interfaces[].dhcp.ip.gatewayGateway address
network.interfaces[].dhcp.ip.netmaskNetmask for the private network
network.interfaces[].dhcp.hostnameHostname
network.interfaces[].dhcp.lease_timeExpiration in secs (default: 86400)
network.interfaces[].dhcp.name_servers[]DNS servers
network.interfaces[].dhcp.time_servers[]NTP servers
network.interfaces[].dhcp.archHardware architecture, example: x86_64
network.interfaces[].dhcp.uefiIs UEFI
network.interfaces[].netbootNetboot details
network.interfaces[].netboot.allow_pxeMust be set to true to PXE.
network.interfaces[].netboot.allow_workflowMust be true in order to execute a workflow.
network.interfaces[].netboot.ipxeDetails for iPXE
network.interfaces[].netboot.ipxe.urliPXE script URL
network.interfaces[].netboot.ipxe.contentsiPXE script contents
network.interfaces[].netboot.osieOSIE details
network.interfaces[].netboot.osie.kernelKernel
network.interfaces[].netboot.osie.initrdInitrd
network.interfaces[].netboot.osie.base_urlBase URL for the kernel and initrd
metadataHardware metadata details
metadata.stateState must be set to provisioning for workflows.
metadata.bonding_modeBonding mode
metadata.manufacturerManufacturer details
metadata.instanceHolds the details for an instance
metadata.instance.storageDetails for an instance storage like disks and filesystems
metadata.instance.storage.disksList of disk partitions
metadata.instance.storage.disks[].deviceName of the disk
metadata.instance.storage.disks[].wipe_tableSet to true to allow disk wipe.
metadata.instance.storage.disks[].partitionsList of disk partitions
metadata.instance.storage.disks[].partitions[].sizeSize of the partition
metadata.instance.storage.disks[].partitions[].labelPartition label like BIOS, SWAP or ROOT
metadata.instance.storage.disks[].partitions[].numberPartition number
metadata.instance.storage.filesystemsList of filesystems and their respective mount points
metadata.instance.storage.filesystems[].mountDetails about the filesystem to be mounted
metadata.instance.storage.filesystems[].mount.pointMount point for the filesystem
metadata.instance.storage.filesystems[].mount.createAdditional details that can be provided while creating a partition
metadata.instance.storage.filesystems[].mount.create.optionsOptions to be passed to mkfs while creating a partition
metadata.instance.storage.filesystems[].mount.deviceDevice to be mounted
metadata.instance.storage.filesystems[].mount.formatFilesystem format
metadata.instance.crypted_root_passwordHash for root password that is used to login into the worker after provisioning. The hash can be generated using the openssl passwd command. For example, openssl passwd -6 -salt xyz your-password.
metadata.operating_system_versionDetails about the operating system to be installed
metadata.operating_system_version.distroOperating system distribution name, like ubuntu
metadata.operating_system_version.versionOperating system version, like 18.04 or 20.04
metadata.operating_system_version.os_slugA slug is a combination of operating system distro and version.
metadata.facilityFacility details
metadata.facility.plan_slugThe slug for the worker class. The value for this property depends on how you setup your workflow. While it is required if you are using the OS images from packet-images repository, it may be left out if not used at all in the workflow.
metadata.facility.facility_codeFor local setup, onprem or any other string value can be used.

The Minimal Hardware Data

While the hardware data is essential, not all the properties are required for every workflow. In fact, it’s upto a workflow designer how they want to use the data in their workflow. Therefore, you may start with the minimal data given below and only add the properties you would want to use in your workflow.

{
  "id": "0eba0bf8-3772-4b4a-ab9f-6ebe93b90a94",
  "metadata": {
    "facility": {
      "facility_code": "ewr1",
      "plan_slug": "c2.medium.x86",
      "plan_version_slug": ""
    },
    "instance": {},
    "state": "provisioning"
  },
  "network": {
    "interfaces": [
      {
        "dhcp": {
          "arch": "x86_64",
          "ip": {
            "address": "192.168.1.5",
            "gateway": "192.168.1.1",
            "netmask": "255.255.255.248"
          },
          "mac": "00:00:00:00:00:00",
          "uefi": false
        },
        "netboot": {
          "allow_pxe": true,
          "allow_workflow": true
        }
      }
    ]
  }
}