Create unmanaged host via REST API

> Hi,
> I'm trying to create not_managed host via REST api. I send following json:
> '{"host": {"operatingsystem_id": 21, "managed": false, "name": "
>", "ip": "", "hostgroup_id": 53, "mac":
> "00:16:3e:00:4e:4b", "architecture_id": 1, "build": "0", "ptable_id": 1}}'
> But hosts created like that always appear as managed. Also, I can't drop
> any field from the set above, which is weird becaus fore exapmle partition
> table is not important for a non-managed host, right?
> Is there a way to create unmanaged host via REST api?
it seems we make the assumption that hosts created via the api are managed.
in order to fix it I would say

  1. open a new feature request on
  2. apply this patch :

diff --git a/app/controllers/hosts_controller.rb
index 2de8015…7fe9852 100644
— a/app/controllers/hosts_controller.rb
+++ b/app/controllers/hosts_controller.rb
@@ -84,7 +84,7 @@ class HostsController < ApplicationController

def create
@host =[:host])

  • @host.managed = true
  • @host.managed = true if params[:host][:managed].nil?



··· On Wed, Aug 1, 2012 at 4:33 PM, tomk wrote:

We are using foreman 1.0.0


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at