Bare-Metal Providers

Overview of the BareMetalProvider interface and supported providers.

Bare-Metal Providers

Overview

AgentMetal abstracts bare-metal infrastructure through the BareMetalProvider interface. This allows agents to manage servers across multiple providers using a unified API, regardless of the underlying provider-specific APIs.

BareMetalProvider Interface

type BareMetalProvider interface {
    // Server management
    ListServers(ctx context.Context) ([]Server, error)
    ProvisionServer(ctx context.Context, spec ServerSpec) (*Server, error)
    DecommissionServer(ctx context.Context, serverID string) error
    RebootServer(ctx context.Context, serverID string) error

// Networking ListFloatingIPs(ctx context.Context) ([]FloatingIP, error) AssignFloatingIP(ctx context.Context, ipID, serverID string) error UnassignFloatingIP(ctx context.Context, ipID string) error

// Metadata ListServerTypes(ctx context.Context) ([]ServerType, error) ListLocations(ctx context.Context) ([]Location, error) }

Supported Providers

ProviderTypeAPIRegions
HetznerCloud + DedicatedHetzner Cloud API + Robot APIGermany, Finland
OVHDedicatedOVH APIEurope, North America, Asia
Equinix MetalBare MetalEquinix Metal APIGlobal (25+ metros)
## Provider Configuration

Providers are configured via environment variables or the AgentMetal configuration file:

providers:
  hetzner:
    enabled: true
    api_token: "hcloud_xxx"
    robot_user: "user"
    robot_password: "pass"
  ovh:
    enabled: true
    application_key: "xxx"
    application_secret: "xxx"
    consumer_key: "xxx"
  equinix:
    enabled: true
    api_token: "xxx"
    project_id: "xxx"

Server Lifecycle

All providers follow the same server lifecycle:

Requested → Provisioning → Running → Stopping → Stopped → Decommissioning → Terminated

The instance agent manages these transitions and handles provider-specific quirks (different boot times, rescue mode availability, network setup).

Choosing a Provider

ConsiderationHetznerOVHEquinix
PricingBudget-friendlyMid-rangePremium
LocationsEuropeGlobalGlobal
Provisioning SpeedMinutesHoursMinutes
Dedicated HardwareVia Robot APIYesYes
Cloud InstancesYesNoNo