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
| Provider | Type | API | Regions |
|---|---|---|---|
| Hetzner | Cloud + Dedicated | Hetzner Cloud API + Robot API | Germany, Finland |
| OVH | Dedicated | OVH API | Europe, North America, Asia |
| Equinix Metal | Bare Metal | Equinix Metal API | Global (25+ metros) |
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
| Consideration | Hetzner | OVH | Equinix |
|---|---|---|---|
| Pricing | Budget-friendly | Mid-range | Premium |
| Locations | Europe | Global | Global |
| Provisioning Speed | Minutes | Hours | Minutes |
| Dedicated Hardware | Via Robot API | Yes | Yes |
| Cloud Instances | Yes | No | No |