Project

General

Profile

Bug #7188

Updated by Dominic Cleal over 10 years ago

I'm unable to create a new host using hammer and compute profiles. From the client: 

 <pre> 
 ➜    ~    hammer -d host create --hostgroup="desk_vms" --compute-resource="desk7-a" --compute-profile="desk_vm_hdd" --name="desk7-a-vm0" 
 [ INFO 2014-08-21 10:15:24 Init] Initialization of Hammer CLI (0.1.2) has started... 
 [DEBUG 2014-08-21 10:15:24 Init] Running at ruby 2.0.0-p481 
 [ INFO 2014-08-21 10:15:24 Init] Configuration from the file /Users/imordey/.hammer/cli_config.yml has been loaded 
 [ WARN 2014-08-21 10:15:24 Modules] Legacy configuration of modules detected. Check section about configuration in user manual 
 [DEBUG 2014-08-21 10:15:24 Connection] Registered: foreman 
 [DEBUG 2014-08-21 10:15:24 API] Global headers: { 
         :content_type => "application/json", 
               :accept => "application/json;version=2", 
     "Accept-Language" => "en_GB" 
 } 
 [ INFO 2014-08-21 10:15:24 Modules] Extension module hammer_cli_foreman (0.1.2) loaded 
 [DEBUG 2014-08-21 10:15:24 Init] Using locale 'en_GB' 
 [DEBUG 2014-08-21 10:15:24 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/Library/Ruby/Gems/2.0.0/gems/hammer_cli-0.1.2/locale' 
 [DEBUG 2014-08-21 10:15:24 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/Library/Ruby/Gems/2.0.0/gems/hammer_cli_foreman-0.1.2/locale' 
 [ INFO 2014-08-21 10:15:24 HammerCLI::MainCommand] Called with options: {"option_debug"=>true} 
 [ INFO 2014-08-21 10:15:24 HammerCLIForeman::Host] Called with options: {} 
 [ INFO 2014-08-21 10:15:24 HammerCLIForeman::Host::CreateCommand] Called with options: {"option_managed"=>true, "option_build"=>true, "option_enabled"=>true, "option_volume_list"=>[], "option_interface_list"=>[], "option_compute_resource_name"=>"desk7-a", "option_hostgroup_name"=>"desk_vms", "option_compute_profile_name"=>"desk_vm_hdd", "option_name"=>"desk7-a-vm0"} 
 [ INFO 2014-08-21 10:15:24 API] GET /api/compute_resources 
 [DEBUG 2014-08-21 10:15:24 API] Params: { 
     :search => "name = \"desk7-a\"" 
 } 
 [DEBUG 2014-08-21 10:15:24 API] Headers: { 
     :params => { 
         :search => "name = \"desk7-a\"" 
     } 
 } 
 [DEBUG 2014-08-21 10:15:24 API] Response { 
        "total" => 16, 
     "subtotal" => 1, 
         "page" => 1, 
     "per_page" => 100, 
       "search" => "name = \"desk7-a\"", 
         "sort" => { 
            "by" => nil, 
         "order" => nil 
     }, 
      "results" => [ 
         [0] { 
                       "id" => 9, 
                     "name" => "desk7-a", 
                 "provider" => "Libvirt", 
              "description" => "", 
                      "url" => "qemu+ssh://root@desk7-a.trainlab.example.com/system", 
               "created_at" => "2014-08-13T15:15:13Z", 
               "updated_at" => "2014-08-13T15:15:13Z", 
             "display_type" => "VNC" 
         } 
     ] 
 } 
 [ INFO 2014-08-21 10:15:24 API] GET /api/hostgroups 
 [DEBUG 2014-08-21 10:15:24 API] Params: { 
     :search => "name = \"desk_vms\"" 
 } 
 [DEBUG 2014-08-21 10:15:24 API] Headers: { 
     :params => { 
         :search => "name = \"desk_vms\"" 
     } 
 } 
 [DEBUG 2014-08-21 10:15:25 API] Response { 
        "total" => 3, 
     "subtotal" => 1, 
         "page" => 1, 
     "per_page" => 100, 
       "search" => "name = \"desk_vms\"", 
         "sort" => { 
            "by" => nil, 
         "order" => nil 
     }, 
      "results" => [ 
         [0] { 
                               "id" => 3, 
                             "name" => "desk_vms", 
                            "title" => "desk_vms", 
                        "subnet_id" => 1, 
                      "subnet_name" => "Training Lab Subnet", 
               "operatingsystem_id" => 1, 
             "operatingsystem_name" => "CentOS 6.5", 
                        "domain_id" => 1, 
                      "domain_name" => "trainlab.example.com", 
                   "environment_id" => 2, 
                 "environment_name" => "production", 
               "compute_profile_id" => 4, 
             "compute_profile_name" => "desk_vm", 
                         "ancestry" => nil, 
                  "puppet_proxy_id" => 1, 
               "puppet_ca_proxy_id" => 1, 
                        "ptable_id" => 11, 
                      "ptable_name" => "Kickstart VM", 
                        "medium_id" => 1, 
                      "medium_name" => "CentOS mirror", 
                  "architecture_id" => 1, 
                "architecture_name" => "x86_64", 
                         "realm_id" => nil, 
                       "realm_name" => nil, 
                       "created_at" => "2014-08-14T10:10:07Z", 
                       "updated_at" => "2014-08-14T10:10:07Z" 
         } 
     ] 
 } 
 [ INFO 2014-08-21 10:15:25 API] GET /api/compute_profiles 
 [DEBUG 2014-08-21 10:15:25 API] Params: { 
     :search => "name = \"desk_vm_hdd\"" 
 } 
 [DEBUG 2014-08-21 10:15:25 API] Headers: { 
     :params => { 
         :search => "name = \"desk_vm_hdd\"" 
     } 
 } 
 [DEBUG 2014-08-21 10:15:25 API] Response { 
        "total" => 5, 
     "subtotal" => 1, 
         "page" => 1, 
     "per_page" => 100, 
       "search" => "name = \"desk_vm_hdd\"", 
         "sort" => { 
            "by" => nil, 
         "order" => nil 
     }, 
      "results" => [ 
         [0] { 
                     "id" => 5, 
                   "name" => "desk_vm_hdd", 
             "created_at" => "2014-08-20T15:17:40Z", 
             "updated_at" => "2014-08-20T15:17:40Z" 
         } 
     ] 
 } 
 [ INFO 2014-08-21 10:15:25 API] POST /api/hosts 
 [DEBUG 2014-08-21 10:15:25 API] Params: { 
     "host" => { 
                               "name" => "desk7-a-vm0", 
                "compute_resource_id" => 9, 
                       "hostgroup_id" => 3, 
                              "build" => true, 
                            "enabled" => true, 
                            "managed" => true, 
                 "compute_profile_id" => 5, 
                 "compute_attributes" => { 
             "volumes_attributes" => {} 
         }, 
         "host_parameters_attributes" => {}, 
              "interfaces_attributes" => {} 
     } 
 } 
 [DEBUG 2014-08-21 10:15:25 API] Headers: {} 
 [DEBUG 2014-08-21 10:15:29 API] Response { 
                      "name" => "desk7-a-vm0.trainlab.example.com", 
                        "id" => 135, 
                        "ip" => "172.16.16.165", 
            "environment_id" => 2, 
          "environment_name" => "production", 
               "last_report" => nil, 
                       "mac" => "52:54:00:b6:a8:3f", 
                  "realm_id" => nil, 
                "realm_name" => nil, 
                    "sp_mac" => nil, 
                     "sp_ip" => nil, 
                   "sp_name" => nil, 
                 "domain_id" => 1, 
               "domain_name" => "trainlab.example.com", 
           "architecture_id" => 1, 
         "architecture_name" => "x86_64", 
        "operatingsystem_id" => 1, 
      "operatingsystem_name" => "CentOS 6.5", 
                 "subnet_id" => 1, 
               "subnet_name" => "Training Lab Subnet", 
              "sp_subnet_id" => nil, 
                 "ptable_id" => 11, 
               "ptable_name" => "Kickstart VM", 
                 "medium_id" => 1, 
               "medium_name" => "CentOS mirror", 
                     "build" => true, 
                   "comment" => nil, 
                      "disk" => nil, 
              "installed_at" => nil, 
                  "model_id" => nil, 
                "model_name" => nil, 
              "hostgroup_id" => 3, 
            "hostgroup_name" => "desk_vms", 
                  "owner_id" => 1, 
                "owner_type" => "User", 
                   "enabled" => true, 
        "puppet_ca_proxy_id" => 1, 
                   "managed" => true, 
                 "use_image" => nil, 
                "image_file" => "", 
                      "uuid" => "772b6df6-c697-9d72-1713-3a6150f2a828", 
       "compute_resource_id" => 9, 
     "compute_resource_name" => "desk7-a (Libvirt)", 
        "compute_profile_id" => 5, 
      "compute_profile_name" => "desk_vm_hdd", 
              "capabilities" => [ 
         [0] "build", 
         [1] "image" 
     ], 
          "provision_method" => "build", 
           "puppet_proxy_id" => 1, 
                  "certname" => "desk7-a-vm0.trainlab.example.com", 
                  "image_id" => nil, 
                "image_name" => nil, 
                "created_at" => "2014-08-21T09:15:28Z", 
                "updated_at" => "2014-08-21T09:15:28Z", 
              "last_compile" => nil, 
           "last_freshcheck" => nil, 
                    "serial" => nil, 
            "source_file_id" => nil, 
             "puppet_status" => 0, 
         "all_puppetclasses" => [ 
         [0] { 
                      "id" => 67, 
                    "name" => "java_repo::jdk7_repo", 
             "module_name" => "java_repo" 
         }, 
         [1] { 
                      "id" => 46, 
                    "name" => "packages", 
             "module_name" => "packages" 
         }, 
         [2] { 
                      "id" => 109, 
                    "name" => "passwordless", 
             "module_name" => "passwordless" 
         } 
     ], 
                "parameters" => [], 
                "interfaces" => [], 
             "puppetclasses" => [], 
             "config_groups" => [] 
 } 
 Host created 
 </pre> 

 <pre> 
 ➜    ~    hammer -d host start --id=134 
 No permissions to create log dir /var/log/hammer 
 File /var/log/hammer/hammer.log not writeable, won't log anything to the file! 
 [ INFO 2014-08-21 10:14:13 Init] Initialization of Hammer CLI (0.1.2) has started... 
 [DEBUG 2014-08-21 10:14:13 Init] Running at ruby 2.0.0-p481 
 [ INFO 2014-08-21 10:14:13 Init] Configuration from the file /Users/imordey/.hammer/cli_config.yml has been loaded 
 [ WARN 2014-08-21 10:14:13 Modules] Legacy configuration of modules detected. Check section about configuration in user manual 
 [DEBUG 2014-08-21 10:14:13 Connection] Registered: foreman 
 [DEBUG 2014-08-21 10:14:13 API] Global headers: { 
         :content_type => "application/json", 
               :accept => "application/json;version=2", 
     "Accept-Language" => "en_GB" 
 } 
 [ INFO 2014-08-21 10:14:14 Modules] Extension module hammer_cli_foreman (0.1.2) loaded 
 [DEBUG 2014-08-21 10:14:14 Init] Using locale 'en_GB' 
 [DEBUG 2014-08-21 10:14:14 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/Library/Ruby/Gems/2.0.0/gems/hammer_cli-0.1.2/locale' 
 [DEBUG 2014-08-21 10:14:14 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/Library/Ruby/Gems/2.0.0/gems/hammer_cli_foreman-0.1.2/locale' 
 [ INFO 2014-08-21 10:14:14 HammerCLI::MainCommand] Called with options: {"option_debug"=>true} 
 [ INFO 2014-08-21 10:14:14 HammerCLIForeman::Host] Called with options: {} 
 [ INFO 2014-08-21 10:14:14 HammerCLIForeman::Host::StartCommand] Called with options: {"option_id"=>"134"} 
 [ INFO 2014-08-21 10:14:14 API] PUT /api/hosts/134/power 
 [DEBUG 2014-08-21 10:14:14 API] Params: { 
     "power_action" => :start 
 } 
 [DEBUG 2014-08-21 10:14:14 API] Headers: {} 
 [ERROR 2014-08-21 10:14:14 API] 500 Internal Server Error 
 { 
     "error" => { 
         "message" => "Call to virDomainCreateWithFlags failed: Cannot get interface MTU on '': No such device" 
     } 
 } 
 [ERROR 2014-08-21 10:14:14 Exception] Call to virDomainCreateWithFlags failed: Cannot get interface MTU on '': No such device 
 Call to virDomainCreateWithFlags failed: Cannot get interface MTU on '': No such device 
 [ERROR 2014-08-21 10:14:14 Exception] 

 RestClient::InternalServerError (500 Internal Server Error): 
     /Library/Ruby/Gems/2.0.0/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!' 
     /Library/Ruby/Gems/2.0.0/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result' 
     /Library/Ruby/Gems/2.0.0/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit' 
     /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:852:in `start' 
     /Library/Ruby/Gems/2.0.0/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit' 
     /Library/Ruby/Gems/2.0.0/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute' 
     /Library/Ruby/Gems/2.0.0/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute' 
     /Library/Ruby/Gems/2.0.0/gems/rest-client-1.6.7/lib/restclient/resource.rb:76:in `put' 
     /Library/Ruby/Gems/2.0.0/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `http_call' 
     /Library/Ruby/Gems/2.0.0/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:150:in `call' 
     /Library/Ruby/Gems/2.0.0/gems/apipie-bindings-0.0.8/lib/apipie_bindings/resource.rb:14:in `call' 
     /Library/Ruby/Gems/2.0.0/gems/hammer_cli-0.1.2/lib/hammer_cli/apipie/command.rb:42:in `send_request' 
     /Library/Ruby/Gems/2.0.0/gems/hammer_cli_foreman-0.1.2/lib/hammer_cli_foreman/commands.rb:164:in `send_request' 
     /Library/Ruby/Gems/2.0.0/gems/hammer_cli-0.1.2/lib/hammer_cli/apipie/command.rb:33:in `execute' 
     /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run' 
     /Library/Ruby/Gems/2.0.0/gems/hammer_cli-0.1.2/lib/hammer_cli/abstract.rb:22:in `run' 
     /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute' 
     /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run' 
     /Library/Ruby/Gems/2.0.0/gems/hammer_cli-0.1.2/lib/hammer_cli/abstract.rb:22:in `run' 
     /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute' 
     /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run' 
     /Library/Ruby/Gems/2.0.0/gems/hammer_cli-0.1.2/lib/hammer_cli/abstract.rb:22:in `run' 
     /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run' 
     /Library/Ruby/Gems/2.0.0/gems/hammer_cli-0.1.2/bin/hammer:106:in `<top (required)>' 
     /usr/bin/hammer:23:in `load' 
     /usr/bin/hammer:23:in `<main>' 
 </pre> 

 Try again adding in all the attributes as suggested by Dominic in IRC: 

 <pre> 
 ➜    ~    hammer host create --hostgroup="desk_vms" --compute-resource="desk7-a" --compute-profile="desk_vm_hdd" --compute-attributes="cpus=1,memory=2000000000,start=1" --interface="type=bridge,bridge=br0,model=virtio" --volume="pool=nuc-hdd,capacity=90G,format_type=qcow2" --name="desk7-a-vm0" 
  Failed to power up a compute desk7-a (Libvirt) instance desk7-a-vm0.trainlab.wandisco.com: Call to virDomainCreateWithFlags failed: Cannot get interface MTU on '': No such device 
 </pre> 



Back