Adding exsisting hosts

So I have a Foreman master setup. I can provision hosts into my ESX cluster
fine with no problems.

From the Foreman console, I can see VMs I created previously. However I can
not associate these VMs into the Foreman console.

I have taken a few of them and pointed them to the new puppetmaster (my
Foreman server), and while they pickup their catalogs just fine, they do
not show up in the managed hosts tab in Foreman.

What am I doing wrong…

> So I have a Foreman master setup. I can provision hosts into my ESX cluster
> fine with no problems.
>
> From the Foreman console, I can see VMs I created previously. However I can
> not associate these VMs into the Foreman console.
Whats the foreman console you talk of? is it another project? :wink:
>
> I have taken a few of them and pointed them to the new puppetmaster (my
> Foreman server), and while they pickup their catalogs just fine, they do not
> show up in the managed hosts tab in Foreman.

since 1.3.x we support merging them, under compute resources edit
pages, you would find associate vms button that will merge existing
vms to existing hosts in foreman.

Ohad

··· On Thu, Nov 28, 2013 at 8:34 AM, Robert Vernon wrote: > > What am I doing wrong... > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/groups/opt_out.

Morning.

Thanks for taking the time to reply.

Yes I do see the associate VMs tab in the Computer resources. Here is what
I get in the logs when I try using it on a VM.

Started PUT
"/compute_resources/1-vcenter/vms/52f477cd-xxxx-xxxx-xxxx-xxxxxxxxxxxx/associate"
for 10.0.0.0 at 2013-11-29 08:56:52 +0100Processing by
ComputeResourcesVmsController#associate as HTML Parameters:
{"authenticity_token"=>"EbFcUPjvGz7EbFcUPjvGz74Auhy9N5HypPq4Auhy9N5HypPq=",
"compute_resource_id"=>"1-vcenter", "id"=>"52f477cd-

xxxx-xxxx-xxxx-xxxxxxxxxxxx"}Redirected to
https://foreman/compute_resources/1-vcenter/vms/52f477cd-

xxxx-xxxx-xxxx-xxxxxxxxxxxxxCompleted 302 Found in 474ms (ActiveRecord:
2.2ms)Started GET "/compute_resources/1-vcenter/vms/52f477cd-

xxxx-xxxx-xxxx-xxxxxxxxxxxxx" for 10.0.0.0 at 2013-11-29 08:56:53
+0100Processing by ComputeResourcesVmsController#show as HTML Parameters:
{"compute_resource_id"=>"1-vcenter", "id"=>"52f477cd-

xxxx-xxxx-xxxx-xxxxxxxxxxxxx"} Rendered
compute_resources_vms/show/_vmware.html.erb (21.9ms) Rendered
compute_resources_vms/show.html.erb within layouts/application (28.5ms)
Rendered home/_user_dropdown.html.erb (2.1ms)Read fragment
views/tabs_and_title_records-1 (0.2ms) Rendered home/_topbar.html.erb
(2.8ms)Completed 200 OK in 350ms (Views: 38.7ms | ActiveRecord: 1.3ms)

I see the "302 Found" part, but I don't know where its getting that from.

Note, I can do other stuff to the VM, like start up or shutdown, and I have
no problems spinning up a new VM. I think I am missing something small.

R

··· On Thursday, November 28, 2013 11:12:55 PM UTC+8, ohad wrote: > > On Thu, Nov 28, 2013 at 8:34 AM, Robert Vernon > <robert.n...@gmail.com > wrote: > > So I have a Foreman master setup. I can provision hosts into my ESX > cluster > > fine with no problems. > > > > From the Foreman console, I can see VMs I created previously. However I > can > > not associate these VMs into the Foreman console. > Whats the foreman console you talk of? is it another project? ;) > > > > I have taken a few of them and pointed them to the new puppetmaster (my > > Foreman server), and while they pickup their catalogs just fine, they do > not > > show up in the managed hosts tab in Foreman. > > since 1.3.x we support merging them, under compute resources edit > pages, you would find associate vms button that will merge existing > vms to existing hosts in foreman. > > Ohad > > > > What am I doing wrong... > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to foreman-user...@googlegroups.com . > > To post to this group, send email to forema...@googlegroups.com. > > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/groups/opt_out. >

wait I just re-read you message:

"merge existing vms to existing hosts in foreman."

So wait I have to create hosts using the Foreman host creation and then go
to the Computer Associate screen to connect the two together?

Hmmm… If that is the case I think my problem is that my VMs are labeled
"somehostname", while in foreman when I create a host its coming out as
"somehostname.somedomainname.com"

I am wondering if that is where the mismatch is taking place.

Testing this now.

Thanks.

··· On Friday, November 29, 2013 9:08:47 AM UTC+8, Robert Vernon wrote: > > Morning. > > Thanks for taking the time to reply. > > Yes I do see the associate VMs tab in the Computer resources. Here is what > I get in the logs when I try using it on a VM. > > > > *Started PUT > "/compute_resources/1-vcenter/vms/52f477cd-xxxx-xxxx-xxxx-xxxxxxxxxxxx/associate" > for 10.0.0.0 at 2013-11-29 08:56:52 +0100Processing by > ComputeResourcesVmsController#associate as HTML Parameters: > {"authenticity_token"=>"EbFcUPjvGz7EbFcUPjvGz74Auhy9N5HypPq4Auhy9N5HypPq=", > "compute_resource_id"=>"1-vcenter", "id"=>"52f477cd-* > *xxxx-xxxx-xxxx-xxxxxxxxxxxx"}Redirected to > https://foreman/compute_resources/1-vcenter/vms/52f477cd- > * > > > > *xxxx-xxxx-xxxx-xxxxxxxxxxxxxCompleted 302 Found in 474ms (ActiveRecord: > 2.2ms)Started GET "/compute_resources/1-vcenter/vms/52f477cd-* > > *xxxx-xxxx-xxxx-xxxxxxxxxxxxx" for 10.0.0.0 at 2013-11-29 08:56:53 > +0100Processing by ComputeResourcesVmsController#show as HTML Parameters: > {"compute_resource_id"=>"1-vcenter", "id"=>"52f477cd-* > > > > > > > *xxxx-xxxx-xxxx-xxxxxxxxxxxxx"} Rendered > compute_resources_vms/show/_vmware.html.erb (21.9ms) Rendered > compute_resources_vms/show.html.erb within layouts/application (28.5ms) > Rendered home/_user_dropdown.html.erb (2.1ms)Read fragment > views/tabs_and_title_records-1 (0.2ms) Rendered home/_topbar.html.erb > (2.8ms)Completed 200 OK in 350ms (Views: 38.7ms | ActiveRecord: 1.3ms)* > > I see the "302 Found" part, but I don't know where its getting that from. > > Note, I can do other stuff to the VM, like start up or shutdown, and I > have no problems spinning up a new VM. I think I am missing something small. > > R > > On Thursday, November 28, 2013 11:12:55 PM UTC+8, ohad wrote: >> >> On Thu, Nov 28, 2013 at 8:34 AM, Robert Vernon >> wrote: >> > So I have a Foreman master setup. I can provision hosts into my ESX >> cluster >> > fine with no problems. >> > >> > From the Foreman console, I can see VMs I created previously. However I >> can >> > not associate these VMs into the Foreman console. >> Whats the foreman console you talk of? is it another project? ;) >> > >> > I have taken a few of them and pointed them to the new puppetmaster (my >> > Foreman server), and while they pickup their catalogs just fine, they >> do not >> > show up in the managed hosts tab in Foreman. >> >> since 1.3.x we support merging them, under compute resources edit >> pages, you would find associate vms button that will merge existing >> vms to existing hosts in foreman. >> >> Ohad >> > >> > What am I doing wrong... >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Foreman users" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to foreman-user...@googlegroups.com. >> > To post to this group, send email to forema...@googlegroups.com. >> > Visit this group at http://groups.google.com/group/foreman-users. >> > For more options, visit https://groups.google.com/groups/opt_out. >> >

Well this kind of worked. When I created the host, I had to create it as
bare metal, else I would get an error about there already being a host on
the ESX server with he same name as the host I am creating in foreman.

I guess I was expecting Foreman to connect to my VCenter, pull all the
info, and when I click associate, it would join VMs to Foreman hosts if
they existed, if not create the foreman hosts and link them with the VMs.

··· On Friday, November 29, 2013 9:17:52 AM UTC+8, Robert Vernon wrote: > > wait I just re-read you message: > > "merge existing vms to existing hosts in foreman." > > So wait I have to create hosts using the Foreman host creation and then go > to the Computer Associate screen to connect the two together? > > Hmmm... If that is the case I think my problem is that my VMs are labeled > "somehostname", while in foreman when I create a host its coming out as " > somehostname.somedomainname.com" > > I am wondering if that is where the mismatch is taking place. > > Testing this now. > > Thanks. > > On Friday, November 29, 2013 9:08:47 AM UTC+8, Robert Vernon wrote: >> >> Morning. >> >> Thanks for taking the time to reply. >> >> Yes I do see the associate VMs tab in the Computer resources. Here is >> what I get in the logs when I try using it on a VM. >> >> >> >> *Started PUT >> "/compute_resources/1-vcenter/vms/52f477cd-xxxx-xxxx-xxxx-xxxxxxxxxxxx/associate" >> for 10.0.0.0 at 2013-11-29 08:56:52 +0100Processing by >> ComputeResourcesVmsController#associate as HTML Parameters: >> {"authenticity_token"=>"EbFcUPjvGz7EbFcUPjvGz74Auhy9N5HypPq4Auhy9N5HypPq=", >> "compute_resource_id"=>"1-vcenter", "id"=>"52f477cd-* >> *xxxx-xxxx-xxxx-xxxxxxxxxxxx"}Redirected to >> https://foreman/compute_resources/1-vcenter/vms/52f477cd- >> * >> >> >> >> *xxxx-xxxx-xxxx-xxxxxxxxxxxxxCompleted 302 Found in 474ms (ActiveRecord: >> 2.2ms)Started GET "/compute_resources/1-vcenter/vms/52f477cd-* >> >> *xxxx-xxxx-xxxx-xxxxxxxxxxxxx" for 10.0.0.0 at 2013-11-29 08:56:53 >> +0100Processing by ComputeResourcesVmsController#show as HTML Parameters: >> {"compute_resource_id"=>"1-vcenter", "id"=>"52f477cd-* >> >> >> >> >> >> >> *xxxx-xxxx-xxxx-xxxxxxxxxxxxx"} Rendered >> compute_resources_vms/show/_vmware.html.erb (21.9ms) Rendered >> compute_resources_vms/show.html.erb within layouts/application (28.5ms) >> Rendered home/_user_dropdown.html.erb (2.1ms)Read fragment >> views/tabs_and_title_records-1 (0.2ms) Rendered home/_topbar.html.erb >> (2.8ms)Completed 200 OK in 350ms (Views: 38.7ms | ActiveRecord: 1.3ms)* >> >> I see the "302 Found" part, but I don't know where its getting that from. >> >> Note, I can do other stuff to the VM, like start up or shutdown, and I >> have no problems spinning up a new VM. I think I am missing something small. >> >> R >> >> On Thursday, November 28, 2013 11:12:55 PM UTC+8, ohad wrote: >>> >>> On Thu, Nov 28, 2013 at 8:34 AM, Robert Vernon >>> wrote: >>> > So I have a Foreman master setup. I can provision hosts into my ESX >>> cluster >>> > fine with no problems. >>> > >>> > From the Foreman console, I can see VMs I created previously. However >>> I can >>> > not associate these VMs into the Foreman console. >>> Whats the foreman console you talk of? is it another project? ;) >>> > >>> > I have taken a few of them and pointed them to the new puppetmaster >>> (my >>> > Foreman server), and while they pickup their catalogs just fine, they >>> do not >>> > show up in the managed hosts tab in Foreman. >>> >>> since 1.3.x we support merging them, under compute resources edit >>> pages, you would find associate vms button that will merge existing >>> vms to existing hosts in foreman. >>> >>> Ohad >>> > >>> > What am I doing wrong... >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups >>> > "Foreman users" group. >>> > To unsubscribe from this group and stop receiving emails from it, send >>> an >>> > email to foreman-user...@googlegroups.com. >>> > To post to this group, send email to forema...@googlegroups.com. >>> > Visit this group at http://groups.google.com/group/foreman-users. >>> > For more options, visit https://groups.google.com/groups/opt_out. >>> >>

Usually you'd do this by running Puppet on your existing VMs and if your
puppetmaster is configured to send reports + facts to Foreman (as is the
puppetmaster in a default Foreman installer setup) then hosts will be
automatically created in Foreman for your VMs.

The matching of "hosts" to VMs should work by MAC addresses for VMware.

··· -- Dominic Cleal Red Hat Engineering

On 29/11/13 01:42, Robert Vernon wrote:

Well this kind of worked. When I created the host, I had to create it as
bare metal, else I would get an error about there already being a host
on the ESX server with he same name as the host I am creating in foreman.

I guess I was expecting Foreman to connect to my VCenter, pull all the
info, and when I click associate, it would join VMs to Foreman hosts if
they existed, if not create the foreman hosts and link them with the VMs.

On Friday, November 29, 2013 9:17:52 AM UTC+8, Robert Vernon wrote:

wait I just re-read you message:

"merge existing vms to existing hosts in foreman."

So wait I have to create hosts using the Foreman host creation and
then go to the Computer Associate screen to connect the two together?

Hmmm... If that is the case I think my problem is that my VMs are
labeled "somehostname", while in foreman when I create a host its
coming out as "somehostname.somedomainname.com
<http://somehostname.somedomainname.com>"

I am wondering if that is where the mismatch is taking place.

Testing this now.

Thanks.

On Friday, November 29, 2013 9:08:47 AM UTC+8, Robert Vernon wrote:

    Morning.

    Thanks for taking the time to reply.

    Yes I do see the associate VMs tab in the Computer resources.
    Here is what I get in the logs when I try using it on a VM.

    /Started PUT
    "/compute_resources/1-vcenter/vms/52f477cd-xxxx-xxxx-xxxx-xxxxxxxxxxxx/associate"
    for 10.0.0.0 at 2013-11-29 08:56:52 +0100
    Processing by ComputeResourcesVmsController#associate as HTML
      Parameters:
    {"authenticity_token"=>"EbFcUPjvGz7EbFcUPjvGz74Auhy9N5HypPq4Auhy9N5HypPq=",
    "compute_resource_id"=>"1-vcenter",
    "id"=>"52f477cd-///xxxx-xxxx-xxxx-xxxxxxxxxxxx/"}
    Redirected to
    https://foreman/compute_resources/1-vcenter/vms/52f477cd-
    <https://foreman/compute_resources/1-vcenter/vms/52f477cd->////xxxx-xxxx-xxxx-xxxxxxxxxxxxx//
    Completed 302 Found in 474ms (ActiveRecord: 2.2ms)


    Started GET
    "/compute_resources/1-vcenter/vms/52f477cd-/////xxxx-xxxx-xxxx-xxxxxxxxxxxxx///"
    for 10.0.0.0 at 2013-11-29 08:56:53 +0100
    Processing by ComputeResourcesVmsController#show as HTML
      Parameters: {"compute_resource_id"=>"1-vcenter",
    "id"=>"52f477cd-/////xxxx-xxxx-xxxx-xxxxxxxxxxxxx///"}
      Rendered compute_resources_vms/show/_vmware.html.erb (21.9ms)
      Rendered compute_resources_vms/show.html.erb within
    layouts/application (28.5ms)
      Rendered home/_user_dropdown.html.erb (2.1ms)
    Read fragment views/tabs_and_title_records-1 (0.2ms)
      Rendered home/_topbar.html.erb (2.8ms)
    Completed 200 OK in 350ms (Views: 38.7ms | ActiveRecord: 1.3ms)
    /

    I see the "302 Found" part, but I don't know where its getting
    that from.

    Note, I can do other stuff to the VM, like start up or shutdown,
    and I have no problems spinning up a new VM. I think I am
    missing something small.

    R

    On Thursday, November 28, 2013 11:12:55 PM UTC+8, ohad wrote:

        On Thu, Nov 28, 2013 at 8:34 AM, Robert Vernon >             <robert.n...@gmail.com> wrote:
        > So I have a Foreman master setup. I can provision hosts
        into my ESX cluster
        > fine with no problems.
        >
        > From the Foreman console, I can see VMs I created
        previously. However I can
        > not associate these VMs into the Foreman console.
        Whats the foreman console you talk of? is it another
        project? ;)
        >
        > I have taken a few of them and pointed them to the new
        puppetmaster (my
        > Foreman server), and while they pickup their catalogs just
        fine, they do not
        > show up in the managed hosts tab in Foreman.

        since 1.3.x we support merging them, under compute resources
        edit
        pages, you would find associate vms button that will merge
        existing
        vms to existing hosts in foreman.

        Ohad
        >
        > What am I doing wrong...
        >
        > --
        > You received this message because you are subscribed to
        the Google Groups
        > "Foreman users" group.
        > To unsubscribe from this group and stop receiving emails
        from it, send an
        > email to foreman-user...@googlegroups.com.
        > To post to this group, send email to
        forema...@googlegroups.com.
        > Visit this group at
        http://groups.google.com/group/foreman-users
        <http://groups.google.com/group/foreman-users>.
        > For more options, visit
        https://groups.google.com/groups/opt_out
        <https://groups.google.com/groups/opt_out>.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks for a response.

I tried that. Pointing the hosts to the new puppetmaster my foreman host.
However the hosts did not show up in the Host tab as being managed by
foreman.

I've moved past this by just consigning myself to re provisioning VMs as
needed. I have other issues now, will post in separate thread.

Thanks.

R

··· On Monday, December 2, 2013 5:39:52 PM UTC+8, Dominic Cleal wrote: > > Usually you'd do this by running Puppet on your existing VMs and if your > puppetmaster is configured to send reports + facts to Foreman (as is the > puppetmaster in a default Foreman installer setup) then hosts will be > automatically created in Foreman for your VMs. > > The matching of "hosts" to VMs should work by MAC addresses for VMware. > > -- > Dominic Cleal > Red Hat Engineering > > On 29/11/13 01:42, Robert Vernon wrote: > > Well this kind of worked. When I created the host, I had to create it as > > bare metal, else I would get an error about there already being a host > > on the ESX server with he same name as the host I am creating in > foreman. > > > > I guess I was expecting Foreman to connect to my VCenter, pull all the > > info, and when I click associate, it would join VMs to Foreman hosts if > > they existed, if not create the foreman hosts and link them with the > VMs. > > > > On Friday, November 29, 2013 9:17:52 AM UTC+8, Robert Vernon wrote: > > > > wait I just re-read you message: > > > > "merge existing vms to existing hosts in foreman." > > > > So wait I have to create hosts using the Foreman host creation and > > then go to the Computer Associate screen to connect the two > together? > > > > Hmmm... If that is the case I think my problem is that my VMs are > > labeled "somehostname", while in foreman when I create a host its > > coming out as "somehostname.somedomainname.com > > " > > > > I am wondering if that is where the mismatch is taking place. > > > > Testing this now. > > > > Thanks. > > > > On Friday, November 29, 2013 9:08:47 AM UTC+8, Robert Vernon wrote: > > > > Morning. > > > > Thanks for taking the time to reply. > > > > Yes I do see the associate VMs tab in the Computer resources. > > Here is what I get in the logs when I try using it on a VM. > > > > /Started PUT > > > "/compute_resources/1-vcenter/vms/52f477cd-xxxx-xxxx-xxxx-xxxxxxxxxxxx/associate" > > > for 10.0.0.0 at 2013-11-29 08:56:52 +0100 > > Processing by ComputeResourcesVmsController#associate as HTML > > Parameters: > > > {"authenticity_token"=>"EbFcUPjvGz7EbFcUPjvGz74Auhy9N5HypPq4Auhy9N5HypPq=", > > "compute_resource_id"=>"1-vcenter", > > "id"=>"52f477cd-///xxxx-xxxx-xxxx-xxxxxxxxxxxx/"} > > Redirected to > > https://foreman/compute_resources/1-vcenter/vms/52f477cd- > > ////xxxx-xxxx-xxxx-xxxxxxxxxxxxx// > > > Completed 302 Found in 474ms (ActiveRecord: 2.2ms) > > > > > > Started GET > > > "/compute_resources/1-vcenter/vms/52f477cd-/////xxxx-xxxx-xxxx-xxxxxxxxxxxxx///" > > > for 10.0.0.0 at 2013-11-29 08:56:53 +0100 > > Processing by ComputeResourcesVmsController#show as HTML > > Parameters: {"compute_resource_id"=>"1-vcenter", > > "id"=>"52f477cd-/////xxxx-xxxx-xxxx-xxxxxxxxxxxxx///"} > > Rendered compute_resources_vms/show/_vmware.html.erb (21.9ms) > > Rendered compute_resources_vms/show.html.erb within > > layouts/application (28.5ms) > > Rendered home/_user_dropdown.html.erb (2.1ms) > > Read fragment views/tabs_and_title_records-1 (0.2ms) > > Rendered home/_topbar.html.erb (2.8ms) > > Completed 200 OK in 350ms (Views: 38.7ms | ActiveRecord: 1.3ms) > > / > > > > I see the "302 Found" part, but I don't know where its getting > > that from. > > > > Note, I can do other stuff to the VM, like start up or shutdown, > > and I have no problems spinning up a new VM. I think I am > > missing something small. > > > > R > > > > On Thursday, November 28, 2013 11:12:55 PM UTC+8, ohad wrote: > > > > On Thu, Nov 28, 2013 at 8:34 AM, Robert Vernon > > wrote: > > > So I have a Foreman master setup. I can provision hosts > > into my ESX cluster > > > fine with no problems. > > > > > > From the Foreman console, I can see VMs I created > > previously. However I can > > > not associate these VMs into the Foreman console. > > Whats the foreman console you talk of? is it another > > project? ;) > > > > > > I have taken a few of them and pointed them to the new > > puppetmaster (my > > > Foreman server), and while they pickup their catalogs just > > fine, they do not > > > show up in the managed hosts tab in Foreman. > > > > since 1.3.x we support merging them, under compute resources > > edit > > pages, you would find associate vms button that will merge > > existing > > vms to existing hosts in foreman. > > > > Ohad > > > > > > What am I doing wrong... > > > > > > -- > > > You received this message because you are subscribed to > > the Google Groups > > > "Foreman users" group. > > > To unsubscribe from this group and stop receiving emails > > from it, send an > > > email to foreman-user...@googlegroups.com. > > > To post to this group, send email to > > forema...@googlegroups.com. > > > Visit this group at > > http://groups.google.com/group/foreman-users > > . > > > For more options, visit > > https://groups.google.com/groups/opt_out > > . > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to foreman-user...@googlegroups.com . > > To post to this group, send email to forema...@googlegroups.com. > > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/groups/opt_out. > >