Project

General

Profile

Actions

Bug #9882

closed

hammer host create with no compute profile or attributes results in "mac value is blank"

Added by Tom Caspy about 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When creating a host on a compute resource with no compute attributes or compute profile, you get the error "mac value is blank":

    # hammer -u … -p … compute-resource info --id 22 | grep -i provider
    Provider:    Libvirt
    # hammer -u … -p … host create \
        --architecture-id 37 \
        --domain-id 42 \
        --environment-id 81 \
        --location-id 258 \
        --mac 'a9:1a:9a:70:be:60' \
        --medium-id 32 \
        --name 'AkqttNPO2' \
        --operatingsystem-id 43 \
        --organization-id 259 \
        --partition-table-id 28 \
        --puppet-proxy-id 1 \
        --root-pass 'changeme' \
        --compute-resource-id 22
    Could not create the host:
    mac value is blank!

Foreman detects whether the host is compute or not based on the presence of the compute_resource_id and some attributes to create it with.

Actions #1

Updated by Tom Caspy about 9 years ago

  • Bugzilla link set to 1177570
Actions #2

Updated by Dominic Cleal about 9 years ago

  • Description updated (diff)
  • Category set to API
  • Subject changed from hammer host create with mac results in "mac value is blank" to hammer host create with no compute profile or attributes results in "mac value is blank"
Actions #3

Updated by Dominic Cleal about 9 years ago

  • Description updated (diff)
Actions #4

Updated by Marek Hulán over 8 years ago

  • Status changed from Ready For Testing to Resolved

I believe this was caused by missing compute attributes that would specify at least one interface which caused fog to create a vm without any nic so Foreman couldn't load a mac. To create the host properly on libvirt compute resource, you have to specify --interface argument as well so it will create at least one interface, e.g.

# hammer -u … -p … host create \
        --architecture-id 37 \
        --domain-id 42 \
        --environment-id 81 \
        --location-id 258 \
        --mac 'a9:1a:9a:70:be:60' \
        --medium-id 32 \
        --name 'AkqttNPO2' \
        --operatingsystem-id 43 \
        --organization-id 259 \
        --partition-table-id 28 \
        --puppet-proxy-id 1 \
        --root-pass 'changeme' \
        --compute-resource-id 22 \
        --interface type=network           # <--- this is important

After we match interfaces with compute interface (introduced in 1.8) this is no longer an issue. If you see this behaviour on Foreman 1.8+, please reopen the issue.

Actions

Also available in: Atom PDF