Project

General

Profile

Actions

Bug #11124

closed

Interface compute attributes not merged from API request over compute profile

Added by Matt Chesler almost 9 years ago. Updated almost 6 years ago.

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

Description

Hammer command:

hammer host create --name network-test-host --architecture-id 1 --puppet-proxy-id 1 --puppet-ca-proxy-id 1 --compute-resource-id 1 --environment-id 1 --domain-id 1 --subnet-id 2 --interface compute_network=10-10-1-0-24-net,compute_type=VirtualVmxnet3,primary=true,provision=true --compute-attributes cluster=Cluster1,cpus=4,memory_mb=8192,guest_id=centos64Guest,scsi_controller_type=ParaVirtualSCSIController,resource_pool=RP1 --operatingsystem-id 2 --partition-table-id 17 --medium-id 8 --volume size_gb=50,datastore=DS4 --hostgroup-id 7

succeeds, but when checking VMware, the network set is not the network specified. Selecting the same network through the Web UI correctly sets the network in VMware.

production.log output when creating with hammer:

Started POST "/api/hosts" for 10.0.0.184 at 2015-07-15 11:39:57 -0400
2015-07-15 11:39:57 [I] Processing by Api::V2::HostsController#create as JSON
2015-07-15 11:39:57 [I]   Parameters: {"host"=>{"name"=>"network-test-host", "environment_id"=>"1", "architecture_id"=>"1", "domain_id"=>"1", "puppet_proxy_id"=>"1", "operatingsystem_id"=>"2", "medium_id"=>"8", "ptable_id"=>"17", "subnet_id"=>"2", "compute_resource_id"=>"1", "hostgroup_id"=>"7", "puppet_ca_proxy_id"=>"1", "build"=>true, "enabled"=>true, "managed"=>true, "compute_attributes"=>{"cluster"=>"Cluster1", "cpus"=>"4", "memory_mb"=>"8192", "guest_id"=>"centos64Guest", "scsi_controller_type"=>"ParaVirtualSCSIController", "resource_pool"=>"RP1", "volumes_attributes"=>{"0"=>{"size_gb"=>"50", "datastore"=>"DS4"}}}, "host_parameters_attributes"=>{}, "interfaces_attributes"=>{"0"=>{"primary"=>"true", "provision"=>"true", "compute_attributes"=>{"network"=>"10-10-1-0-24-net", "type"=>"VirtualVmxnet3"}}}}, "apiv"=>"v2"}
2015-07-15 11:39:57 [I] Skipping user group update for user matt.chesler as usergroup_sync is disabled
2015-07-15 11:39:57 [I] Authorized user matt.chesler(Matt Chesler)
2015-07-15 11:40:22 [I] Adding Compute instance for network-test-host.example.com
2015-07-15 11:40:22 [I] Successfully decrypted field for Foreman::Model::Vmware
2015-07-15 11:40:22 [I] Successfully decrypted field for Foreman::Model::Vmware
2015-07-15 11:40:26 [I] Create DHCP reservation for network-test-host.example.com-00:50:56:a1:28:78/10.10.1.69
2015-07-15 11:40:43 [I] Add the TFTP configuration for network-test-host.example.com
2015-07-15 11:40:44 [I] Fetching required TFTP boot files for network-test-host.example.com
2015-07-15 11:40:44 [I]   Rendered api/v2/hosts/create.json.rabl (80.4ms)
2015-07-15 11:40:44 [I] Completed 200 OK in 46729ms (Views: 78.8ms | ActiveRecord: 67.2ms)
2015-07-15 11:41:22 [I] 

production.log output when creating with Web UI:

Started POST "/hosts" for 10.0.0.184 at 2015-07-15 11:51:18 -0400
2015-07-15 11:51:18 [I] Processing by HostsController#create as */*
2015-07-15 11:51:18 [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"b6tTkXutY578Zn5NcPNi1th20FbjqsHE5DwotXRltBs=", "host"=>{"name"=>"network-test-host", "hostgroup_id"=>"7", "compute_resource_id"=>"1", "compute_profile_id"=>"1", "environment_id"=>"1", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"network-test-host", "domain_id"=>"1", "subnet_id"=>"2", "ip"=>"10.10.1.75", "managed"=>"1", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualVmxnet3", "network"=>"10-10-1-0-24-net"}}, "new_interfaces"=>{"_destroy"=>"1", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"", "domain_id"=>"", "subnet_id"=>"", "ip"=>"", "managed"=>"1", "primary"=>"0", "provision"=>"0", "virtual"=>"0", "tag"=>"", "attached_to"=>"", "compute_attributes"=>{"type"=>"VirtualE1000", "network"=>"172-16-0-0-24-net"}}}, "compute_attributes"=>{"cpus"=>"4", "corespersocket"=>"1", "memory_mb"=>"8192", "cluster"=>"Cluster1", "path"=>"/Datacenters/Cluster1/vm", "guest_id"=>"centos64Guest", "scsi_controller_type"=>"ParaVirtualSCSIController", "hardware_version"=>"Default", "start"=>"1", "volumes_attributes"=>{"new_volumes"=>{"_delete"=>"", "datastore"=>"Backups", "name"=>"Hard disk", "size_gb"=>"10", "thin"=>"true", "eager_zero"=>"false"}, "0"=>{"_delete"=>"", "datastore"=>"DS4", "name"=>"Hard disk", "size_gb"=>"50", "thin"=>"true", "eager_zero"=>"false"}}}, "architecture_id"=>"1", "operatingsystem_id"=>"2", "provision_method"=>"build", "build"=>"1", "medium_id"=>"8", "ptable_id"=>"17", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"4-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"build image", "provider"=>"Vmware"}
2015-07-15 11:51:19 [I] Adding Compute instance for network-test-host.example.com
2015-07-15 11:51:19 [I] Successfully decrypted field for Foreman::Model::Vmware
2015-07-15 11:51:19 [I] Successfully decrypted field for Foreman::Model::Vmware
2015-07-15 11:51:20 [I] 


Related issues 3 (0 open3 closed)

Related to Foreman - Bug #9657: API for creating host can't merge NICs from compute profilesClosedTomáš Strachota03/05/2015Actions
Related to Foreman - Bug #13980: VMWARE: since 1.10, NIC type and Network different from profile configurationClosedDominic Cleal03/01/2016Actions
Related to Foreman - Bug #14179: Interface/NIC compute attributes in API host creation overwritten with compute profile attributesClosedDominic Cleal03/14/2016Actions
Actions

Also available in: Atom PDF