[openstack-dev] [Congress] with vm-placement and the third party module

Tim Hinrichs tim at styra.com
Fri May 13 21:12:10 UTC 2016


Hi Yue,

Not sure I understood your question exactly.  You can definitely build your
own datasource and have it do whatever you want.  The one I created had all
the vm-placement logic that was contained in
policy_engines/vmplacement.py.  And in the commit it shows how to invoke
the different functions on that datasource from the command line using curl.

BTW I added the openstack-dev mailing list to this thread.  It's good to
send this kind of note to openstack-dev and start the subject line with
[Congress] so the Congress team sees it.

Tim



On Thu, May 12, 2016 at 7:47 PM Yue Xin <xinyuefeiyang at gmail.com> wrote:

> Hi Tim and all,
>
> Thank you so much. It helps a lot.
> But I still have some confusion here. The vmplace driver trigger the vm
> placement by combine the driver and vm together。is there any way to have
> congress communicate with a separate one?(seperate driver and module)
>
> Thank you very much
>
> *Regards,*
> *Yue*
>
> On 11 May 2016 at 21:22, Tim Hinrichs <tim at styra.com> wrote:
>
>> Hi Yue,
>>
>> I got the vm-placement code added to a datasource that seems to spin up
>> and is working.  You can get the vm-placement datasource driver from here:
>>
>> https://review.openstack.org/#/c/315303/
>>
>> The commit message explains how to use it.  (You already know how to
>> configure Congress to use a new datasource driver.  So you do the same
>> thing with this new file.)
>>
>> Tim
>>
>> On Tue, May 10, 2016 at 6:50 AM Yue Xin <xinyuefeiyang at gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> Thank you so much for your kindness feedback.
>>>
>>> I will try to put vm_placement.py in the same directory with
>>> others.(pervious I didn't find the location of other drivers, now I figured
>>> out they are in /opt/stack/congress/congress/datasources/).
>>>
>>> I am not quite sure about the congress version, I download the "Tokyo
>>> Hands On Lab virtual machine <https://goo.gl/o062Kc>" directly to work
>>> on virtualbox.
>>>
>>> My vm_placement_driver.py is quite simple right now(not sure about how
>>> it works). I have attached it below. I will work on it this week, if any
>>> progress, I will let you know.
>>>
>>> Thanks
>>>
>>>
>>> *Regards,*
>>> *Yue*
>>>
>>> On 9 May 2016 at 18:27, Tim Hinrichs <tim at styra.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> Yue wants to use the vm-placement module.  It's intended to be an
>>>> additional policy-engine, but maybe we can load it as if it were a new
>>>> datasource.  Anyone know if that would work?
>>>>
>>>> Yue: I CCed the rest of the team.  When you configure Congress, you are
>>>> giving it the path to the datasource:
>>>> congress.datasources.vm_placement_driver says to grab
>>>> congress/datasources/vm_placement_driver.py.  So put your file at that
>>>> location within the Congress repo.  (Make sure it's in the same directory
>>>> as all the other drivers.)  If that doesn't work, could you tell us which
>>>> version of Congress you are using (the Hands-on-lab from Vancouver?)?
>>>> Could you attach the vm_placement_driver.py file you are using?
>>>>
>>>> Tim
>>>>
>>>>
>>>>
>>>> On Mon, May 9, 2016 at 3:13 PM Yue Xin <xinyuefeiyang at gmail.com> wrote:
>>>>
>>>>> Hi Tim,
>>>>>
>>>>> Thank you very much for your reply.
>>>>>
>>>>>  I have written an demo vm-placement driver, and tried to put it into
>>>>> the demo. But I have no clue where to put it.
>>>>>
>>>>> I added an line in "devstack/lib/congress" to tell congress there is a
>>>>> new driver added
>>>>> [image: image.png]
>>>>>
>>>>> but when I use the command "opeopenstack congress datasource create
>>>>> --config username=admin --config tenant_name=admin  --config auth_url=
>>>>> http://127.0.0.1:5000/v2.0 --config password=password -ope-config
>>>>> poll_time=5 vm_placement vm_placement"
>>>>>
>>>>> the response is"*driver not found(Http 404)"*
>>>>>
>>>>> I guess it is because I didn't put the vm_placement_driver.py in the
>>>>> right place.
>>>>>
>>>>> Can you give me some suggestion where to put the added driver?
>>>>>
>>>>> Thank you very much
>>>>>
>>>>> *Regards,*
>>>>> *Yue*
>>>>>
>>>>> On 6 May 2016 at 19:23, Tim Hinrichs <tim at styra.com> wrote:
>>>>>
>>>>>> Hi Yue,
>>>>>>
>>>>>> 1. The hands on lab definitely doesn't discuss the VM-placement
>>>>>> functionality.  That functionality is definitely experimental.  If I
>>>>>> remember right, the basic algorithms are there, but we didn't hook
>>>>>> everything up and fill out all the details that you would need to try it
>>>>>> out through the normal API.  If you'd like, I'm happy to help talk you
>>>>>> through doing that.
>>>>>>
>>>>>> 2. Congress can trigger any actions defined within its datasources,
>>>>>> which are Python code that are part of Congress.  So you can always create
>>>>>> a new datasource driver that contains a method that invokes a 3rd party
>>>>>> module, configure Congress to use that driver, and write policy to execute
>>>>>> the new method under whatever conditions you like.  The Hands on lab shows
>>>>>> you how to write policies that execute actions.  Below are the relevant
>>>>>> docs.
>>>>>>
>>>>>> Writing a new datasource driver.
>>>>>>
>>>>>> http://docs.openstack.org/developer/congress/cloudservices.html#drivers
>>>>>>
>>>>>> Writing policy to invoke actions.
>>>>>>
>>>>>> http://docs.openstack.org/developer/congress/enforcement.html#manual-reactive-enforcement
>>>>>>
>>>>>> Tim
>>>>>>
>>>>>>
>>>>>> On Fri, May 6, 2016 at 4:58 AM Yue Xin <xinyuefeiyang at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Tim,
>>>>>>>
>>>>>>> Hope everything goes on well.
>>>>>>>
>>>>>>> I am a student working on congress, but I am new to it, so I have
>>>>>>> downloaded the Tokyo Hands on Lab virtual machine. I am not sure is it
>>>>>>> integrated the vm placement, how to test whether the vm placement is
>>>>>>> available or not.
>>>>>>>
>>>>>>> Besides is it possible for congress to trigger a third party module?
>>>>>>> May I ask for some clue.
>>>>>>>
>>>>>>> Thank you very much.
>>>>>>>
>>>>>>> *Regards,*
>>>>>>> *Yue*
>>>>>>>
>>>>>>
>>>>>
>>>
>
>
> --
> *Regards,*
> *Yue*
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20160513/b1b18abf/attachment.html>


More information about the OpenStack-dev mailing list