Do you have ssh keys or any other means to access the servers automatically?

What I'm thinking is that you could deploy the rabbitmq event notification
message queue, and listen for create/destroy calls.

I don't think you would be able to intercept the create call and alter it's
runtime, but you could theoretically fire up a script that fetches the one
time password, ssh into the vm and issues whatever command you need to
register the vm with IPA.

How you enable event notification varies on your cloudstack version, but
this should be a pointer in the right direction:
http://cloudstack-administration.readthedocs.org/en/latest/events.html

-- 
Erik

On Thu, Oct 30, 2014 at 7:36 PM, Yiping Zhang <[email protected]> wrote:

> I envision to run these pre/post scripts on CS management server.  These
> scripts can be in any of languages such as shell/ruby/python/java.
>
> Here is our use case:
>
> We¹d like to automatically register new instances in RedHat IPA server
> (something like windows nodes auto joining an AD domain when it is
> provisioned), and unregister an instance when it is destroyed. So it seems
> the best way to achieve this is by using pre/post scripts at appropriate
> steps during an instance¹s life cycle.
>
> Here are roughly the steps of registering new instance to IPA:
> 1. User create a new instance in CS web UI
> 2. CS server (thru a pre-create script) tell IPA a new host is coming  and
> generate an one time password for that host (this one time password could
> be save d as user data and passed to instance)
> 3. CS server creates new instance
> 4. New Instance registers itself with IPS, using one time password
> generated in step 2)
>
> Here are roughly steps of unregister an instance from IPA:
> 1. User destroys an instance from CS web UI.
> 2. CS server destroys instance.
> 3. CS server (thru a post-destroy script) tells IPA to unregister the
> destroyed instance.
>
> Is this doable ?
>
> Yiping
>
> On 10/28/14, 9:31 PM, "Jayapal Reddy Uradi"
> <[email protected]> wrote:
>
> >Hi Yiping,
> >
> >Can you please elaborate more about your requirement.
> >Where you want to run the script ? ... Inside the VM ?
> >
> >Thanks,
> >Jayapal
> >On 29-Oct-2014, at 12:31 AM, Yiping Zhang <[email protected]> wrote:
> >
> >> Hi, all:
> >>
> >> Does anyone know if CloudStack provide any mechanism to run a pre/post
> >>scripts after an instance is created or destroyed ?
> >>
> >> Thanks,
> >>
> >> Yiping
> >
>
>

Reply via email to