You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vcl.apache.org by YOUNG OH <oh...@gmail.com> on 2014/06/02 20:22:55 UTC
Re: OpenStack Module
Hi All,
I have tested my openstack module (
https://issues.apache.org/jira/browse/VCL-590) on the OpenStack Icehouse
(The ninth release of OpenStack, April 17, 2014) and I could provisioning a
Linux image through it.
The environment details are as follows:
1. Host Blade
:- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
:- Memory: 49G
:- Disk: 134G
:- OS: RHEL 6.4 x64 with KVM hypervisor
2. OpenStack Icehouse Components
:- Compute
:- Network (Nova-Network, not OpenStack Neutron)
:- Glance
3. Provisioning Linux image
:- CentOS 6.3 x64
4. VCL 2.3
In this test, I've just tested the provisioning an image but I would like
to post the detail information to jira once I finish other test. In
addition, I will try to add a function of selecting OpenStack flavors based
on the size of an image. The current openstack module sets flavors for each
image because the previous OpenStack releases (Essex as I know) didn't
support the size information of images but now it supports. I will also
post to jira issue when I add the function to my module. Thank you.
Best regards,
Young-Hyun
On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <ca...@cybera.ca>
wrote:
> >
> > I haven't looked at Try::Tiny or any newer exception handling features of
> > Perl, but I'd prefer to keep the number of external modules to a minimum
> if
> > possible. If there are new features in Perl which would be beneficial,
> I'd
> > rather make the newer version of Perl a requirement and use the built in
> > features. Otherwise, we're locked into using an external module, usually
> > from CPAN, which has no quality assurance. I regret adding some of the
> > current modules such as InsideOut, rather then writing the code which
> could
> > accomplish the same objective.
> > Did you need to catch exceptions because one of the OpenStack modules
> > you're using may throw a die exception? When this happens, the entire
> vcld
> > process for the reservation exits abruptly which causes problems such as
> > the request state remaining in pending indefinitely. This happens even
> if
> > you wrap the call in an eval block. I have worked around this problem
> > before by locally overriding the die handler. Take a look at
> > vSphere_SDK.pm and find lines such as:
> > # Override the die handler
> > local $SIG{__DIE__} = sub{};
> > The vSphere SDK is one example which may call die (via Carp). If this
> > happens with die overridden, the eval block returns normally. If an
> > exception occurred, $EVAL_ERROR should be set.
>
>
> The OpenStack SDK throws exceptions when requests that delete/modify/create
> resources fail, no die exceptions though. There wasn't any specific feature
> that made me choose Try::Tiny, it was more my unfamiliarity with exception
> handling in Perl which seemed to have a number of gotchas prior to 5.14 so
> I figured it'd be better to let someone else's code worry about that.
>
>
> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
>
> I see no problems. Any barriers or difficulty you encounter with the core
> > code should be addressed by improving the core code.
> > Reworking the dependency on /etc/hosts is something I'd like to improve
> > regardless. People often encounter problems with this if they forget to
> > add entries to /etc/hosts for all their computers, including the
> management
> > node(s). I'd like to not read /etc/hosts on the management node at all
> and
> > have the value in the computer table be authoritative. This should
> > facilitate cases where the provisioning module needs to do something
> > different regarding private IPs such as if they are dynamically
> allocated.
> > The provisioning module would retrieve the IP when the image gets loaded
> > by querying DNS or some other method and then update the database. The
> OS
> > module would then use this value to configure the computer.
>
>
> Sounds good. I agree that avoiding the hosts file would be best, especially
> in a case like this where it needs to be continuously modified. Here's our
> changed get_computer_private_ip_address, lines 45-55 are the new code:
>
> https://gist.github.com/cmann/9896513
>
> Finally we're still working on putting together more comprehensive
> installation documentation for anyone who wants to try it out. We're use
> automation for a number of the tasks and I haven't had a chance to run
> through it from scratch yet. For anyone feeling adventurous these are the
> most basic instructions:
>
> 1. Apply the NAT patch
> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and 2.3.1,
> make sure to read the Google doc)
> 2. Follow the instructions in the readme in the Github repo for the
> OpenStack module.
>
> Cameron
>
>
> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu> wrote:
>
> > >
> > >
> > > 2. We use the Try::Tiny module to handle exceptions since the version
> of
> > > Perl VCL 2.3 uses doesn't support the saner try/catch mechanisms
> > available
> > > in newer releases, however this would add an additional dependency to
> > VCL.
> > > Depending on the version of Perl VCL 2.4 is planning to use what are
> > > people's thoughts on using Try::Tiny versus switching to Perl's
> internal
> > > mechanisms?
> > >
> >
> > I haven't looked at Try::Tiny or any newer exception handling features of
> > Perl, but I'd prefer to keep the number of external modules to a minimum
> if
> > possible. If there are new features in Perl which would be beneficial,
> I'd
> > rather make the newer version of Perl a requirement and use the built in
> > features. Otherwise, we're locked into using an external module, usually
> > from CPAN, which has no quality assurance. I regret adding some of the
> > current modules such as InsideOut, rather then writing the code which
> could
> > accomplish the same objective.
> >
> > Did you need to catch exceptions because one of the OpenStack modules
> > you're using may throw a die exception? When this happens, the entire
> vcld
> > process for the reservation exits abruptly which causes problems such as
> > the request state remaining in pending indefinitely. This happens even
> if
> > you wrap the call in an eval block. I have worked around this problem
> > before by locally overriding the die handler. Take a look at
> > vSphere_SDK.pm and find lines such as:
> >
> > # Override the die handler
> > local $SIG{__DIE__} = sub{};
> >
> > The vSphere SDK is one example which may call die (via Carp). If this
> > happens with die overridden, the eval block returns normally. If an
> > exception occurred, $EVAL_ERROR should be set.
> >
> >
> > >
> > > 3. I've saved the best for last, but first some background. The biggest
> > > change we've made is that we no longer rely on the /etc/hosts file at
> all
> > > (though we haven't removed the code that keeps it up to date). We had a
> > > number of issues with duplicate entries ending up in the hosts file and
> > > weren't able to pin down the exact cause. This led us to adding a table
> > to
> > > the database to track VCL computer to OpenStack instance mappings. The
> > next
> > > issue we ran into was the private IP address not being populated in the
> > > hosts file. This happened very rarely and we're still unsure of the
> cause
> > > especially since there's an explicit check that the address is
> populated
> > > with a value before we write the hosts file. I'd assume that the Nova
> API
> > > occasionally returns a response where the addresses component is
> > structured
> > > differently than we expect, though I was never able to directly observe
> > > this behavior. Since OpenStack automatically creates DNS entries for
> new
> > > instances we decided the best course of action was to bypass the hosts
> > file
> > > entirely. In the end we modified get_computer_private_ip_address in
> > > DataStructure.pm to do a DNS lookup rather than looking in the hosts
> > file.
> > >
> > > The question for the community is are changes to core VCL code
> > acceptable?
> > > Or should we find a solution that keeps everything contained to the
> > > provisioning module? If changes to core code are acceptable we'd also
> > have
> > > to decide on a method of detecting when to do a DNS lookup. Should it
> > > depend on the provisioning module in use? A configuration option?
> >
> >
> > I see no problems. Any barriers or difficulty you encounter with the
> core
> > code should be addressed by improving the core code.
> >
> > Reworking the dependency on /etc/hosts is something I'd like to improve
> > regardless. People often encounter problems with this if they forget to
> > add entries to /etc/hosts for all their computers, including the
> management
> > node(s). I'd like to not read /etc/hosts on the management node at all
> and
> > have the value in the computer table be authoritative. This should
> > facilitate cases where the provisioning module needs to do something
> > different regarding private IPs such as if they are dynamically
> allocated.
> > The provisioning module would retrieve the IP when the image gets loaded
> > by querying DNS or some other method and then update the database. The
> OS
> > module would then use this value to configure the computer.
> >
> > One comment regarding adding tables... great! Add all the tables you
> think
> > are beneficial. I have seen some try to work around the current database
> > schema rather than adding to it. There's no reason for this. If there
> are
> > configuration options which apply only to OpenStack, add something like
> an
> > openstackconfig table. If the vmprofile table doesn't align, add
> something
> > like an openstackprofile table. If there are general options such as how
> > to handle DNS or private IP resolution, we could add a more general table
> > or possibly extend the managementnode or computer table.
> >
> > Thanks,
> > Andy
> >
>
Re: OpenStack Module
Posted by Aaron Peeler <fa...@ncsu.edu>.
I think a variant of option 2 is ideal, similar to the vmware module.
Warn and log if it does not get deleted and only fail the vm node if
it still responds to ssh.
Also could extend the healthcheck module to do routine cleanup.
just my thoughts,
Aaron
On Tue, Jul 22, 2014 at 3:37 PM, Cameron Mann <ca...@cybera.ca> wrote:
> Agreed, this goes back to more general VCL behaviour so it would be good to
> get others' input.
>
> Cameron
>
>
> On Tue, Jul 22, 2014 at 1:22 PM, YOUNG OH <oh...@gmail.com> wrote:
>
>> That's great observation. I think option 1 and 2 can provide fast loading
>> time due to no load failure. But, to avoid quota issues, an admin should
>> periodically check the all the instances whether there are any duplicate
>> instance names and defunct instances. The option 3 is safe but slow to load
>> if any deleting instance fails. I also agree that option 2 would be a good
>> choice because it can provide lower load time for end-users and also we
>> cannot exactly estimate the deletion time. But I hope to hear others'
>> thoughts.
>>
>> Best regards
>> Young
>>
>>
>> On Tue, Jul 22, 2014 at 2:46 PM, Cameron Mann <ca...@cybera.ca>
>> wrote:
>>
>> > Looks good. Though I do wonder if it's necessary to fail the entire load
>> > process just because the old instance doesn't get deleted. I think
>> there's
>> > three possibilities:
>> >
>> > 1. Don't check for successful deletion; there won't be any conflicts
>> > because we're using openstackComputerMap. This would give the fastest
>> load
>> > times, but the only way to find out that something went wrong would be to
>> > look at the list of instances and see if there are any duplicate names.
>> > Could cause issues with quotas if running near capacity since there could
>> > be extra instances lying around.
>> >
>> > 2. Check for successful deletion, but only log the error, don't fail the
>> > load. Slower load times, but the load won't fail and the error will be
>> > logged. Could cause issues with quotas if running near capacity since
>> there
>> > could be extra instances lying around.
>> >
>> > 3. What the module does now, check for successful deletion and fail if
>> not.
>> > Least end user friendly since they might encounter failures, but the
>> safest
>> > option. Won't cause quota issues on it's own, though an admin could still
>> > change the computer back to available without deleting the defunct
>> > instance.
>> >
>> > Instance deletion time is also not very consistent in my experience; I've
>> > seen anything from seconds to over a minute and I imagine it could go
>> > higher on OpenStack systems that see heavier usage. If we stick with
>> option
>> > 3 I'd recommend bumping the timeout by another minute or two just to be
>> > safe. I think it's less necessary for option 2 since it doesn't fail on
>> > timeout.
>> >
>> > I took a look at some of the other provisioning modules to see what they
>> > do:
>> >
>> > - VMware logs a warning if it fails to delete the old VM, but only fails
>> if
>> > the VM is still responding to SSH
>> > - Libvirt fails if deletion fails
>> > - VirtualBox doesn't check for successful deletion, though it will fail
>> if
>> > it can't find the old VM to delete
>> >
>> > I think options 2 or 3 would be most consistent with existing behaviour.
>> > I'd lean towards option 2 since end users won't see any extra failures
>> and
>> > we can keep a lower timeout which will mean lower load times even if a
>> > deletion takes a long time.
>> >
>> > What are you thoughts?
>> >
>> > Cameron
>> >
>> >
>> > On Tue, Jul 22, 2014 at 9:05 AM, YOUNG OH <oh...@gmail.com>
>> wrote:
>> >
>> > > Cameron,
>> > >
>> > > Yes, you are definitely right. I was noticed that using hostname to
>> find
>> > > the openstack instance id is not working properly and also can cause
>> the
>> > > problem you described. I've back to use the openstackComputerMap table
>> to
>> > > get_os_instance_id when the instance is pingable and also add a loop in
>> > > _terminate_os_instance to check whether the instance is completely
>> > deleted
>> > > or not. Please take a look at it again and let me know if you have any
>> > > concerns. Thank you.
>> > >
>> > > Best regards,
>> > > Young
>> > >
>> > >
>> > > On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <ca...@cybera.ca>
>> > > wrote:
>> > >
>> > > > Sounds like good progress to me. One comment though, it looks like
>> > > > _terminate_os_instance does the DELETE request, checks the response
>> for
>> > > > success and then sleeps for 30 seconds while the instance deletes.
>> > > However,
>> > > > I don't believe a successful response to the DELETE request
>> guarantees
>> > > the
>> > > > instance will actually be deleted. I've run into situations where an
>> > > > instance gets stuck in the error or deleting states but the command
>> > line
>> > > > client reports no errors when trying to delete it. This could result
>> > in a
>> > > > situation where multiple instances with the same name exist which
>> could
>> > > > cause _get_os_instance_id to return the wrong ID since it filters the
>> > > > instances based on name and selects the first in the list.
>> > > >
>> > > > I think either returning to using openstackComputerMap or looping
>> with
>> > a
>> > > > timeout until the instance is actually deleted would be better
>> choices.
>> > > The
>> > > > former would allow the new instance to be created even if the
>> deletion
>> > of
>> > > > the old one fails. The latter would put the computer in VCL into an
>> > error
>> > > > state which would make it more obvious something has gone wrong,
>> though
>> > > at
>> > > > the cost of potentially failing a user's reservation. As an added
>> > > > precaution It might also be worth having _get_os_instance_id fail if
>> > > > there's more than one instance in the response.
>> > > >
>> > > > Cameron
>> > > >
>> > > >
>> > > > On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <oh...@gmail.com>
>> > > wrote:
>> > > >
>> > > > > Cameron,
>> > > > >
>> > > > > I hope you had a great time and welcome back to work :-). And, yes,
>> > the
>> > > > > OpenStack module with directly using OpenStack APIs can solve the
>> > > > concerns
>> > > > > we've discussed and it's more flexible to apply new version of
>> > > OpenStack
>> > > > > APIs, if necessary. In the updated openstack module, I've changed
>> the
>> > > two
>> > > > > main things. First, I've used the hostname in Computer table
>> (unique
>> > in
>> > > > the
>> > > > > same VCL database) to create an instance and get the instance id to
>> > > > > terminate rather than using the openstackComputerMap table. This
>> can
>> > > > avoid
>> > > > > using an additional table and database transactions. Second, I've
>> > > changed
>> > > > > the openstackImageMap to openstackimagerevision table that maps the
>> > > > > imagerevision id with the openstack image id. This table consists
>> of
>> > > > three
>> > > > > fields (imagerevisionid, imagedetails, flavordetails). The
>> > imagedetails
>> > > > and
>> > > > > flavordetails contains the details image and flavor information
>> with
>> > > json
>> > > > > format. Thus, when VCL creates an instance, it gets each detail
>> > > > information
>> > > > > and parse them to find the corresponding openstack image id and
>> > flavor
>> > > > id.
>> > > > > In addition, I've implemented the get_image_size() subroutine
>> because
>> > > the
>> > > > > image size information was not supported in OpenStack ESSEX but it
>> > > > supports
>> > > > > now. This is a short summary about the changes. So, if you have any
>> > > > concern
>> > > > > or questions about the updates, please let me know. Thank you.
>> > > > >
>> > > > > Best regards,
>> > > > > Young-Hyun
>> > > > >
>> > > > >
>> > > > > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <
>> > cameron.mann@cybera.ca
>> > > >
>> > > > > wrote:
>> > > > >
>> > > > > > Sorry for the silence from my end, I realized I forgot to
>> mention I
>> > > was
>> > > > > > going to be on vacation for the last week and a half. Anyways, it
>> > > looks
>> > > > > > like Young's updates have addressed the main concerns we were
>> > having
>> > > > with
>> > > > > > regards to the command line client. Given the progress he's made
>> we
>> > > > think
>> > > > > > going ahead with his module makes the most sense.
>> > > > > >
>> > > > > > Cameron
>> > > > > >
>> > > > > >
>> > > > > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <
>> oh.younghyun2@gmail.com
>> > >
>> > > > > wrote:
>> > > > > >
>> > > > > > > Andy,
>> > > > > > >
>> > > > > > > Thank you for your comments. I've tried to apply what you
>> > addressed
>> > > > and
>> > > > > > > committed my module again. This module finds all openstack
>> > > > information
>> > > > > > > using OpenStack APIs and database. Thank you.
>> > > > > > >
>> > > > > > > Best regards,
>> > > > > > > Young-Hyun
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <
>> andy_kurth@ncsu.edu
>> > >
>> > > > > wrote:
>> > > > > > >
>> > > > > > > > Thanks Young. Looks good! If I understand correctly, you
>> are
>> > > > > avoiding
>> > > > > > > the
>> > > > > > > > need to use the CLI or cpan module by interacting directly
>> with
>> > > > > > OpenStack
>> > > > > > > > via the REST API?
>> > > > > > > >
>> > > > > > > > It looks like the only commands you're running on the
>> > management
>> > > > node
>> > > > > > are
>> > > > > > > > "nova" and "qemu-img" in _get_flavor_type. Would it be
>> > possible
>> > > to
>> > > > > > > > accomplish this via the API? I haven't traced through how
>> your
>> > > > code
>> > > > > > > works
>> > > > > > > > too deeply, but was wondering if the following could be used:
>> > > > > > > > http://docs.openstack.org/api/openstack
>> > > > > > > > -compute/2/content/Flavors-d1e4180.html
>> > > > > > > >
>> > > > > > > > It would be wonderful if you can eliminate the need for these
>> > to
>> > > be
>> > > > > > > > executed. This would mean a pure API solution with nothing
>> > > special
>> > > > > > > needing
>> > > > > > > > to be installed on the management node.
>> > > > > > > >
>> > > > > > > > If you do need to call these commands, instead of using qx
>> and
>> > > > > > backticks
>> > > > > > > > are used to run commands on the management node. Please
>> change
>> > > > this
>> > > > > to
>> > > > > > > > use:
>> > > > > > > > my ($exit_status, $output) = $self->mn_os->execute($command);
>> > > > > > > >
>> > > > > > > > Also, always, always, always make sure $output and anything
>> > else
>> > > > you
>> > > > > > try
>> > > > > > > to
>> > > > > > > > parse with a regex are defined first. This will avoid some
>> > nasty
>> > > > > "Use
>> > > > > > of
>> > > > > > > > uninitialized value in pattern match" errors which could
>> > > > potentially
>> > > > > > lead
>> > > > > > > > to the entire process dying.
>> > > > > > > >
>> > > > > > > > The indentation looks great! :) There are a few places
>> where
>> > > the
>> > > > > > curly
>> > > > > > > > bracket style could be modified. Just about all of the
>> > existing
>> > > > code
>> > > > > > > > places opening brackets on the same line as the while/for
>> > > statement
>> > > > > > such
>> > > > > > > > as:
>> > > > > > > > while ($loop > 0) {
>> > > > > > > > -instead of-
>> > > > > > > > while ($loop > 0)
>> > > > > > > > {
>> > > > > > > >
>> > > > > > > > Please add a pod "=head2 subroutine_name ... =cut" heading
>> for
>> > > > every
>> > > > > > > > subroutine. This is helpful for others to read/understand
>> your
>> > > > code.
>> > > > > > > The
>> > > > > > > > pod syntax can be a bit finicky. You can tell if it is
>> > formatted
>> > > > > > > properly
>> > > > > > > > by running "pod2text openstack.pm".
>> > > > > > > >
>> > > > > > > > Lastly (as mainly a reminder), we will need to incorporate
>> all
>> > of
>> > > > the
>> > > > > > > > database changes in vcl.sql and whatever method we use for
>> the
>> > > next
>> > > > > > > release
>> > > > > > > > to replace update-vcl.sql. I made a reminder comment here:
>> > > > > > > > https://issues.apache.org/jira/browse/VCL-764
>> > > > > > > >
>> > > > > > > > Regards,
>> > > > > > > > Andy
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
--
Aaron Peeler
Program Manager
Virtual Computing Lab
NC State University
All electronic mail messages in connection with State business which
are sent to or received by this account are subject to the NC Public
Records Law and may be disclosed to third parties.
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Yes, I agree with that. Especially, the detail information of images would
be very useful for qcow2 images due to the lack of metadata information.
And it would be helpful for migration. Thank you.
Best regards,
Young
On Wed, Jul 30, 2014 at 6:23 PM, Curtis <se...@gmail.com> wrote:
> Hi all,
>
> We found out today that windows images in openstack should have the
> glance os_type set to windows:
>
> http://docs.openstack.org/image-guide/content/windows-image.html
>
> So might not be a bad idea for the vcl openstack plugin to add that
> metadata if the image being created is a windows os.
>
> Thanks,
> Curtis.
>
> On Wed, Jul 23, 2014 at 8:35 PM, YOUNG OH <oh...@gmail.com> wrote:
> > Then option 2 sounds reasonable. Just warn and log if openstack gets
> > failed to delete the instance but continue to load a new instance. It
> seems
> > okay to me.
> >
> > Best regards,
> > Young
> >
> >
> > On Wed, Jul 23, 2014 at 12:38 PM, Cameron Mann <ca...@cybera.ca>
> > wrote:
> >
> >> The new instance that gets created is completely independent from the
> old
> >> one; both could remain powered on with no problems. OpenStack handles
> the
> >> IP addresses and if one is already in use it won't be assigned again.
> Just
> >> in case there's any confusion, the issue before was that the module was
> >> using looking up the instance using an identifier which wouldn't be
> unique
> >> between the new and old instances. Now that it's using a unique
> identifier
> >> it could never delete an instance and there'd never be a conflict
> barring a
> >> problem in OpenStack.
> >>
> >> Cameron
> >>
> >>
> >> On Wed, Jul 23, 2014 at 9:31 AM, Andy Kurth <an...@ncsu.edu>
> wrote:
> >>
> >> > Option 2 sounds reasonable as long as there is no possibility the VM
> >> which
> >> > could not be deleted can not cause conflicts with other VMs. The main
> >> > concern would be if the VM remained powered on with an IP address that
> >> > could be reused. Would this be possible? If you encounter a problem
> >> > deleting a VM, can you reliably verify that it is powered off?
> >> >
> >> > I think the priorities should be:
> >> > 1) avoid conflicts
> >> > 2) reduce reservation failures
> >> > 3) optimize load time
> >> >
> >> > Load time is important, but the deletion issue should really only
> affect
> >> > the user experience when the image requested is not preloaded. If VMs
> >> are
> >> > being reloaded for every reservation then there is another problem.
> >> >
> >> > -Andy
> >> >
> >> >
> >> >
> >> >
> >> > On Tue, Jul 22, 2014 at 3:37 PM, Cameron Mann <cameron.mann@cybera.ca
> >
> >> > wrote:
> >> >
> >> > > Agreed, this goes back to more general VCL behaviour so it would be
> >> good
> >> > to
> >> > > get others' input.
> >> > >
> >> > > Cameron
> >> > >
> >> > >
> >> > > On Tue, Jul 22, 2014 at 1:22 PM, YOUNG OH <oh...@gmail.com>
> >> > wrote:
> >> > >
> >> > > > That's great observation. I think option 1 and 2 can provide fast
> >> > loading
> >> > > > time due to no load failure. But, to avoid quota issues, an admin
> >> > should
> >> > > > periodically check the all the instances whether there are any
> >> > duplicate
> >> > > > instance names and defunct instances. The option 3 is safe but
> slow
> >> to
> >> > > load
> >> > > > if any deleting instance fails. I also agree that option 2 would
> be a
> >> > > good
> >> > > > choice because it can provide lower load time for end-users and
> also
> >> we
> >> > > > cannot exactly estimate the deletion time. But I hope to hear
> others'
> >> > > > thoughts.
> >> > > >
> >> > > > Best regards
> >> > > > Young
> >> > > >
> >> > > >
> >> > > > On Tue, Jul 22, 2014 at 2:46 PM, Cameron Mann <
> >> cameron.mann@cybera.ca>
> >> > > > wrote:
> >> > > >
> >> > > > > Looks good. Though I do wonder if it's necessary to fail the
> entire
> >> > > load
> >> > > > > process just because the old instance doesn't get deleted. I
> think
> >> > > > there's
> >> > > > > three possibilities:
> >> > > > >
> >> > > > > 1. Don't check for successful deletion; there won't be any
> >> conflicts
> >> > > > > because we're using openstackComputerMap. This would give the
> >> fastest
> >> > > > load
> >> > > > > times, but the only way to find out that something went wrong
> would
> >> > be
> >> > > to
> >> > > > > look at the list of instances and see if there are any duplicate
> >> > names.
> >> > > > > Could cause issues with quotas if running near capacity since
> there
> >> > > could
> >> > > > > be extra instances lying around.
> >> > > > >
> >> > > > > 2. Check for successful deletion, but only log the error, don't
> >> fail
> >> > > the
> >> > > > > load. Slower load times, but the load won't fail and the error
> will
> >> > be
> >> > > > > logged. Could cause issues with quotas if running near capacity
> >> since
> >> > > > there
> >> > > > > could be extra instances lying around.
> >> > > > >
> >> > > > > 3. What the module does now, check for successful deletion and
> fail
> >> > if
> >> > > > not.
> >> > > > > Least end user friendly since they might encounter failures, but
> >> the
> >> > > > safest
> >> > > > > option. Won't cause quota issues on it's own, though an admin
> could
> >> > > still
> >> > > > > change the computer back to available without deleting the
> defunct
> >> > > > > instance.
> >> > > > >
> >> > > > > Instance deletion time is also not very consistent in my
> >> experience;
> >> > > I've
> >> > > > > seen anything from seconds to over a minute and I imagine it
> could
> >> go
> >> > > > > higher on OpenStack systems that see heavier usage. If we stick
> >> with
> >> > > > option
> >> > > > > 3 I'd recommend bumping the timeout by another minute or two
> just
> >> to
> >> > be
> >> > > > > safe. I think it's less necessary for option 2 since it doesn't
> >> fail
> >> > on
> >> > > > > timeout.
> >> > > > >
> >> > > > > I took a look at some of the other provisioning modules to see
> what
> >> > > they
> >> > > > > do:
> >> > > > >
> >> > > > > - VMware logs a warning if it fails to delete the old VM, but
> only
> >> > > fails
> >> > > > if
> >> > > > > the VM is still responding to SSH
> >> > > > > - Libvirt fails if deletion fails
> >> > > > > - VirtualBox doesn't check for successful deletion, though it
> will
> >> > fail
> >> > > > if
> >> > > > > it can't find the old VM to delete
> >> > > > >
> >> > > > > I think options 2 or 3 would be most consistent with existing
> >> > > behaviour.
> >> > > > > I'd lean towards option 2 since end users won't see any extra
> >> > failures
> >> > > > and
> >> > > > > we can keep a lower timeout which will mean lower load times
> even
> >> if
> >> > a
> >> > > > > deletion takes a long time.
> >> > > > >
> >> > > > > What are you thoughts?
> >> > > > >
> >> > > > > Cameron
> >> > > > >
> >> > > > >
> >> > > > > On Tue, Jul 22, 2014 at 9:05 AM, YOUNG OH <
> oh.younghyun2@gmail.com
> >> >
> >> > > > wrote:
> >> > > > >
> >> > > > > > Cameron,
> >> > > > > >
> >> > > > > > Yes, you are definitely right. I was noticed that using
> hostname
> >> to
> >> > > > find
> >> > > > > > the openstack instance id is not working properly and also can
> >> > cause
> >> > > > the
> >> > > > > > problem you described. I've back to use the
> openstackComputerMap
> >> > > table
> >> > > > to
> >> > > > > > get_os_instance_id when the instance is pingable and also add
> a
> >> > loop
> >> > > in
> >> > > > > > _terminate_os_instance to check whether the instance is
> >> completely
> >> > > > > deleted
> >> > > > > > or not. Please take a look at it again and let me know if you
> >> have
> >> > > any
> >> > > > > > concerns. Thank you.
> >> > > > > >
> >> > > > > > Best regards,
> >> > > > > > Young
> >> > > > > >
> >> > > > > >
> >> > > > > > On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <
> >> > > cameron.mann@cybera.ca>
> >> > > > > > wrote:
> >> > > > > >
> >> > > > > > > Sounds like good progress to me. One comment though, it
> looks
> >> > like
> >> > > > > > > _terminate_os_instance does the DELETE request, checks the
> >> > response
> >> > > > for
> >> > > > > > > success and then sleeps for 30 seconds while the instance
> >> > deletes.
> >> > > > > > However,
> >> > > > > > > I don't believe a successful response to the DELETE request
> >> > > > guarantees
> >> > > > > > the
> >> > > > > > > instance will actually be deleted. I've run into situations
> >> where
> >> > > an
> >> > > > > > > instance gets stuck in the error or deleting states but the
> >> > command
> >> > > > > line
> >> > > > > > > client reports no errors when trying to delete it. This
> could
> >> > > result
> >> > > > > in a
> >> > > > > > > situation where multiple instances with the same name exist
> >> which
> >> > > > could
> >> > > > > > > cause _get_os_instance_id to return the wrong ID since it
> >> filters
> >> > > the
> >> > > > > > > instances based on name and selects the first in the list.
> >> > > > > > >
> >> > > > > > > I think either returning to using openstackComputerMap or
> >> looping
> >> > > > with
> >> > > > > a
> >> > > > > > > timeout until the instance is actually deleted would be
> better
> >> > > > choices.
> >> > > > > > The
> >> > > > > > > former would allow the new instance to be created even if
> the
> >> > > > deletion
> >> > > > > of
> >> > > > > > > the old one fails. The latter would put the computer in VCL
> >> into
> >> > an
> >> > > > > error
> >> > > > > > > state which would make it more obvious something has gone
> >> wrong,
> >> > > > though
> >> > > > > > at
> >> > > > > > > the cost of potentially failing a user's reservation. As an
> >> added
> >> > > > > > > precaution It might also be worth having _get_os_instance_id
> >> fail
> >> > > if
> >> > > > > > > there's more than one instance in the response.
> >> > > > > > >
> >> > > > > > > Cameron
> >> > > > > > >
> >> > > > > > >
> >> > > > > > > On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <
> >> > oh.younghyun2@gmail.com
> >> > > >
> >> > > > > > wrote:
> >> > > > > > >
> >> > > > > > > > Cameron,
> >> > > > > > > >
> >> > > > > > > > I hope you had a great time and welcome back to work :-).
> >> And,
> >> > > yes,
> >> > > > > the
> >> > > > > > > > OpenStack module with directly using OpenStack APIs can
> solve
> >> > the
> >> > > > > > > concerns
> >> > > > > > > > we've discussed and it's more flexible to apply new
> version
> >> of
> >> > > > > > OpenStack
> >> > > > > > > > APIs, if necessary. In the updated openstack module, I've
> >> > changed
> >> > > > the
> >> > > > > > two
> >> > > > > > > > main things. First, I've used the hostname in Computer
> table
> >> > > > (unique
> >> > > > > in
> >> > > > > > > the
> >> > > > > > > > same VCL database) to create an instance and get the
> instance
> >> > id
> >> > > to
> >> > > > > > > > terminate rather than using the openstackComputerMap
> table.
> >> > This
> >> > > > can
> >> > > > > > > avoid
> >> > > > > > > > using an additional table and database transactions.
> Second,
> >> > I've
> >> > > > > > changed
> >> > > > > > > > the openstackImageMap to openstackimagerevision table that
> >> maps
> >> > > the
> >> > > > > > > > imagerevision id with the openstack image id. This table
> >> > consists
> >> > > > of
> >> > > > > > > three
> >> > > > > > > > fields (imagerevisionid, imagedetails, flavordetails). The
> >> > > > > imagedetails
> >> > > > > > > and
> >> > > > > > > > flavordetails contains the details image and flavor
> >> information
> >> > > > with
> >> > > > > > json
> >> > > > > > > > format. Thus, when VCL creates an instance, it gets each
> >> detail
> >> > > > > > > information
> >> > > > > > > > and parse them to find the corresponding openstack image
> id
> >> and
> >> > > > > flavor
> >> > > > > > > id.
> >> > > > > > > > In addition, I've implemented the get_image_size()
> subroutine
> >> > > > because
> >> > > > > > the
> >> > > > > > > > image size information was not supported in OpenStack
> ESSEX
> >> but
> >> > > it
> >> > > > > > > supports
> >> > > > > > > > now. This is a short summary about the changes. So, if you
> >> have
> >> > > any
> >> > > > > > > concern
> >> > > > > > > > or questions about the updates, please let me know. Thank
> >> you.
> >> > > > > > > >
> >> > > > > > > > Best regards,
> >> > > > > > > > Young-Hyun
> >> > > > > > > >
> >> > > > > > > >
> >> > > > > > > > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <
> >> > > > > cameron.mann@cybera.ca
> >> > > > > > >
> >> > > > > > > > wrote:
> >> > > > > > > >
> >> > > > > > > > > Sorry for the silence from my end, I realized I forgot
> to
> >> > > > mention I
> >> > > > > > was
> >> > > > > > > > > going to be on vacation for the last week and a half.
> >> > Anyways,
> >> > > it
> >> > > > > > looks
> >> > > > > > > > > like Young's updates have addressed the main concerns we
> >> were
> >> > > > > having
> >> > > > > > > with
> >> > > > > > > > > regards to the command line client. Given the progress
> he's
> >> > > made
> >> > > > we
> >> > > > > > > think
> >> > > > > > > > > going ahead with his module makes the most sense.
> >> > > > > > > > >
> >> > > > > > > > > Cameron
> >> > > > > > > > >
> >> > > > > > > > >
> >> > > > > > > > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <
> >> > > > oh.younghyun2@gmail.com
> >> > > > > >
> >> > > > > > > > wrote:
> >> > > > > > > > >
> >> > > > > > > > > > Andy,
> >> > > > > > > > > >
> >> > > > > > > > > > Thank you for your comments. I've tried to apply what
> you
> >> > > > > addressed
> >> > > > > > > and
> >> > > > > > > > > > committed my module again. This module finds all
> >> openstack
> >> > > > > > > information
> >> > > > > > > > > > using OpenStack APIs and database. Thank you.
> >> > > > > > > > > >
> >> > > > > > > > > > Best regards,
> >> > > > > > > > > > Young-Hyun
> >> > > > > > > > > >
> >> > > > > > > > > >
> >> > > > > > > > > >
> >> > > > > > > > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <
> >> > > > andy_kurth@ncsu.edu
> >> > > > > >
> >> > > > > > > > wrote:
> >> > > > > > > > > >
> >> > > > > > > > > > > Thanks Young. Looks good! If I understand
> correctly,
> >> > you
> >> > > > are
> >> > > > > > > > avoiding
> >> > > > > > > > > > the
> >> > > > > > > > > > > need to use the CLI or cpan module by interacting
> >> > directly
> >> > > > with
> >> > > > > > > > > OpenStack
> >> > > > > > > > > > > via the REST API?
> >> > > > > > > > > > >
> >> > > > > > > > > > > It looks like the only commands you're running on
> the
> >> > > > > management
> >> > > > > > > node
> >> > > > > > > > > are
> >> > > > > > > > > > > "nova" and "qemu-img" in _get_flavor_type. Would
> it be
> >> > > > > possible
> >> > > > > > to
> >> > > > > > > > > > > accomplish this via the API? I haven't traced
> through
> >> > how
> >> > > > your
> >> > > > > > > code
> >> > > > > > > > > > works
> >> > > > > > > > > > > too deeply, but was wondering if the following
> could be
> >> > > used:
> >> > > > > > > > > > > http://docs.openstack.org/api/openstack
> >> > > > > > > > > > > -compute/2/content/Flavors-d1e4180.html
> >> > > > > > > > > > >
> >> > > > > > > > > > > It would be wonderful if you can eliminate the need
> for
> >> > > these
> >> > > > > to
> >> > > > > > be
> >> > > > > > > > > > > executed. This would mean a pure API solution with
> >> > nothing
> >> > > > > > special
> >> > > > > > > > > > needing
> >> > > > > > > > > > > to be installed on the management node.
> >> > > > > > > > > > >
> >> > > > > > > > > > > If you do need to call these commands, instead of
> using
> >> > qx
> >> > > > and
> >> > > > > > > > > backticks
> >> > > > > > > > > > > are used to run commands on the management node.
> >> Please
> >> > > > change
> >> > > > > > > this
> >> > > > > > > > to
> >> > > > > > > > > > > use:
> >> > > > > > > > > > > my ($exit_status, $output) =
> >> > > $self->mn_os->execute($command);
> >> > > > > > > > > > >
> >> > > > > > > > > > > Also, always, always, always make sure $output and
> >> > anything
> >> > > > > else
> >> > > > > > > you
> >> > > > > > > > > try
> >> > > > > > > > > > to
> >> > > > > > > > > > > parse with a regex are defined first. This will
> avoid
> >> > some
> >> > > > > nasty
> >> > > > > > > > "Use
> >> > > > > > > > > of
> >> > > > > > > > > > > uninitialized value in pattern match" errors which
> >> could
> >> > > > > > > potentially
> >> > > > > > > > > lead
> >> > > > > > > > > > > to the entire process dying.
> >> > > > > > > > > > >
> >> > > > > > > > > > > The indentation looks great! :) There are a few
> >> places
> >> > > > where
> >> > > > > > the
> >> > > > > > > > > curly
> >> > > > > > > > > > > bracket style could be modified. Just about all of
> the
> >> > > > > existing
> >> > > > > > > code
> >> > > > > > > > > > > places opening brackets on the same line as the
> >> while/for
> >> > > > > > statement
> >> > > > > > > > > such
> >> > > > > > > > > > > as:
> >> > > > > > > > > > > while ($loop > 0) {
> >> > > > > > > > > > > -instead of-
> >> > > > > > > > > > > while ($loop > 0)
> >> > > > > > > > > > > {
> >> > > > > > > > > > >
> >> > > > > > > > > > > Please add a pod "=head2 subroutine_name ... =cut"
> >> > heading
> >> > > > for
> >> > > > > > > every
> >> > > > > > > > > > > subroutine. This is helpful for others to
> >> > read/understand
> >> > > > your
> >> > > > > > > code.
> >> > > > > > > > > > The
> >> > > > > > > > > > > pod syntax can be a bit finicky. You can tell if
> it is
> >> > > > > formatted
> >> > > > > > > > > > properly
> >> > > > > > > > > > > by running "pod2text openstack.pm".
> >> > > > > > > > > > >
> >> > > > > > > > > > > Lastly (as mainly a reminder), we will need to
> >> > incorporate
> >> > > > all
> >> > > > > of
> >> > > > > > > the
> >> > > > > > > > > > > database changes in vcl.sql and whatever method we
> use
> >> > for
> >> > > > the
> >> > > > > > next
> >> > > > > > > > > > release
> >> > > > > > > > > > > to replace update-vcl.sql. I made a reminder
> comment
> >> > here:
> >> > > > > > > > > > > https://issues.apache.org/jira/browse/VCL-764
> >> > > > > > > > > > >
> >> > > > > > > > > > > Regards,
> >> > > > > > > > > > > Andy
> >> > > > > > > > > > >
> >> > > > > > > > > >
> >> > > > > > > > >
> >> > > > > > > >
> >> > > > > > >
> >> > > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
>
>
>
> --
> Twitter: @serverascode
> Blog: serverascode.com
>
Re: OpenStack Module
Posted by Curtis <se...@gmail.com>.
Hi all,
We found out today that windows images in openstack should have the
glance os_type set to windows:
http://docs.openstack.org/image-guide/content/windows-image.html
So might not be a bad idea for the vcl openstack plugin to add that
metadata if the image being created is a windows os.
Thanks,
Curtis.
On Wed, Jul 23, 2014 at 8:35 PM, YOUNG OH <oh...@gmail.com> wrote:
> Then option 2 sounds reasonable. Just warn and log if openstack gets
> failed to delete the instance but continue to load a new instance. It seems
> okay to me.
>
> Best regards,
> Young
>
>
> On Wed, Jul 23, 2014 at 12:38 PM, Cameron Mann <ca...@cybera.ca>
> wrote:
>
>> The new instance that gets created is completely independent from the old
>> one; both could remain powered on with no problems. OpenStack handles the
>> IP addresses and if one is already in use it won't be assigned again. Just
>> in case there's any confusion, the issue before was that the module was
>> using looking up the instance using an identifier which wouldn't be unique
>> between the new and old instances. Now that it's using a unique identifier
>> it could never delete an instance and there'd never be a conflict barring a
>> problem in OpenStack.
>>
>> Cameron
>>
>>
>> On Wed, Jul 23, 2014 at 9:31 AM, Andy Kurth <an...@ncsu.edu> wrote:
>>
>> > Option 2 sounds reasonable as long as there is no possibility the VM
>> which
>> > could not be deleted can not cause conflicts with other VMs. The main
>> > concern would be if the VM remained powered on with an IP address that
>> > could be reused. Would this be possible? If you encounter a problem
>> > deleting a VM, can you reliably verify that it is powered off?
>> >
>> > I think the priorities should be:
>> > 1) avoid conflicts
>> > 2) reduce reservation failures
>> > 3) optimize load time
>> >
>> > Load time is important, but the deletion issue should really only affect
>> > the user experience when the image requested is not preloaded. If VMs
>> are
>> > being reloaded for every reservation then there is another problem.
>> >
>> > -Andy
>> >
>> >
>> >
>> >
>> > On Tue, Jul 22, 2014 at 3:37 PM, Cameron Mann <ca...@cybera.ca>
>> > wrote:
>> >
>> > > Agreed, this goes back to more general VCL behaviour so it would be
>> good
>> > to
>> > > get others' input.
>> > >
>> > > Cameron
>> > >
>> > >
>> > > On Tue, Jul 22, 2014 at 1:22 PM, YOUNG OH <oh...@gmail.com>
>> > wrote:
>> > >
>> > > > That's great observation. I think option 1 and 2 can provide fast
>> > loading
>> > > > time due to no load failure. But, to avoid quota issues, an admin
>> > should
>> > > > periodically check the all the instances whether there are any
>> > duplicate
>> > > > instance names and defunct instances. The option 3 is safe but slow
>> to
>> > > load
>> > > > if any deleting instance fails. I also agree that option 2 would be a
>> > > good
>> > > > choice because it can provide lower load time for end-users and also
>> we
>> > > > cannot exactly estimate the deletion time. But I hope to hear others'
>> > > > thoughts.
>> > > >
>> > > > Best regards
>> > > > Young
>> > > >
>> > > >
>> > > > On Tue, Jul 22, 2014 at 2:46 PM, Cameron Mann <
>> cameron.mann@cybera.ca>
>> > > > wrote:
>> > > >
>> > > > > Looks good. Though I do wonder if it's necessary to fail the entire
>> > > load
>> > > > > process just because the old instance doesn't get deleted. I think
>> > > > there's
>> > > > > three possibilities:
>> > > > >
>> > > > > 1. Don't check for successful deletion; there won't be any
>> conflicts
>> > > > > because we're using openstackComputerMap. This would give the
>> fastest
>> > > > load
>> > > > > times, but the only way to find out that something went wrong would
>> > be
>> > > to
>> > > > > look at the list of instances and see if there are any duplicate
>> > names.
>> > > > > Could cause issues with quotas if running near capacity since there
>> > > could
>> > > > > be extra instances lying around.
>> > > > >
>> > > > > 2. Check for successful deletion, but only log the error, don't
>> fail
>> > > the
>> > > > > load. Slower load times, but the load won't fail and the error will
>> > be
>> > > > > logged. Could cause issues with quotas if running near capacity
>> since
>> > > > there
>> > > > > could be extra instances lying around.
>> > > > >
>> > > > > 3. What the module does now, check for successful deletion and fail
>> > if
>> > > > not.
>> > > > > Least end user friendly since they might encounter failures, but
>> the
>> > > > safest
>> > > > > option. Won't cause quota issues on it's own, though an admin could
>> > > still
>> > > > > change the computer back to available without deleting the defunct
>> > > > > instance.
>> > > > >
>> > > > > Instance deletion time is also not very consistent in my
>> experience;
>> > > I've
>> > > > > seen anything from seconds to over a minute and I imagine it could
>> go
>> > > > > higher on OpenStack systems that see heavier usage. If we stick
>> with
>> > > > option
>> > > > > 3 I'd recommend bumping the timeout by another minute or two just
>> to
>> > be
>> > > > > safe. I think it's less necessary for option 2 since it doesn't
>> fail
>> > on
>> > > > > timeout.
>> > > > >
>> > > > > I took a look at some of the other provisioning modules to see what
>> > > they
>> > > > > do:
>> > > > >
>> > > > > - VMware logs a warning if it fails to delete the old VM, but only
>> > > fails
>> > > > if
>> > > > > the VM is still responding to SSH
>> > > > > - Libvirt fails if deletion fails
>> > > > > - VirtualBox doesn't check for successful deletion, though it will
>> > fail
>> > > > if
>> > > > > it can't find the old VM to delete
>> > > > >
>> > > > > I think options 2 or 3 would be most consistent with existing
>> > > behaviour.
>> > > > > I'd lean towards option 2 since end users won't see any extra
>> > failures
>> > > > and
>> > > > > we can keep a lower timeout which will mean lower load times even
>> if
>> > a
>> > > > > deletion takes a long time.
>> > > > >
>> > > > > What are you thoughts?
>> > > > >
>> > > > > Cameron
>> > > > >
>> > > > >
>> > > > > On Tue, Jul 22, 2014 at 9:05 AM, YOUNG OH <oh.younghyun2@gmail.com
>> >
>> > > > wrote:
>> > > > >
>> > > > > > Cameron,
>> > > > > >
>> > > > > > Yes, you are definitely right. I was noticed that using hostname
>> to
>> > > > find
>> > > > > > the openstack instance id is not working properly and also can
>> > cause
>> > > > the
>> > > > > > problem you described. I've back to use the openstackComputerMap
>> > > table
>> > > > to
>> > > > > > get_os_instance_id when the instance is pingable and also add a
>> > loop
>> > > in
>> > > > > > _terminate_os_instance to check whether the instance is
>> completely
>> > > > > deleted
>> > > > > > or not. Please take a look at it again and let me know if you
>> have
>> > > any
>> > > > > > concerns. Thank you.
>> > > > > >
>> > > > > > Best regards,
>> > > > > > Young
>> > > > > >
>> > > > > >
>> > > > > > On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <
>> > > cameron.mann@cybera.ca>
>> > > > > > wrote:
>> > > > > >
>> > > > > > > Sounds like good progress to me. One comment though, it looks
>> > like
>> > > > > > > _terminate_os_instance does the DELETE request, checks the
>> > response
>> > > > for
>> > > > > > > success and then sleeps for 30 seconds while the instance
>> > deletes.
>> > > > > > However,
>> > > > > > > I don't believe a successful response to the DELETE request
>> > > > guarantees
>> > > > > > the
>> > > > > > > instance will actually be deleted. I've run into situations
>> where
>> > > an
>> > > > > > > instance gets stuck in the error or deleting states but the
>> > command
>> > > > > line
>> > > > > > > client reports no errors when trying to delete it. This could
>> > > result
>> > > > > in a
>> > > > > > > situation where multiple instances with the same name exist
>> which
>> > > > could
>> > > > > > > cause _get_os_instance_id to return the wrong ID since it
>> filters
>> > > the
>> > > > > > > instances based on name and selects the first in the list.
>> > > > > > >
>> > > > > > > I think either returning to using openstackComputerMap or
>> looping
>> > > > with
>> > > > > a
>> > > > > > > timeout until the instance is actually deleted would be better
>> > > > choices.
>> > > > > > The
>> > > > > > > former would allow the new instance to be created even if the
>> > > > deletion
>> > > > > of
>> > > > > > > the old one fails. The latter would put the computer in VCL
>> into
>> > an
>> > > > > error
>> > > > > > > state which would make it more obvious something has gone
>> wrong,
>> > > > though
>> > > > > > at
>> > > > > > > the cost of potentially failing a user's reservation. As an
>> added
>> > > > > > > precaution It might also be worth having _get_os_instance_id
>> fail
>> > > if
>> > > > > > > there's more than one instance in the response.
>> > > > > > >
>> > > > > > > Cameron
>> > > > > > >
>> > > > > > >
>> > > > > > > On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <
>> > oh.younghyun2@gmail.com
>> > > >
>> > > > > > wrote:
>> > > > > > >
>> > > > > > > > Cameron,
>> > > > > > > >
>> > > > > > > > I hope you had a great time and welcome back to work :-).
>> And,
>> > > yes,
>> > > > > the
>> > > > > > > > OpenStack module with directly using OpenStack APIs can solve
>> > the
>> > > > > > > concerns
>> > > > > > > > we've discussed and it's more flexible to apply new version
>> of
>> > > > > > OpenStack
>> > > > > > > > APIs, if necessary. In the updated openstack module, I've
>> > changed
>> > > > the
>> > > > > > two
>> > > > > > > > main things. First, I've used the hostname in Computer table
>> > > > (unique
>> > > > > in
>> > > > > > > the
>> > > > > > > > same VCL database) to create an instance and get the instance
>> > id
>> > > to
>> > > > > > > > terminate rather than using the openstackComputerMap table.
>> > This
>> > > > can
>> > > > > > > avoid
>> > > > > > > > using an additional table and database transactions. Second,
>> > I've
>> > > > > > changed
>> > > > > > > > the openstackImageMap to openstackimagerevision table that
>> maps
>> > > the
>> > > > > > > > imagerevision id with the openstack image id. This table
>> > consists
>> > > > of
>> > > > > > > three
>> > > > > > > > fields (imagerevisionid, imagedetails, flavordetails). The
>> > > > > imagedetails
>> > > > > > > and
>> > > > > > > > flavordetails contains the details image and flavor
>> information
>> > > > with
>> > > > > > json
>> > > > > > > > format. Thus, when VCL creates an instance, it gets each
>> detail
>> > > > > > > information
>> > > > > > > > and parse them to find the corresponding openstack image id
>> and
>> > > > > flavor
>> > > > > > > id.
>> > > > > > > > In addition, I've implemented the get_image_size() subroutine
>> > > > because
>> > > > > > the
>> > > > > > > > image size information was not supported in OpenStack ESSEX
>> but
>> > > it
>> > > > > > > supports
>> > > > > > > > now. This is a short summary about the changes. So, if you
>> have
>> > > any
>> > > > > > > concern
>> > > > > > > > or questions about the updates, please let me know. Thank
>> you.
>> > > > > > > >
>> > > > > > > > Best regards,
>> > > > > > > > Young-Hyun
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <
>> > > > > cameron.mann@cybera.ca
>> > > > > > >
>> > > > > > > > wrote:
>> > > > > > > >
>> > > > > > > > > Sorry for the silence from my end, I realized I forgot to
>> > > > mention I
>> > > > > > was
>> > > > > > > > > going to be on vacation for the last week and a half.
>> > Anyways,
>> > > it
>> > > > > > looks
>> > > > > > > > > like Young's updates have addressed the main concerns we
>> were
>> > > > > having
>> > > > > > > with
>> > > > > > > > > regards to the command line client. Given the progress he's
>> > > made
>> > > > we
>> > > > > > > think
>> > > > > > > > > going ahead with his module makes the most sense.
>> > > > > > > > >
>> > > > > > > > > Cameron
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <
>> > > > oh.younghyun2@gmail.com
>> > > > > >
>> > > > > > > > wrote:
>> > > > > > > > >
>> > > > > > > > > > Andy,
>> > > > > > > > > >
>> > > > > > > > > > Thank you for your comments. I've tried to apply what you
>> > > > > addressed
>> > > > > > > and
>> > > > > > > > > > committed my module again. This module finds all
>> openstack
>> > > > > > > information
>> > > > > > > > > > using OpenStack APIs and database. Thank you.
>> > > > > > > > > >
>> > > > > > > > > > Best regards,
>> > > > > > > > > > Young-Hyun
>> > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <
>> > > > andy_kurth@ncsu.edu
>> > > > > >
>> > > > > > > > wrote:
>> > > > > > > > > >
>> > > > > > > > > > > Thanks Young. Looks good! If I understand correctly,
>> > you
>> > > > are
>> > > > > > > > avoiding
>> > > > > > > > > > the
>> > > > > > > > > > > need to use the CLI or cpan module by interacting
>> > directly
>> > > > with
>> > > > > > > > > OpenStack
>> > > > > > > > > > > via the REST API?
>> > > > > > > > > > >
>> > > > > > > > > > > It looks like the only commands you're running on the
>> > > > > management
>> > > > > > > node
>> > > > > > > > > are
>> > > > > > > > > > > "nova" and "qemu-img" in _get_flavor_type. Would it be
>> > > > > possible
>> > > > > > to
>> > > > > > > > > > > accomplish this via the API? I haven't traced through
>> > how
>> > > > your
>> > > > > > > code
>> > > > > > > > > > works
>> > > > > > > > > > > too deeply, but was wondering if the following could be
>> > > used:
>> > > > > > > > > > > http://docs.openstack.org/api/openstack
>> > > > > > > > > > > -compute/2/content/Flavors-d1e4180.html
>> > > > > > > > > > >
>> > > > > > > > > > > It would be wonderful if you can eliminate the need for
>> > > these
>> > > > > to
>> > > > > > be
>> > > > > > > > > > > executed. This would mean a pure API solution with
>> > nothing
>> > > > > > special
>> > > > > > > > > > needing
>> > > > > > > > > > > to be installed on the management node.
>> > > > > > > > > > >
>> > > > > > > > > > > If you do need to call these commands, instead of using
>> > qx
>> > > > and
>> > > > > > > > > backticks
>> > > > > > > > > > > are used to run commands on the management node.
>> Please
>> > > > change
>> > > > > > > this
>> > > > > > > > to
>> > > > > > > > > > > use:
>> > > > > > > > > > > my ($exit_status, $output) =
>> > > $self->mn_os->execute($command);
>> > > > > > > > > > >
>> > > > > > > > > > > Also, always, always, always make sure $output and
>> > anything
>> > > > > else
>> > > > > > > you
>> > > > > > > > > try
>> > > > > > > > > > to
>> > > > > > > > > > > parse with a regex are defined first. This will avoid
>> > some
>> > > > > nasty
>> > > > > > > > "Use
>> > > > > > > > > of
>> > > > > > > > > > > uninitialized value in pattern match" errors which
>> could
>> > > > > > > potentially
>> > > > > > > > > lead
>> > > > > > > > > > > to the entire process dying.
>> > > > > > > > > > >
>> > > > > > > > > > > The indentation looks great! :) There are a few
>> places
>> > > > where
>> > > > > > the
>> > > > > > > > > curly
>> > > > > > > > > > > bracket style could be modified. Just about all of the
>> > > > > existing
>> > > > > > > code
>> > > > > > > > > > > places opening brackets on the same line as the
>> while/for
>> > > > > > statement
>> > > > > > > > > such
>> > > > > > > > > > > as:
>> > > > > > > > > > > while ($loop > 0) {
>> > > > > > > > > > > -instead of-
>> > > > > > > > > > > while ($loop > 0)
>> > > > > > > > > > > {
>> > > > > > > > > > >
>> > > > > > > > > > > Please add a pod "=head2 subroutine_name ... =cut"
>> > heading
>> > > > for
>> > > > > > > every
>> > > > > > > > > > > subroutine. This is helpful for others to
>> > read/understand
>> > > > your
>> > > > > > > code.
>> > > > > > > > > > The
>> > > > > > > > > > > pod syntax can be a bit finicky. You can tell if it is
>> > > > > formatted
>> > > > > > > > > > properly
>> > > > > > > > > > > by running "pod2text openstack.pm".
>> > > > > > > > > > >
>> > > > > > > > > > > Lastly (as mainly a reminder), we will need to
>> > incorporate
>> > > > all
>> > > > > of
>> > > > > > > the
>> > > > > > > > > > > database changes in vcl.sql and whatever method we use
>> > for
>> > > > the
>> > > > > > next
>> > > > > > > > > > release
>> > > > > > > > > > > to replace update-vcl.sql. I made a reminder comment
>> > here:
>> > > > > > > > > > > https://issues.apache.org/jira/browse/VCL-764
>> > > > > > > > > > >
>> > > > > > > > > > > Regards,
>> > > > > > > > > > > Andy
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
--
Twitter: @serverascode
Blog: serverascode.com
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Then option 2 sounds reasonable. Just warn and log if openstack gets
failed to delete the instance but continue to load a new instance. It seems
okay to me.
Best regards,
Young
On Wed, Jul 23, 2014 at 12:38 PM, Cameron Mann <ca...@cybera.ca>
wrote:
> The new instance that gets created is completely independent from the old
> one; both could remain powered on with no problems. OpenStack handles the
> IP addresses and if one is already in use it won't be assigned again. Just
> in case there's any confusion, the issue before was that the module was
> using looking up the instance using an identifier which wouldn't be unique
> between the new and old instances. Now that it's using a unique identifier
> it could never delete an instance and there'd never be a conflict barring a
> problem in OpenStack.
>
> Cameron
>
>
> On Wed, Jul 23, 2014 at 9:31 AM, Andy Kurth <an...@ncsu.edu> wrote:
>
> > Option 2 sounds reasonable as long as there is no possibility the VM
> which
> > could not be deleted can not cause conflicts with other VMs. The main
> > concern would be if the VM remained powered on with an IP address that
> > could be reused. Would this be possible? If you encounter a problem
> > deleting a VM, can you reliably verify that it is powered off?
> >
> > I think the priorities should be:
> > 1) avoid conflicts
> > 2) reduce reservation failures
> > 3) optimize load time
> >
> > Load time is important, but the deletion issue should really only affect
> > the user experience when the image requested is not preloaded. If VMs
> are
> > being reloaded for every reservation then there is another problem.
> >
> > -Andy
> >
> >
> >
> >
> > On Tue, Jul 22, 2014 at 3:37 PM, Cameron Mann <ca...@cybera.ca>
> > wrote:
> >
> > > Agreed, this goes back to more general VCL behaviour so it would be
> good
> > to
> > > get others' input.
> > >
> > > Cameron
> > >
> > >
> > > On Tue, Jul 22, 2014 at 1:22 PM, YOUNG OH <oh...@gmail.com>
> > wrote:
> > >
> > > > That's great observation. I think option 1 and 2 can provide fast
> > loading
> > > > time due to no load failure. But, to avoid quota issues, an admin
> > should
> > > > periodically check the all the instances whether there are any
> > duplicate
> > > > instance names and defunct instances. The option 3 is safe but slow
> to
> > > load
> > > > if any deleting instance fails. I also agree that option 2 would be a
> > > good
> > > > choice because it can provide lower load time for end-users and also
> we
> > > > cannot exactly estimate the deletion time. But I hope to hear others'
> > > > thoughts.
> > > >
> > > > Best regards
> > > > Young
> > > >
> > > >
> > > > On Tue, Jul 22, 2014 at 2:46 PM, Cameron Mann <
> cameron.mann@cybera.ca>
> > > > wrote:
> > > >
> > > > > Looks good. Though I do wonder if it's necessary to fail the entire
> > > load
> > > > > process just because the old instance doesn't get deleted. I think
> > > > there's
> > > > > three possibilities:
> > > > >
> > > > > 1. Don't check for successful deletion; there won't be any
> conflicts
> > > > > because we're using openstackComputerMap. This would give the
> fastest
> > > > load
> > > > > times, but the only way to find out that something went wrong would
> > be
> > > to
> > > > > look at the list of instances and see if there are any duplicate
> > names.
> > > > > Could cause issues with quotas if running near capacity since there
> > > could
> > > > > be extra instances lying around.
> > > > >
> > > > > 2. Check for successful deletion, but only log the error, don't
> fail
> > > the
> > > > > load. Slower load times, but the load won't fail and the error will
> > be
> > > > > logged. Could cause issues with quotas if running near capacity
> since
> > > > there
> > > > > could be extra instances lying around.
> > > > >
> > > > > 3. What the module does now, check for successful deletion and fail
> > if
> > > > not.
> > > > > Least end user friendly since they might encounter failures, but
> the
> > > > safest
> > > > > option. Won't cause quota issues on it's own, though an admin could
> > > still
> > > > > change the computer back to available without deleting the defunct
> > > > > instance.
> > > > >
> > > > > Instance deletion time is also not very consistent in my
> experience;
> > > I've
> > > > > seen anything from seconds to over a minute and I imagine it could
> go
> > > > > higher on OpenStack systems that see heavier usage. If we stick
> with
> > > > option
> > > > > 3 I'd recommend bumping the timeout by another minute or two just
> to
> > be
> > > > > safe. I think it's less necessary for option 2 since it doesn't
> fail
> > on
> > > > > timeout.
> > > > >
> > > > > I took a look at some of the other provisioning modules to see what
> > > they
> > > > > do:
> > > > >
> > > > > - VMware logs a warning if it fails to delete the old VM, but only
> > > fails
> > > > if
> > > > > the VM is still responding to SSH
> > > > > - Libvirt fails if deletion fails
> > > > > - VirtualBox doesn't check for successful deletion, though it will
> > fail
> > > > if
> > > > > it can't find the old VM to delete
> > > > >
> > > > > I think options 2 or 3 would be most consistent with existing
> > > behaviour.
> > > > > I'd lean towards option 2 since end users won't see any extra
> > failures
> > > > and
> > > > > we can keep a lower timeout which will mean lower load times even
> if
> > a
> > > > > deletion takes a long time.
> > > > >
> > > > > What are you thoughts?
> > > > >
> > > > > Cameron
> > > > >
> > > > >
> > > > > On Tue, Jul 22, 2014 at 9:05 AM, YOUNG OH <oh.younghyun2@gmail.com
> >
> > > > wrote:
> > > > >
> > > > > > Cameron,
> > > > > >
> > > > > > Yes, you are definitely right. I was noticed that using hostname
> to
> > > > find
> > > > > > the openstack instance id is not working properly and also can
> > cause
> > > > the
> > > > > > problem you described. I've back to use the openstackComputerMap
> > > table
> > > > to
> > > > > > get_os_instance_id when the instance is pingable and also add a
> > loop
> > > in
> > > > > > _terminate_os_instance to check whether the instance is
> completely
> > > > > deleted
> > > > > > or not. Please take a look at it again and let me know if you
> have
> > > any
> > > > > > concerns. Thank you.
> > > > > >
> > > > > > Best regards,
> > > > > > Young
> > > > > >
> > > > > >
> > > > > > On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <
> > > cameron.mann@cybera.ca>
> > > > > > wrote:
> > > > > >
> > > > > > > Sounds like good progress to me. One comment though, it looks
> > like
> > > > > > > _terminate_os_instance does the DELETE request, checks the
> > response
> > > > for
> > > > > > > success and then sleeps for 30 seconds while the instance
> > deletes.
> > > > > > However,
> > > > > > > I don't believe a successful response to the DELETE request
> > > > guarantees
> > > > > > the
> > > > > > > instance will actually be deleted. I've run into situations
> where
> > > an
> > > > > > > instance gets stuck in the error or deleting states but the
> > command
> > > > > line
> > > > > > > client reports no errors when trying to delete it. This could
> > > result
> > > > > in a
> > > > > > > situation where multiple instances with the same name exist
> which
> > > > could
> > > > > > > cause _get_os_instance_id to return the wrong ID since it
> filters
> > > the
> > > > > > > instances based on name and selects the first in the list.
> > > > > > >
> > > > > > > I think either returning to using openstackComputerMap or
> looping
> > > > with
> > > > > a
> > > > > > > timeout until the instance is actually deleted would be better
> > > > choices.
> > > > > > The
> > > > > > > former would allow the new instance to be created even if the
> > > > deletion
> > > > > of
> > > > > > > the old one fails. The latter would put the computer in VCL
> into
> > an
> > > > > error
> > > > > > > state which would make it more obvious something has gone
> wrong,
> > > > though
> > > > > > at
> > > > > > > the cost of potentially failing a user's reservation. As an
> added
> > > > > > > precaution It might also be worth having _get_os_instance_id
> fail
> > > if
> > > > > > > there's more than one instance in the response.
> > > > > > >
> > > > > > > Cameron
> > > > > > >
> > > > > > >
> > > > > > > On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <
> > oh.younghyun2@gmail.com
> > > >
> > > > > > wrote:
> > > > > > >
> > > > > > > > Cameron,
> > > > > > > >
> > > > > > > > I hope you had a great time and welcome back to work :-).
> And,
> > > yes,
> > > > > the
> > > > > > > > OpenStack module with directly using OpenStack APIs can solve
> > the
> > > > > > > concerns
> > > > > > > > we've discussed and it's more flexible to apply new version
> of
> > > > > > OpenStack
> > > > > > > > APIs, if necessary. In the updated openstack module, I've
> > changed
> > > > the
> > > > > > two
> > > > > > > > main things. First, I've used the hostname in Computer table
> > > > (unique
> > > > > in
> > > > > > > the
> > > > > > > > same VCL database) to create an instance and get the instance
> > id
> > > to
> > > > > > > > terminate rather than using the openstackComputerMap table.
> > This
> > > > can
> > > > > > > avoid
> > > > > > > > using an additional table and database transactions. Second,
> > I've
> > > > > > changed
> > > > > > > > the openstackImageMap to openstackimagerevision table that
> maps
> > > the
> > > > > > > > imagerevision id with the openstack image id. This table
> > consists
> > > > of
> > > > > > > three
> > > > > > > > fields (imagerevisionid, imagedetails, flavordetails). The
> > > > > imagedetails
> > > > > > > and
> > > > > > > > flavordetails contains the details image and flavor
> information
> > > > with
> > > > > > json
> > > > > > > > format. Thus, when VCL creates an instance, it gets each
> detail
> > > > > > > information
> > > > > > > > and parse them to find the corresponding openstack image id
> and
> > > > > flavor
> > > > > > > id.
> > > > > > > > In addition, I've implemented the get_image_size() subroutine
> > > > because
> > > > > > the
> > > > > > > > image size information was not supported in OpenStack ESSEX
> but
> > > it
> > > > > > > supports
> > > > > > > > now. This is a short summary about the changes. So, if you
> have
> > > any
> > > > > > > concern
> > > > > > > > or questions about the updates, please let me know. Thank
> you.
> > > > > > > >
> > > > > > > > Best regards,
> > > > > > > > Young-Hyun
> > > > > > > >
> > > > > > > >
> > > > > > > > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <
> > > > > cameron.mann@cybera.ca
> > > > > > >
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Sorry for the silence from my end, I realized I forgot to
> > > > mention I
> > > > > > was
> > > > > > > > > going to be on vacation for the last week and a half.
> > Anyways,
> > > it
> > > > > > looks
> > > > > > > > > like Young's updates have addressed the main concerns we
> were
> > > > > having
> > > > > > > with
> > > > > > > > > regards to the command line client. Given the progress he's
> > > made
> > > > we
> > > > > > > think
> > > > > > > > > going ahead with his module makes the most sense.
> > > > > > > > >
> > > > > > > > > Cameron
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <
> > > > oh.younghyun2@gmail.com
> > > > > >
> > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Andy,
> > > > > > > > > >
> > > > > > > > > > Thank you for your comments. I've tried to apply what you
> > > > > addressed
> > > > > > > and
> > > > > > > > > > committed my module again. This module finds all
> openstack
> > > > > > > information
> > > > > > > > > > using OpenStack APIs and database. Thank you.
> > > > > > > > > >
> > > > > > > > > > Best regards,
> > > > > > > > > > Young-Hyun
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <
> > > > andy_kurth@ncsu.edu
> > > > > >
> > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Thanks Young. Looks good! If I understand correctly,
> > you
> > > > are
> > > > > > > > avoiding
> > > > > > > > > > the
> > > > > > > > > > > need to use the CLI or cpan module by interacting
> > directly
> > > > with
> > > > > > > > > OpenStack
> > > > > > > > > > > via the REST API?
> > > > > > > > > > >
> > > > > > > > > > > It looks like the only commands you're running on the
> > > > > management
> > > > > > > node
> > > > > > > > > are
> > > > > > > > > > > "nova" and "qemu-img" in _get_flavor_type. Would it be
> > > > > possible
> > > > > > to
> > > > > > > > > > > accomplish this via the API? I haven't traced through
> > how
> > > > your
> > > > > > > code
> > > > > > > > > > works
> > > > > > > > > > > too deeply, but was wondering if the following could be
> > > used:
> > > > > > > > > > > http://docs.openstack.org/api/openstack
> > > > > > > > > > > -compute/2/content/Flavors-d1e4180.html
> > > > > > > > > > >
> > > > > > > > > > > It would be wonderful if you can eliminate the need for
> > > these
> > > > > to
> > > > > > be
> > > > > > > > > > > executed. This would mean a pure API solution with
> > nothing
> > > > > > special
> > > > > > > > > > needing
> > > > > > > > > > > to be installed on the management node.
> > > > > > > > > > >
> > > > > > > > > > > If you do need to call these commands, instead of using
> > qx
> > > > and
> > > > > > > > > backticks
> > > > > > > > > > > are used to run commands on the management node.
> Please
> > > > change
> > > > > > > this
> > > > > > > > to
> > > > > > > > > > > use:
> > > > > > > > > > > my ($exit_status, $output) =
> > > $self->mn_os->execute($command);
> > > > > > > > > > >
> > > > > > > > > > > Also, always, always, always make sure $output and
> > anything
> > > > > else
> > > > > > > you
> > > > > > > > > try
> > > > > > > > > > to
> > > > > > > > > > > parse with a regex are defined first. This will avoid
> > some
> > > > > nasty
> > > > > > > > "Use
> > > > > > > > > of
> > > > > > > > > > > uninitialized value in pattern match" errors which
> could
> > > > > > > potentially
> > > > > > > > > lead
> > > > > > > > > > > to the entire process dying.
> > > > > > > > > > >
> > > > > > > > > > > The indentation looks great! :) There are a few
> places
> > > > where
> > > > > > the
> > > > > > > > > curly
> > > > > > > > > > > bracket style could be modified. Just about all of the
> > > > > existing
> > > > > > > code
> > > > > > > > > > > places opening brackets on the same line as the
> while/for
> > > > > > statement
> > > > > > > > > such
> > > > > > > > > > > as:
> > > > > > > > > > > while ($loop > 0) {
> > > > > > > > > > > -instead of-
> > > > > > > > > > > while ($loop > 0)
> > > > > > > > > > > {
> > > > > > > > > > >
> > > > > > > > > > > Please add a pod "=head2 subroutine_name ... =cut"
> > heading
> > > > for
> > > > > > > every
> > > > > > > > > > > subroutine. This is helpful for others to
> > read/understand
> > > > your
> > > > > > > code.
> > > > > > > > > > The
> > > > > > > > > > > pod syntax can be a bit finicky. You can tell if it is
> > > > > formatted
> > > > > > > > > > properly
> > > > > > > > > > > by running "pod2text openstack.pm".
> > > > > > > > > > >
> > > > > > > > > > > Lastly (as mainly a reminder), we will need to
> > incorporate
> > > > all
> > > > > of
> > > > > > > the
> > > > > > > > > > > database changes in vcl.sql and whatever method we use
> > for
> > > > the
> > > > > > next
> > > > > > > > > > release
> > > > > > > > > > > to replace update-vcl.sql. I made a reminder comment
> > here:
> > > > > > > > > > > https://issues.apache.org/jira/browse/VCL-764
> > > > > > > > > > >
> > > > > > > > > > > Regards,
> > > > > > > > > > > Andy
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: OpenStack Module
Posted by Cameron Mann <ca...@cybera.ca>.
The new instance that gets created is completely independent from the old
one; both could remain powered on with no problems. OpenStack handles the
IP addresses and if one is already in use it won't be assigned again. Just
in case there's any confusion, the issue before was that the module was
using looking up the instance using an identifier which wouldn't be unique
between the new and old instances. Now that it's using a unique identifier
it could never delete an instance and there'd never be a conflict barring a
problem in OpenStack.
Cameron
On Wed, Jul 23, 2014 at 9:31 AM, Andy Kurth <an...@ncsu.edu> wrote:
> Option 2 sounds reasonable as long as there is no possibility the VM which
> could not be deleted can not cause conflicts with other VMs. The main
> concern would be if the VM remained powered on with an IP address that
> could be reused. Would this be possible? If you encounter a problem
> deleting a VM, can you reliably verify that it is powered off?
>
> I think the priorities should be:
> 1) avoid conflicts
> 2) reduce reservation failures
> 3) optimize load time
>
> Load time is important, but the deletion issue should really only affect
> the user experience when the image requested is not preloaded. If VMs are
> being reloaded for every reservation then there is another problem.
>
> -Andy
>
>
>
>
> On Tue, Jul 22, 2014 at 3:37 PM, Cameron Mann <ca...@cybera.ca>
> wrote:
>
> > Agreed, this goes back to more general VCL behaviour so it would be good
> to
> > get others' input.
> >
> > Cameron
> >
> >
> > On Tue, Jul 22, 2014 at 1:22 PM, YOUNG OH <oh...@gmail.com>
> wrote:
> >
> > > That's great observation. I think option 1 and 2 can provide fast
> loading
> > > time due to no load failure. But, to avoid quota issues, an admin
> should
> > > periodically check the all the instances whether there are any
> duplicate
> > > instance names and defunct instances. The option 3 is safe but slow to
> > load
> > > if any deleting instance fails. I also agree that option 2 would be a
> > good
> > > choice because it can provide lower load time for end-users and also we
> > > cannot exactly estimate the deletion time. But I hope to hear others'
> > > thoughts.
> > >
> > > Best regards
> > > Young
> > >
> > >
> > > On Tue, Jul 22, 2014 at 2:46 PM, Cameron Mann <ca...@cybera.ca>
> > > wrote:
> > >
> > > > Looks good. Though I do wonder if it's necessary to fail the entire
> > load
> > > > process just because the old instance doesn't get deleted. I think
> > > there's
> > > > three possibilities:
> > > >
> > > > 1. Don't check for successful deletion; there won't be any conflicts
> > > > because we're using openstackComputerMap. This would give the fastest
> > > load
> > > > times, but the only way to find out that something went wrong would
> be
> > to
> > > > look at the list of instances and see if there are any duplicate
> names.
> > > > Could cause issues with quotas if running near capacity since there
> > could
> > > > be extra instances lying around.
> > > >
> > > > 2. Check for successful deletion, but only log the error, don't fail
> > the
> > > > load. Slower load times, but the load won't fail and the error will
> be
> > > > logged. Could cause issues with quotas if running near capacity since
> > > there
> > > > could be extra instances lying around.
> > > >
> > > > 3. What the module does now, check for successful deletion and fail
> if
> > > not.
> > > > Least end user friendly since they might encounter failures, but the
> > > safest
> > > > option. Won't cause quota issues on it's own, though an admin could
> > still
> > > > change the computer back to available without deleting the defunct
> > > > instance.
> > > >
> > > > Instance deletion time is also not very consistent in my experience;
> > I've
> > > > seen anything from seconds to over a minute and I imagine it could go
> > > > higher on OpenStack systems that see heavier usage. If we stick with
> > > option
> > > > 3 I'd recommend bumping the timeout by another minute or two just to
> be
> > > > safe. I think it's less necessary for option 2 since it doesn't fail
> on
> > > > timeout.
> > > >
> > > > I took a look at some of the other provisioning modules to see what
> > they
> > > > do:
> > > >
> > > > - VMware logs a warning if it fails to delete the old VM, but only
> > fails
> > > if
> > > > the VM is still responding to SSH
> > > > - Libvirt fails if deletion fails
> > > > - VirtualBox doesn't check for successful deletion, though it will
> fail
> > > if
> > > > it can't find the old VM to delete
> > > >
> > > > I think options 2 or 3 would be most consistent with existing
> > behaviour.
> > > > I'd lean towards option 2 since end users won't see any extra
> failures
> > > and
> > > > we can keep a lower timeout which will mean lower load times even if
> a
> > > > deletion takes a long time.
> > > >
> > > > What are you thoughts?
> > > >
> > > > Cameron
> > > >
> > > >
> > > > On Tue, Jul 22, 2014 at 9:05 AM, YOUNG OH <oh...@gmail.com>
> > > wrote:
> > > >
> > > > > Cameron,
> > > > >
> > > > > Yes, you are definitely right. I was noticed that using hostname to
> > > find
> > > > > the openstack instance id is not working properly and also can
> cause
> > > the
> > > > > problem you described. I've back to use the openstackComputerMap
> > table
> > > to
> > > > > get_os_instance_id when the instance is pingable and also add a
> loop
> > in
> > > > > _terminate_os_instance to check whether the instance is completely
> > > > deleted
> > > > > or not. Please take a look at it again and let me know if you have
> > any
> > > > > concerns. Thank you.
> > > > >
> > > > > Best regards,
> > > > > Young
> > > > >
> > > > >
> > > > > On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <
> > cameron.mann@cybera.ca>
> > > > > wrote:
> > > > >
> > > > > > Sounds like good progress to me. One comment though, it looks
> like
> > > > > > _terminate_os_instance does the DELETE request, checks the
> response
> > > for
> > > > > > success and then sleeps for 30 seconds while the instance
> deletes.
> > > > > However,
> > > > > > I don't believe a successful response to the DELETE request
> > > guarantees
> > > > > the
> > > > > > instance will actually be deleted. I've run into situations where
> > an
> > > > > > instance gets stuck in the error or deleting states but the
> command
> > > > line
> > > > > > client reports no errors when trying to delete it. This could
> > result
> > > > in a
> > > > > > situation where multiple instances with the same name exist which
> > > could
> > > > > > cause _get_os_instance_id to return the wrong ID since it filters
> > the
> > > > > > instances based on name and selects the first in the list.
> > > > > >
> > > > > > I think either returning to using openstackComputerMap or looping
> > > with
> > > > a
> > > > > > timeout until the instance is actually deleted would be better
> > > choices.
> > > > > The
> > > > > > former would allow the new instance to be created even if the
> > > deletion
> > > > of
> > > > > > the old one fails. The latter would put the computer in VCL into
> an
> > > > error
> > > > > > state which would make it more obvious something has gone wrong,
> > > though
> > > > > at
> > > > > > the cost of potentially failing a user's reservation. As an added
> > > > > > precaution It might also be worth having _get_os_instance_id fail
> > if
> > > > > > there's more than one instance in the response.
> > > > > >
> > > > > > Cameron
> > > > > >
> > > > > >
> > > > > > On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <
> oh.younghyun2@gmail.com
> > >
> > > > > wrote:
> > > > > >
> > > > > > > Cameron,
> > > > > > >
> > > > > > > I hope you had a great time and welcome back to work :-). And,
> > yes,
> > > > the
> > > > > > > OpenStack module with directly using OpenStack APIs can solve
> the
> > > > > > concerns
> > > > > > > we've discussed and it's more flexible to apply new version of
> > > > > OpenStack
> > > > > > > APIs, if necessary. In the updated openstack module, I've
> changed
> > > the
> > > > > two
> > > > > > > main things. First, I've used the hostname in Computer table
> > > (unique
> > > > in
> > > > > > the
> > > > > > > same VCL database) to create an instance and get the instance
> id
> > to
> > > > > > > terminate rather than using the openstackComputerMap table.
> This
> > > can
> > > > > > avoid
> > > > > > > using an additional table and database transactions. Second,
> I've
> > > > > changed
> > > > > > > the openstackImageMap to openstackimagerevision table that maps
> > the
> > > > > > > imagerevision id with the openstack image id. This table
> consists
> > > of
> > > > > > three
> > > > > > > fields (imagerevisionid, imagedetails, flavordetails). The
> > > > imagedetails
> > > > > > and
> > > > > > > flavordetails contains the details image and flavor information
> > > with
> > > > > json
> > > > > > > format. Thus, when VCL creates an instance, it gets each detail
> > > > > > information
> > > > > > > and parse them to find the corresponding openstack image id and
> > > > flavor
> > > > > > id.
> > > > > > > In addition, I've implemented the get_image_size() subroutine
> > > because
> > > > > the
> > > > > > > image size information was not supported in OpenStack ESSEX but
> > it
> > > > > > supports
> > > > > > > now. This is a short summary about the changes. So, if you have
> > any
> > > > > > concern
> > > > > > > or questions about the updates, please let me know. Thank you.
> > > > > > >
> > > > > > > Best regards,
> > > > > > > Young-Hyun
> > > > > > >
> > > > > > >
> > > > > > > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <
> > > > cameron.mann@cybera.ca
> > > > > >
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Sorry for the silence from my end, I realized I forgot to
> > > mention I
> > > > > was
> > > > > > > > going to be on vacation for the last week and a half.
> Anyways,
> > it
> > > > > looks
> > > > > > > > like Young's updates have addressed the main concerns we were
> > > > having
> > > > > > with
> > > > > > > > regards to the command line client. Given the progress he's
> > made
> > > we
> > > > > > think
> > > > > > > > going ahead with his module makes the most sense.
> > > > > > > >
> > > > > > > > Cameron
> > > > > > > >
> > > > > > > >
> > > > > > > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <
> > > oh.younghyun2@gmail.com
> > > > >
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Andy,
> > > > > > > > >
> > > > > > > > > Thank you for your comments. I've tried to apply what you
> > > > addressed
> > > > > > and
> > > > > > > > > committed my module again. This module finds all openstack
> > > > > > information
> > > > > > > > > using OpenStack APIs and database. Thank you.
> > > > > > > > >
> > > > > > > > > Best regards,
> > > > > > > > > Young-Hyun
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <
> > > andy_kurth@ncsu.edu
> > > > >
> > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Thanks Young. Looks good! If I understand correctly,
> you
> > > are
> > > > > > > avoiding
> > > > > > > > > the
> > > > > > > > > > need to use the CLI or cpan module by interacting
> directly
> > > with
> > > > > > > > OpenStack
> > > > > > > > > > via the REST API?
> > > > > > > > > >
> > > > > > > > > > It looks like the only commands you're running on the
> > > > management
> > > > > > node
> > > > > > > > are
> > > > > > > > > > "nova" and "qemu-img" in _get_flavor_type. Would it be
> > > > possible
> > > > > to
> > > > > > > > > > accomplish this via the API? I haven't traced through
> how
> > > your
> > > > > > code
> > > > > > > > > works
> > > > > > > > > > too deeply, but was wondering if the following could be
> > used:
> > > > > > > > > > http://docs.openstack.org/api/openstack
> > > > > > > > > > -compute/2/content/Flavors-d1e4180.html
> > > > > > > > > >
> > > > > > > > > > It would be wonderful if you can eliminate the need for
> > these
> > > > to
> > > > > be
> > > > > > > > > > executed. This would mean a pure API solution with
> nothing
> > > > > special
> > > > > > > > > needing
> > > > > > > > > > to be installed on the management node.
> > > > > > > > > >
> > > > > > > > > > If you do need to call these commands, instead of using
> qx
> > > and
> > > > > > > > backticks
> > > > > > > > > > are used to run commands on the management node. Please
> > > change
> > > > > > this
> > > > > > > to
> > > > > > > > > > use:
> > > > > > > > > > my ($exit_status, $output) =
> > $self->mn_os->execute($command);
> > > > > > > > > >
> > > > > > > > > > Also, always, always, always make sure $output and
> anything
> > > > else
> > > > > > you
> > > > > > > > try
> > > > > > > > > to
> > > > > > > > > > parse with a regex are defined first. This will avoid
> some
> > > > nasty
> > > > > > > "Use
> > > > > > > > of
> > > > > > > > > > uninitialized value in pattern match" errors which could
> > > > > > potentially
> > > > > > > > lead
> > > > > > > > > > to the entire process dying.
> > > > > > > > > >
> > > > > > > > > > The indentation looks great! :) There are a few places
> > > where
> > > > > the
> > > > > > > > curly
> > > > > > > > > > bracket style could be modified. Just about all of the
> > > > existing
> > > > > > code
> > > > > > > > > > places opening brackets on the same line as the while/for
> > > > > statement
> > > > > > > > such
> > > > > > > > > > as:
> > > > > > > > > > while ($loop > 0) {
> > > > > > > > > > -instead of-
> > > > > > > > > > while ($loop > 0)
> > > > > > > > > > {
> > > > > > > > > >
> > > > > > > > > > Please add a pod "=head2 subroutine_name ... =cut"
> heading
> > > for
> > > > > > every
> > > > > > > > > > subroutine. This is helpful for others to
> read/understand
> > > your
> > > > > > code.
> > > > > > > > > The
> > > > > > > > > > pod syntax can be a bit finicky. You can tell if it is
> > > > formatted
> > > > > > > > > properly
> > > > > > > > > > by running "pod2text openstack.pm".
> > > > > > > > > >
> > > > > > > > > > Lastly (as mainly a reminder), we will need to
> incorporate
> > > all
> > > > of
> > > > > > the
> > > > > > > > > > database changes in vcl.sql and whatever method we use
> for
> > > the
> > > > > next
> > > > > > > > > release
> > > > > > > > > > to replace update-vcl.sql. I made a reminder comment
> here:
> > > > > > > > > > https://issues.apache.org/jira/browse/VCL-764
> > > > > > > > > >
> > > > > > > > > > Regards,
> > > > > > > > > > Andy
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: OpenStack Module
Posted by Andy Kurth <an...@ncsu.edu>.
Option 2 sounds reasonable as long as there is no possibility the VM which
could not be deleted can not cause conflicts with other VMs. The main
concern would be if the VM remained powered on with an IP address that
could be reused. Would this be possible? If you encounter a problem
deleting a VM, can you reliably verify that it is powered off?
I think the priorities should be:
1) avoid conflicts
2) reduce reservation failures
3) optimize load time
Load time is important, but the deletion issue should really only affect
the user experience when the image requested is not preloaded. If VMs are
being reloaded for every reservation then there is another problem.
-Andy
On Tue, Jul 22, 2014 at 3:37 PM, Cameron Mann <ca...@cybera.ca>
wrote:
> Agreed, this goes back to more general VCL behaviour so it would be good to
> get others' input.
>
> Cameron
>
>
> On Tue, Jul 22, 2014 at 1:22 PM, YOUNG OH <oh...@gmail.com> wrote:
>
> > That's great observation. I think option 1 and 2 can provide fast loading
> > time due to no load failure. But, to avoid quota issues, an admin should
> > periodically check the all the instances whether there are any duplicate
> > instance names and defunct instances. The option 3 is safe but slow to
> load
> > if any deleting instance fails. I also agree that option 2 would be a
> good
> > choice because it can provide lower load time for end-users and also we
> > cannot exactly estimate the deletion time. But I hope to hear others'
> > thoughts.
> >
> > Best regards
> > Young
> >
> >
> > On Tue, Jul 22, 2014 at 2:46 PM, Cameron Mann <ca...@cybera.ca>
> > wrote:
> >
> > > Looks good. Though I do wonder if it's necessary to fail the entire
> load
> > > process just because the old instance doesn't get deleted. I think
> > there's
> > > three possibilities:
> > >
> > > 1. Don't check for successful deletion; there won't be any conflicts
> > > because we're using openstackComputerMap. This would give the fastest
> > load
> > > times, but the only way to find out that something went wrong would be
> to
> > > look at the list of instances and see if there are any duplicate names.
> > > Could cause issues with quotas if running near capacity since there
> could
> > > be extra instances lying around.
> > >
> > > 2. Check for successful deletion, but only log the error, don't fail
> the
> > > load. Slower load times, but the load won't fail and the error will be
> > > logged. Could cause issues with quotas if running near capacity since
> > there
> > > could be extra instances lying around.
> > >
> > > 3. What the module does now, check for successful deletion and fail if
> > not.
> > > Least end user friendly since they might encounter failures, but the
> > safest
> > > option. Won't cause quota issues on it's own, though an admin could
> still
> > > change the computer back to available without deleting the defunct
> > > instance.
> > >
> > > Instance deletion time is also not very consistent in my experience;
> I've
> > > seen anything from seconds to over a minute and I imagine it could go
> > > higher on OpenStack systems that see heavier usage. If we stick with
> > option
> > > 3 I'd recommend bumping the timeout by another minute or two just to be
> > > safe. I think it's less necessary for option 2 since it doesn't fail on
> > > timeout.
> > >
> > > I took a look at some of the other provisioning modules to see what
> they
> > > do:
> > >
> > > - VMware logs a warning if it fails to delete the old VM, but only
> fails
> > if
> > > the VM is still responding to SSH
> > > - Libvirt fails if deletion fails
> > > - VirtualBox doesn't check for successful deletion, though it will fail
> > if
> > > it can't find the old VM to delete
> > >
> > > I think options 2 or 3 would be most consistent with existing
> behaviour.
> > > I'd lean towards option 2 since end users won't see any extra failures
> > and
> > > we can keep a lower timeout which will mean lower load times even if a
> > > deletion takes a long time.
> > >
> > > What are you thoughts?
> > >
> > > Cameron
> > >
> > >
> > > On Tue, Jul 22, 2014 at 9:05 AM, YOUNG OH <oh...@gmail.com>
> > wrote:
> > >
> > > > Cameron,
> > > >
> > > > Yes, you are definitely right. I was noticed that using hostname to
> > find
> > > > the openstack instance id is not working properly and also can cause
> > the
> > > > problem you described. I've back to use the openstackComputerMap
> table
> > to
> > > > get_os_instance_id when the instance is pingable and also add a loop
> in
> > > > _terminate_os_instance to check whether the instance is completely
> > > deleted
> > > > or not. Please take a look at it again and let me know if you have
> any
> > > > concerns. Thank you.
> > > >
> > > > Best regards,
> > > > Young
> > > >
> > > >
> > > > On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <
> cameron.mann@cybera.ca>
> > > > wrote:
> > > >
> > > > > Sounds like good progress to me. One comment though, it looks like
> > > > > _terminate_os_instance does the DELETE request, checks the response
> > for
> > > > > success and then sleeps for 30 seconds while the instance deletes.
> > > > However,
> > > > > I don't believe a successful response to the DELETE request
> > guarantees
> > > > the
> > > > > instance will actually be deleted. I've run into situations where
> an
> > > > > instance gets stuck in the error or deleting states but the command
> > > line
> > > > > client reports no errors when trying to delete it. This could
> result
> > > in a
> > > > > situation where multiple instances with the same name exist which
> > could
> > > > > cause _get_os_instance_id to return the wrong ID since it filters
> the
> > > > > instances based on name and selects the first in the list.
> > > > >
> > > > > I think either returning to using openstackComputerMap or looping
> > with
> > > a
> > > > > timeout until the instance is actually deleted would be better
> > choices.
> > > > The
> > > > > former would allow the new instance to be created even if the
> > deletion
> > > of
> > > > > the old one fails. The latter would put the computer in VCL into an
> > > error
> > > > > state which would make it more obvious something has gone wrong,
> > though
> > > > at
> > > > > the cost of potentially failing a user's reservation. As an added
> > > > > precaution It might also be worth having _get_os_instance_id fail
> if
> > > > > there's more than one instance in the response.
> > > > >
> > > > > Cameron
> > > > >
> > > > >
> > > > > On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <oh.younghyun2@gmail.com
> >
> > > > wrote:
> > > > >
> > > > > > Cameron,
> > > > > >
> > > > > > I hope you had a great time and welcome back to work :-). And,
> yes,
> > > the
> > > > > > OpenStack module with directly using OpenStack APIs can solve the
> > > > > concerns
> > > > > > we've discussed and it's more flexible to apply new version of
> > > > OpenStack
> > > > > > APIs, if necessary. In the updated openstack module, I've changed
> > the
> > > > two
> > > > > > main things. First, I've used the hostname in Computer table
> > (unique
> > > in
> > > > > the
> > > > > > same VCL database) to create an instance and get the instance id
> to
> > > > > > terminate rather than using the openstackComputerMap table. This
> > can
> > > > > avoid
> > > > > > using an additional table and database transactions. Second, I've
> > > > changed
> > > > > > the openstackImageMap to openstackimagerevision table that maps
> the
> > > > > > imagerevision id with the openstack image id. This table consists
> > of
> > > > > three
> > > > > > fields (imagerevisionid, imagedetails, flavordetails). The
> > > imagedetails
> > > > > and
> > > > > > flavordetails contains the details image and flavor information
> > with
> > > > json
> > > > > > format. Thus, when VCL creates an instance, it gets each detail
> > > > > information
> > > > > > and parse them to find the corresponding openstack image id and
> > > flavor
> > > > > id.
> > > > > > In addition, I've implemented the get_image_size() subroutine
> > because
> > > > the
> > > > > > image size information was not supported in OpenStack ESSEX but
> it
> > > > > supports
> > > > > > now. This is a short summary about the changes. So, if you have
> any
> > > > > concern
> > > > > > or questions about the updates, please let me know. Thank you.
> > > > > >
> > > > > > Best regards,
> > > > > > Young-Hyun
> > > > > >
> > > > > >
> > > > > > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <
> > > cameron.mann@cybera.ca
> > > > >
> > > > > > wrote:
> > > > > >
> > > > > > > Sorry for the silence from my end, I realized I forgot to
> > mention I
> > > > was
> > > > > > > going to be on vacation for the last week and a half. Anyways,
> it
> > > > looks
> > > > > > > like Young's updates have addressed the main concerns we were
> > > having
> > > > > with
> > > > > > > regards to the command line client. Given the progress he's
> made
> > we
> > > > > think
> > > > > > > going ahead with his module makes the most sense.
> > > > > > >
> > > > > > > Cameron
> > > > > > >
> > > > > > >
> > > > > > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <
> > oh.younghyun2@gmail.com
> > > >
> > > > > > wrote:
> > > > > > >
> > > > > > > > Andy,
> > > > > > > >
> > > > > > > > Thank you for your comments. I've tried to apply what you
> > > addressed
> > > > > and
> > > > > > > > committed my module again. This module finds all openstack
> > > > > information
> > > > > > > > using OpenStack APIs and database. Thank you.
> > > > > > > >
> > > > > > > > Best regards,
> > > > > > > > Young-Hyun
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <
> > andy_kurth@ncsu.edu
> > > >
> > > > > > wrote:
> > > > > > > >
> > > > > > > > > Thanks Young. Looks good! If I understand correctly, you
> > are
> > > > > > avoiding
> > > > > > > > the
> > > > > > > > > need to use the CLI or cpan module by interacting directly
> > with
> > > > > > > OpenStack
> > > > > > > > > via the REST API?
> > > > > > > > >
> > > > > > > > > It looks like the only commands you're running on the
> > > management
> > > > > node
> > > > > > > are
> > > > > > > > > "nova" and "qemu-img" in _get_flavor_type. Would it be
> > > possible
> > > > to
> > > > > > > > > accomplish this via the API? I haven't traced through how
> > your
> > > > > code
> > > > > > > > works
> > > > > > > > > too deeply, but was wondering if the following could be
> used:
> > > > > > > > > http://docs.openstack.org/api/openstack
> > > > > > > > > -compute/2/content/Flavors-d1e4180.html
> > > > > > > > >
> > > > > > > > > It would be wonderful if you can eliminate the need for
> these
> > > to
> > > > be
> > > > > > > > > executed. This would mean a pure API solution with nothing
> > > > special
> > > > > > > > needing
> > > > > > > > > to be installed on the management node.
> > > > > > > > >
> > > > > > > > > If you do need to call these commands, instead of using qx
> > and
> > > > > > > backticks
> > > > > > > > > are used to run commands on the management node. Please
> > change
> > > > > this
> > > > > > to
> > > > > > > > > use:
> > > > > > > > > my ($exit_status, $output) =
> $self->mn_os->execute($command);
> > > > > > > > >
> > > > > > > > > Also, always, always, always make sure $output and anything
> > > else
> > > > > you
> > > > > > > try
> > > > > > > > to
> > > > > > > > > parse with a regex are defined first. This will avoid some
> > > nasty
> > > > > > "Use
> > > > > > > of
> > > > > > > > > uninitialized value in pattern match" errors which could
> > > > > potentially
> > > > > > > lead
> > > > > > > > > to the entire process dying.
> > > > > > > > >
> > > > > > > > > The indentation looks great! :) There are a few places
> > where
> > > > the
> > > > > > > curly
> > > > > > > > > bracket style could be modified. Just about all of the
> > > existing
> > > > > code
> > > > > > > > > places opening brackets on the same line as the while/for
> > > > statement
> > > > > > > such
> > > > > > > > > as:
> > > > > > > > > while ($loop > 0) {
> > > > > > > > > -instead of-
> > > > > > > > > while ($loop > 0)
> > > > > > > > > {
> > > > > > > > >
> > > > > > > > > Please add a pod "=head2 subroutine_name ... =cut" heading
> > for
> > > > > every
> > > > > > > > > subroutine. This is helpful for others to read/understand
> > your
> > > > > code.
> > > > > > > > The
> > > > > > > > > pod syntax can be a bit finicky. You can tell if it is
> > > formatted
> > > > > > > > properly
> > > > > > > > > by running "pod2text openstack.pm".
> > > > > > > > >
> > > > > > > > > Lastly (as mainly a reminder), we will need to incorporate
> > all
> > > of
> > > > > the
> > > > > > > > > database changes in vcl.sql and whatever method we use for
> > the
> > > > next
> > > > > > > > release
> > > > > > > > > to replace update-vcl.sql. I made a reminder comment here:
> > > > > > > > > https://issues.apache.org/jira/browse/VCL-764
> > > > > > > > >
> > > > > > > > > Regards,
> > > > > > > > > Andy
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: OpenStack Module
Posted by Cameron Mann <ca...@cybera.ca>.
Agreed, this goes back to more general VCL behaviour so it would be good to
get others' input.
Cameron
On Tue, Jul 22, 2014 at 1:22 PM, YOUNG OH <oh...@gmail.com> wrote:
> That's great observation. I think option 1 and 2 can provide fast loading
> time due to no load failure. But, to avoid quota issues, an admin should
> periodically check the all the instances whether there are any duplicate
> instance names and defunct instances. The option 3 is safe but slow to load
> if any deleting instance fails. I also agree that option 2 would be a good
> choice because it can provide lower load time for end-users and also we
> cannot exactly estimate the deletion time. But I hope to hear others'
> thoughts.
>
> Best regards
> Young
>
>
> On Tue, Jul 22, 2014 at 2:46 PM, Cameron Mann <ca...@cybera.ca>
> wrote:
>
> > Looks good. Though I do wonder if it's necessary to fail the entire load
> > process just because the old instance doesn't get deleted. I think
> there's
> > three possibilities:
> >
> > 1. Don't check for successful deletion; there won't be any conflicts
> > because we're using openstackComputerMap. This would give the fastest
> load
> > times, but the only way to find out that something went wrong would be to
> > look at the list of instances and see if there are any duplicate names.
> > Could cause issues with quotas if running near capacity since there could
> > be extra instances lying around.
> >
> > 2. Check for successful deletion, but only log the error, don't fail the
> > load. Slower load times, but the load won't fail and the error will be
> > logged. Could cause issues with quotas if running near capacity since
> there
> > could be extra instances lying around.
> >
> > 3. What the module does now, check for successful deletion and fail if
> not.
> > Least end user friendly since they might encounter failures, but the
> safest
> > option. Won't cause quota issues on it's own, though an admin could still
> > change the computer back to available without deleting the defunct
> > instance.
> >
> > Instance deletion time is also not very consistent in my experience; I've
> > seen anything from seconds to over a minute and I imagine it could go
> > higher on OpenStack systems that see heavier usage. If we stick with
> option
> > 3 I'd recommend bumping the timeout by another minute or two just to be
> > safe. I think it's less necessary for option 2 since it doesn't fail on
> > timeout.
> >
> > I took a look at some of the other provisioning modules to see what they
> > do:
> >
> > - VMware logs a warning if it fails to delete the old VM, but only fails
> if
> > the VM is still responding to SSH
> > - Libvirt fails if deletion fails
> > - VirtualBox doesn't check for successful deletion, though it will fail
> if
> > it can't find the old VM to delete
> >
> > I think options 2 or 3 would be most consistent with existing behaviour.
> > I'd lean towards option 2 since end users won't see any extra failures
> and
> > we can keep a lower timeout which will mean lower load times even if a
> > deletion takes a long time.
> >
> > What are you thoughts?
> >
> > Cameron
> >
> >
> > On Tue, Jul 22, 2014 at 9:05 AM, YOUNG OH <oh...@gmail.com>
> wrote:
> >
> > > Cameron,
> > >
> > > Yes, you are definitely right. I was noticed that using hostname to
> find
> > > the openstack instance id is not working properly and also can cause
> the
> > > problem you described. I've back to use the openstackComputerMap table
> to
> > > get_os_instance_id when the instance is pingable and also add a loop in
> > > _terminate_os_instance to check whether the instance is completely
> > deleted
> > > or not. Please take a look at it again and let me know if you have any
> > > concerns. Thank you.
> > >
> > > Best regards,
> > > Young
> > >
> > >
> > > On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <ca...@cybera.ca>
> > > wrote:
> > >
> > > > Sounds like good progress to me. One comment though, it looks like
> > > > _terminate_os_instance does the DELETE request, checks the response
> for
> > > > success and then sleeps for 30 seconds while the instance deletes.
> > > However,
> > > > I don't believe a successful response to the DELETE request
> guarantees
> > > the
> > > > instance will actually be deleted. I've run into situations where an
> > > > instance gets stuck in the error or deleting states but the command
> > line
> > > > client reports no errors when trying to delete it. This could result
> > in a
> > > > situation where multiple instances with the same name exist which
> could
> > > > cause _get_os_instance_id to return the wrong ID since it filters the
> > > > instances based on name and selects the first in the list.
> > > >
> > > > I think either returning to using openstackComputerMap or looping
> with
> > a
> > > > timeout until the instance is actually deleted would be better
> choices.
> > > The
> > > > former would allow the new instance to be created even if the
> deletion
> > of
> > > > the old one fails. The latter would put the computer in VCL into an
> > error
> > > > state which would make it more obvious something has gone wrong,
> though
> > > at
> > > > the cost of potentially failing a user's reservation. As an added
> > > > precaution It might also be worth having _get_os_instance_id fail if
> > > > there's more than one instance in the response.
> > > >
> > > > Cameron
> > > >
> > > >
> > > > On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <oh...@gmail.com>
> > > wrote:
> > > >
> > > > > Cameron,
> > > > >
> > > > > I hope you had a great time and welcome back to work :-). And, yes,
> > the
> > > > > OpenStack module with directly using OpenStack APIs can solve the
> > > > concerns
> > > > > we've discussed and it's more flexible to apply new version of
> > > OpenStack
> > > > > APIs, if necessary. In the updated openstack module, I've changed
> the
> > > two
> > > > > main things. First, I've used the hostname in Computer table
> (unique
> > in
> > > > the
> > > > > same VCL database) to create an instance and get the instance id to
> > > > > terminate rather than using the openstackComputerMap table. This
> can
> > > > avoid
> > > > > using an additional table and database transactions. Second, I've
> > > changed
> > > > > the openstackImageMap to openstackimagerevision table that maps the
> > > > > imagerevision id with the openstack image id. This table consists
> of
> > > > three
> > > > > fields (imagerevisionid, imagedetails, flavordetails). The
> > imagedetails
> > > > and
> > > > > flavordetails contains the details image and flavor information
> with
> > > json
> > > > > format. Thus, when VCL creates an instance, it gets each detail
> > > > information
> > > > > and parse them to find the corresponding openstack image id and
> > flavor
> > > > id.
> > > > > In addition, I've implemented the get_image_size() subroutine
> because
> > > the
> > > > > image size information was not supported in OpenStack ESSEX but it
> > > > supports
> > > > > now. This is a short summary about the changes. So, if you have any
> > > > concern
> > > > > or questions about the updates, please let me know. Thank you.
> > > > >
> > > > > Best regards,
> > > > > Young-Hyun
> > > > >
> > > > >
> > > > > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <
> > cameron.mann@cybera.ca
> > > >
> > > > > wrote:
> > > > >
> > > > > > Sorry for the silence from my end, I realized I forgot to
> mention I
> > > was
> > > > > > going to be on vacation for the last week and a half. Anyways, it
> > > looks
> > > > > > like Young's updates have addressed the main concerns we were
> > having
> > > > with
> > > > > > regards to the command line client. Given the progress he's made
> we
> > > > think
> > > > > > going ahead with his module makes the most sense.
> > > > > >
> > > > > > Cameron
> > > > > >
> > > > > >
> > > > > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <
> oh.younghyun2@gmail.com
> > >
> > > > > wrote:
> > > > > >
> > > > > > > Andy,
> > > > > > >
> > > > > > > Thank you for your comments. I've tried to apply what you
> > addressed
> > > > and
> > > > > > > committed my module again. This module finds all openstack
> > > > information
> > > > > > > using OpenStack APIs and database. Thank you.
> > > > > > >
> > > > > > > Best regards,
> > > > > > > Young-Hyun
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <
> andy_kurth@ncsu.edu
> > >
> > > > > wrote:
> > > > > > >
> > > > > > > > Thanks Young. Looks good! If I understand correctly, you
> are
> > > > > avoiding
> > > > > > > the
> > > > > > > > need to use the CLI or cpan module by interacting directly
> with
> > > > > > OpenStack
> > > > > > > > via the REST API?
> > > > > > > >
> > > > > > > > It looks like the only commands you're running on the
> > management
> > > > node
> > > > > > are
> > > > > > > > "nova" and "qemu-img" in _get_flavor_type. Would it be
> > possible
> > > to
> > > > > > > > accomplish this via the API? I haven't traced through how
> your
> > > > code
> > > > > > > works
> > > > > > > > too deeply, but was wondering if the following could be used:
> > > > > > > > http://docs.openstack.org/api/openstack
> > > > > > > > -compute/2/content/Flavors-d1e4180.html
> > > > > > > >
> > > > > > > > It would be wonderful if you can eliminate the need for these
> > to
> > > be
> > > > > > > > executed. This would mean a pure API solution with nothing
> > > special
> > > > > > > needing
> > > > > > > > to be installed on the management node.
> > > > > > > >
> > > > > > > > If you do need to call these commands, instead of using qx
> and
> > > > > > backticks
> > > > > > > > are used to run commands on the management node. Please
> change
> > > > this
> > > > > to
> > > > > > > > use:
> > > > > > > > my ($exit_status, $output) = $self->mn_os->execute($command);
> > > > > > > >
> > > > > > > > Also, always, always, always make sure $output and anything
> > else
> > > > you
> > > > > > try
> > > > > > > to
> > > > > > > > parse with a regex are defined first. This will avoid some
> > nasty
> > > > > "Use
> > > > > > of
> > > > > > > > uninitialized value in pattern match" errors which could
> > > > potentially
> > > > > > lead
> > > > > > > > to the entire process dying.
> > > > > > > >
> > > > > > > > The indentation looks great! :) There are a few places
> where
> > > the
> > > > > > curly
> > > > > > > > bracket style could be modified. Just about all of the
> > existing
> > > > code
> > > > > > > > places opening brackets on the same line as the while/for
> > > statement
> > > > > > such
> > > > > > > > as:
> > > > > > > > while ($loop > 0) {
> > > > > > > > -instead of-
> > > > > > > > while ($loop > 0)
> > > > > > > > {
> > > > > > > >
> > > > > > > > Please add a pod "=head2 subroutine_name ... =cut" heading
> for
> > > > every
> > > > > > > > subroutine. This is helpful for others to read/understand
> your
> > > > code.
> > > > > > > The
> > > > > > > > pod syntax can be a bit finicky. You can tell if it is
> > formatted
> > > > > > > properly
> > > > > > > > by running "pod2text openstack.pm".
> > > > > > > >
> > > > > > > > Lastly (as mainly a reminder), we will need to incorporate
> all
> > of
> > > > the
> > > > > > > > database changes in vcl.sql and whatever method we use for
> the
> > > next
> > > > > > > release
> > > > > > > > to replace update-vcl.sql. I made a reminder comment here:
> > > > > > > > https://issues.apache.org/jira/browse/VCL-764
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > Andy
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
That's great observation. I think option 1 and 2 can provide fast loading
time due to no load failure. But, to avoid quota issues, an admin should
periodically check the all the instances whether there are any duplicate
instance names and defunct instances. The option 3 is safe but slow to load
if any deleting instance fails. I also agree that option 2 would be a good
choice because it can provide lower load time for end-users and also we
cannot exactly estimate the deletion time. But I hope to hear others'
thoughts.
Best regards
Young
On Tue, Jul 22, 2014 at 2:46 PM, Cameron Mann <ca...@cybera.ca>
wrote:
> Looks good. Though I do wonder if it's necessary to fail the entire load
> process just because the old instance doesn't get deleted. I think there's
> three possibilities:
>
> 1. Don't check for successful deletion; there won't be any conflicts
> because we're using openstackComputerMap. This would give the fastest load
> times, but the only way to find out that something went wrong would be to
> look at the list of instances and see if there are any duplicate names.
> Could cause issues with quotas if running near capacity since there could
> be extra instances lying around.
>
> 2. Check for successful deletion, but only log the error, don't fail the
> load. Slower load times, but the load won't fail and the error will be
> logged. Could cause issues with quotas if running near capacity since there
> could be extra instances lying around.
>
> 3. What the module does now, check for successful deletion and fail if not.
> Least end user friendly since they might encounter failures, but the safest
> option. Won't cause quota issues on it's own, though an admin could still
> change the computer back to available without deleting the defunct
> instance.
>
> Instance deletion time is also not very consistent in my experience; I've
> seen anything from seconds to over a minute and I imagine it could go
> higher on OpenStack systems that see heavier usage. If we stick with option
> 3 I'd recommend bumping the timeout by another minute or two just to be
> safe. I think it's less necessary for option 2 since it doesn't fail on
> timeout.
>
> I took a look at some of the other provisioning modules to see what they
> do:
>
> - VMware logs a warning if it fails to delete the old VM, but only fails if
> the VM is still responding to SSH
> - Libvirt fails if deletion fails
> - VirtualBox doesn't check for successful deletion, though it will fail if
> it can't find the old VM to delete
>
> I think options 2 or 3 would be most consistent with existing behaviour.
> I'd lean towards option 2 since end users won't see any extra failures and
> we can keep a lower timeout which will mean lower load times even if a
> deletion takes a long time.
>
> What are you thoughts?
>
> Cameron
>
>
> On Tue, Jul 22, 2014 at 9:05 AM, YOUNG OH <oh...@gmail.com> wrote:
>
> > Cameron,
> >
> > Yes, you are definitely right. I was noticed that using hostname to find
> > the openstack instance id is not working properly and also can cause the
> > problem you described. I've back to use the openstackComputerMap table to
> > get_os_instance_id when the instance is pingable and also add a loop in
> > _terminate_os_instance to check whether the instance is completely
> deleted
> > or not. Please take a look at it again and let me know if you have any
> > concerns. Thank you.
> >
> > Best regards,
> > Young
> >
> >
> > On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <ca...@cybera.ca>
> > wrote:
> >
> > > Sounds like good progress to me. One comment though, it looks like
> > > _terminate_os_instance does the DELETE request, checks the response for
> > > success and then sleeps for 30 seconds while the instance deletes.
> > However,
> > > I don't believe a successful response to the DELETE request guarantees
> > the
> > > instance will actually be deleted. I've run into situations where an
> > > instance gets stuck in the error or deleting states but the command
> line
> > > client reports no errors when trying to delete it. This could result
> in a
> > > situation where multiple instances with the same name exist which could
> > > cause _get_os_instance_id to return the wrong ID since it filters the
> > > instances based on name and selects the first in the list.
> > >
> > > I think either returning to using openstackComputerMap or looping with
> a
> > > timeout until the instance is actually deleted would be better choices.
> > The
> > > former would allow the new instance to be created even if the deletion
> of
> > > the old one fails. The latter would put the computer in VCL into an
> error
> > > state which would make it more obvious something has gone wrong, though
> > at
> > > the cost of potentially failing a user's reservation. As an added
> > > precaution It might also be worth having _get_os_instance_id fail if
> > > there's more than one instance in the response.
> > >
> > > Cameron
> > >
> > >
> > > On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <oh...@gmail.com>
> > wrote:
> > >
> > > > Cameron,
> > > >
> > > > I hope you had a great time and welcome back to work :-). And, yes,
> the
> > > > OpenStack module with directly using OpenStack APIs can solve the
> > > concerns
> > > > we've discussed and it's more flexible to apply new version of
> > OpenStack
> > > > APIs, if necessary. In the updated openstack module, I've changed the
> > two
> > > > main things. First, I've used the hostname in Computer table (unique
> in
> > > the
> > > > same VCL database) to create an instance and get the instance id to
> > > > terminate rather than using the openstackComputerMap table. This can
> > > avoid
> > > > using an additional table and database transactions. Second, I've
> > changed
> > > > the openstackImageMap to openstackimagerevision table that maps the
> > > > imagerevision id with the openstack image id. This table consists of
> > > three
> > > > fields (imagerevisionid, imagedetails, flavordetails). The
> imagedetails
> > > and
> > > > flavordetails contains the details image and flavor information with
> > json
> > > > format. Thus, when VCL creates an instance, it gets each detail
> > > information
> > > > and parse them to find the corresponding openstack image id and
> flavor
> > > id.
> > > > In addition, I've implemented the get_image_size() subroutine because
> > the
> > > > image size information was not supported in OpenStack ESSEX but it
> > > supports
> > > > now. This is a short summary about the changes. So, if you have any
> > > concern
> > > > or questions about the updates, please let me know. Thank you.
> > > >
> > > > Best regards,
> > > > Young-Hyun
> > > >
> > > >
> > > > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <
> cameron.mann@cybera.ca
> > >
> > > > wrote:
> > > >
> > > > > Sorry for the silence from my end, I realized I forgot to mention I
> > was
> > > > > going to be on vacation for the last week and a half. Anyways, it
> > looks
> > > > > like Young's updates have addressed the main concerns we were
> having
> > > with
> > > > > regards to the command line client. Given the progress he's made we
> > > think
> > > > > going ahead with his module makes the most sense.
> > > > >
> > > > > Cameron
> > > > >
> > > > >
> > > > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <oh.younghyun2@gmail.com
> >
> > > > wrote:
> > > > >
> > > > > > Andy,
> > > > > >
> > > > > > Thank you for your comments. I've tried to apply what you
> addressed
> > > and
> > > > > > committed my module again. This module finds all openstack
> > > information
> > > > > > using OpenStack APIs and database. Thank you.
> > > > > >
> > > > > > Best regards,
> > > > > > Young-Hyun
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <andy_kurth@ncsu.edu
> >
> > > > wrote:
> > > > > >
> > > > > > > Thanks Young. Looks good! If I understand correctly, you are
> > > > avoiding
> > > > > > the
> > > > > > > need to use the CLI or cpan module by interacting directly with
> > > > > OpenStack
> > > > > > > via the REST API?
> > > > > > >
> > > > > > > It looks like the only commands you're running on the
> management
> > > node
> > > > > are
> > > > > > > "nova" and "qemu-img" in _get_flavor_type. Would it be
> possible
> > to
> > > > > > > accomplish this via the API? I haven't traced through how your
> > > code
> > > > > > works
> > > > > > > too deeply, but was wondering if the following could be used:
> > > > > > > http://docs.openstack.org/api/openstack
> > > > > > > -compute/2/content/Flavors-d1e4180.html
> > > > > > >
> > > > > > > It would be wonderful if you can eliminate the need for these
> to
> > be
> > > > > > > executed. This would mean a pure API solution with nothing
> > special
> > > > > > needing
> > > > > > > to be installed on the management node.
> > > > > > >
> > > > > > > If you do need to call these commands, instead of using qx and
> > > > > backticks
> > > > > > > are used to run commands on the management node. Please change
> > > this
> > > > to
> > > > > > > use:
> > > > > > > my ($exit_status, $output) = $self->mn_os->execute($command);
> > > > > > >
> > > > > > > Also, always, always, always make sure $output and anything
> else
> > > you
> > > > > try
> > > > > > to
> > > > > > > parse with a regex are defined first. This will avoid some
> nasty
> > > > "Use
> > > > > of
> > > > > > > uninitialized value in pattern match" errors which could
> > > potentially
> > > > > lead
> > > > > > > to the entire process dying.
> > > > > > >
> > > > > > > The indentation looks great! :) There are a few places where
> > the
> > > > > curly
> > > > > > > bracket style could be modified. Just about all of the
> existing
> > > code
> > > > > > > places opening brackets on the same line as the while/for
> > statement
> > > > > such
> > > > > > > as:
> > > > > > > while ($loop > 0) {
> > > > > > > -instead of-
> > > > > > > while ($loop > 0)
> > > > > > > {
> > > > > > >
> > > > > > > Please add a pod "=head2 subroutine_name ... =cut" heading for
> > > every
> > > > > > > subroutine. This is helpful for others to read/understand your
> > > code.
> > > > > > The
> > > > > > > pod syntax can be a bit finicky. You can tell if it is
> formatted
> > > > > > properly
> > > > > > > by running "pod2text openstack.pm".
> > > > > > >
> > > > > > > Lastly (as mainly a reminder), we will need to incorporate all
> of
> > > the
> > > > > > > database changes in vcl.sql and whatever method we use for the
> > next
> > > > > > release
> > > > > > > to replace update-vcl.sql. I made a reminder comment here:
> > > > > > > https://issues.apache.org/jira/browse/VCL-764
> > > > > > >
> > > > > > > Regards,
> > > > > > > Andy
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: OpenStack Module
Posted by Cameron Mann <ca...@cybera.ca>.
Looks good. Though I do wonder if it's necessary to fail the entire load
process just because the old instance doesn't get deleted. I think there's
three possibilities:
1. Don't check for successful deletion; there won't be any conflicts
because we're using openstackComputerMap. This would give the fastest load
times, but the only way to find out that something went wrong would be to
look at the list of instances and see if there are any duplicate names.
Could cause issues with quotas if running near capacity since there could
be extra instances lying around.
2. Check for successful deletion, but only log the error, don't fail the
load. Slower load times, but the load won't fail and the error will be
logged. Could cause issues with quotas if running near capacity since there
could be extra instances lying around.
3. What the module does now, check for successful deletion and fail if not.
Least end user friendly since they might encounter failures, but the safest
option. Won't cause quota issues on it's own, though an admin could still
change the computer back to available without deleting the defunct instance.
Instance deletion time is also not very consistent in my experience; I've
seen anything from seconds to over a minute and I imagine it could go
higher on OpenStack systems that see heavier usage. If we stick with option
3 I'd recommend bumping the timeout by another minute or two just to be
safe. I think it's less necessary for option 2 since it doesn't fail on
timeout.
I took a look at some of the other provisioning modules to see what they do:
- VMware logs a warning if it fails to delete the old VM, but only fails if
the VM is still responding to SSH
- Libvirt fails if deletion fails
- VirtualBox doesn't check for successful deletion, though it will fail if
it can't find the old VM to delete
I think options 2 or 3 would be most consistent with existing behaviour.
I'd lean towards option 2 since end users won't see any extra failures and
we can keep a lower timeout which will mean lower load times even if a
deletion takes a long time.
What are you thoughts?
Cameron
On Tue, Jul 22, 2014 at 9:05 AM, YOUNG OH <oh...@gmail.com> wrote:
> Cameron,
>
> Yes, you are definitely right. I was noticed that using hostname to find
> the openstack instance id is not working properly and also can cause the
> problem you described. I've back to use the openstackComputerMap table to
> get_os_instance_id when the instance is pingable and also add a loop in
> _terminate_os_instance to check whether the instance is completely deleted
> or not. Please take a look at it again and let me know if you have any
> concerns. Thank you.
>
> Best regards,
> Young
>
>
> On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <ca...@cybera.ca>
> wrote:
>
> > Sounds like good progress to me. One comment though, it looks like
> > _terminate_os_instance does the DELETE request, checks the response for
> > success and then sleeps for 30 seconds while the instance deletes.
> However,
> > I don't believe a successful response to the DELETE request guarantees
> the
> > instance will actually be deleted. I've run into situations where an
> > instance gets stuck in the error or deleting states but the command line
> > client reports no errors when trying to delete it. This could result in a
> > situation where multiple instances with the same name exist which could
> > cause _get_os_instance_id to return the wrong ID since it filters the
> > instances based on name and selects the first in the list.
> >
> > I think either returning to using openstackComputerMap or looping with a
> > timeout until the instance is actually deleted would be better choices.
> The
> > former would allow the new instance to be created even if the deletion of
> > the old one fails. The latter would put the computer in VCL into an error
> > state which would make it more obvious something has gone wrong, though
> at
> > the cost of potentially failing a user's reservation. As an added
> > precaution It might also be worth having _get_os_instance_id fail if
> > there's more than one instance in the response.
> >
> > Cameron
> >
> >
> > On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <oh...@gmail.com>
> wrote:
> >
> > > Cameron,
> > >
> > > I hope you had a great time and welcome back to work :-). And, yes, the
> > > OpenStack module with directly using OpenStack APIs can solve the
> > concerns
> > > we've discussed and it's more flexible to apply new version of
> OpenStack
> > > APIs, if necessary. In the updated openstack module, I've changed the
> two
> > > main things. First, I've used the hostname in Computer table (unique in
> > the
> > > same VCL database) to create an instance and get the instance id to
> > > terminate rather than using the openstackComputerMap table. This can
> > avoid
> > > using an additional table and database transactions. Second, I've
> changed
> > > the openstackImageMap to openstackimagerevision table that maps the
> > > imagerevision id with the openstack image id. This table consists of
> > three
> > > fields (imagerevisionid, imagedetails, flavordetails). The imagedetails
> > and
> > > flavordetails contains the details image and flavor information with
> json
> > > format. Thus, when VCL creates an instance, it gets each detail
> > information
> > > and parse them to find the corresponding openstack image id and flavor
> > id.
> > > In addition, I've implemented the get_image_size() subroutine because
> the
> > > image size information was not supported in OpenStack ESSEX but it
> > supports
> > > now. This is a short summary about the changes. So, if you have any
> > concern
> > > or questions about the updates, please let me know. Thank you.
> > >
> > > Best regards,
> > > Young-Hyun
> > >
> > >
> > > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <cameron.mann@cybera.ca
> >
> > > wrote:
> > >
> > > > Sorry for the silence from my end, I realized I forgot to mention I
> was
> > > > going to be on vacation for the last week and a half. Anyways, it
> looks
> > > > like Young's updates have addressed the main concerns we were having
> > with
> > > > regards to the command line client. Given the progress he's made we
> > think
> > > > going ahead with his module makes the most sense.
> > > >
> > > > Cameron
> > > >
> > > >
> > > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <oh...@gmail.com>
> > > wrote:
> > > >
> > > > > Andy,
> > > > >
> > > > > Thank you for your comments. I've tried to apply what you addressed
> > and
> > > > > committed my module again. This module finds all openstack
> > information
> > > > > using OpenStack APIs and database. Thank you.
> > > > >
> > > > > Best regards,
> > > > > Young-Hyun
> > > > >
> > > > >
> > > > >
> > > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <an...@ncsu.edu>
> > > wrote:
> > > > >
> > > > > > Thanks Young. Looks good! If I understand correctly, you are
> > > avoiding
> > > > > the
> > > > > > need to use the CLI or cpan module by interacting directly with
> > > > OpenStack
> > > > > > via the REST API?
> > > > > >
> > > > > > It looks like the only commands you're running on the management
> > node
> > > > are
> > > > > > "nova" and "qemu-img" in _get_flavor_type. Would it be possible
> to
> > > > > > accomplish this via the API? I haven't traced through how your
> > code
> > > > > works
> > > > > > too deeply, but was wondering if the following could be used:
> > > > > > http://docs.openstack.org/api/openstack
> > > > > > -compute/2/content/Flavors-d1e4180.html
> > > > > >
> > > > > > It would be wonderful if you can eliminate the need for these to
> be
> > > > > > executed. This would mean a pure API solution with nothing
> special
> > > > > needing
> > > > > > to be installed on the management node.
> > > > > >
> > > > > > If you do need to call these commands, instead of using qx and
> > > > backticks
> > > > > > are used to run commands on the management node. Please change
> > this
> > > to
> > > > > > use:
> > > > > > my ($exit_status, $output) = $self->mn_os->execute($command);
> > > > > >
> > > > > > Also, always, always, always make sure $output and anything else
> > you
> > > > try
> > > > > to
> > > > > > parse with a regex are defined first. This will avoid some nasty
> > > "Use
> > > > of
> > > > > > uninitialized value in pattern match" errors which could
> > potentially
> > > > lead
> > > > > > to the entire process dying.
> > > > > >
> > > > > > The indentation looks great! :) There are a few places where
> the
> > > > curly
> > > > > > bracket style could be modified. Just about all of the existing
> > code
> > > > > > places opening brackets on the same line as the while/for
> statement
> > > > such
> > > > > > as:
> > > > > > while ($loop > 0) {
> > > > > > -instead of-
> > > > > > while ($loop > 0)
> > > > > > {
> > > > > >
> > > > > > Please add a pod "=head2 subroutine_name ... =cut" heading for
> > every
> > > > > > subroutine. This is helpful for others to read/understand your
> > code.
> > > > > The
> > > > > > pod syntax can be a bit finicky. You can tell if it is formatted
> > > > > properly
> > > > > > by running "pod2text openstack.pm".
> > > > > >
> > > > > > Lastly (as mainly a reminder), we will need to incorporate all of
> > the
> > > > > > database changes in vcl.sql and whatever method we use for the
> next
> > > > > release
> > > > > > to replace update-vcl.sql. I made a reminder comment here:
> > > > > > https://issues.apache.org/jira/browse/VCL-764
> > > > > >
> > > > > > Regards,
> > > > > > Andy
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Cameron,
Yes, you are definitely right. I was noticed that using hostname to find
the openstack instance id is not working properly and also can cause the
problem you described. I've back to use the openstackComputerMap table to
get_os_instance_id when the instance is pingable and also add a loop in
_terminate_os_instance to check whether the instance is completely deleted
or not. Please take a look at it again and let me know if you have any
concerns. Thank you.
Best regards,
Young
On Mon, Jul 21, 2014 at 4:18 PM, Cameron Mann <ca...@cybera.ca>
wrote:
> Sounds like good progress to me. One comment though, it looks like
> _terminate_os_instance does the DELETE request, checks the response for
> success and then sleeps for 30 seconds while the instance deletes. However,
> I don't believe a successful response to the DELETE request guarantees the
> instance will actually be deleted. I've run into situations where an
> instance gets stuck in the error or deleting states but the command line
> client reports no errors when trying to delete it. This could result in a
> situation where multiple instances with the same name exist which could
> cause _get_os_instance_id to return the wrong ID since it filters the
> instances based on name and selects the first in the list.
>
> I think either returning to using openstackComputerMap or looping with a
> timeout until the instance is actually deleted would be better choices. The
> former would allow the new instance to be created even if the deletion of
> the old one fails. The latter would put the computer in VCL into an error
> state which would make it more obvious something has gone wrong, though at
> the cost of potentially failing a user's reservation. As an added
> precaution It might also be worth having _get_os_instance_id fail if
> there's more than one instance in the response.
>
> Cameron
>
>
> On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <oh...@gmail.com> wrote:
>
> > Cameron,
> >
> > I hope you had a great time and welcome back to work :-). And, yes, the
> > OpenStack module with directly using OpenStack APIs can solve the
> concerns
> > we've discussed and it's more flexible to apply new version of OpenStack
> > APIs, if necessary. In the updated openstack module, I've changed the two
> > main things. First, I've used the hostname in Computer table (unique in
> the
> > same VCL database) to create an instance and get the instance id to
> > terminate rather than using the openstackComputerMap table. This can
> avoid
> > using an additional table and database transactions. Second, I've changed
> > the openstackImageMap to openstackimagerevision table that maps the
> > imagerevision id with the openstack image id. This table consists of
> three
> > fields (imagerevisionid, imagedetails, flavordetails). The imagedetails
> and
> > flavordetails contains the details image and flavor information with json
> > format. Thus, when VCL creates an instance, it gets each detail
> information
> > and parse them to find the corresponding openstack image id and flavor
> id.
> > In addition, I've implemented the get_image_size() subroutine because the
> > image size information was not supported in OpenStack ESSEX but it
> supports
> > now. This is a short summary about the changes. So, if you have any
> concern
> > or questions about the updates, please let me know. Thank you.
> >
> > Best regards,
> > Young-Hyun
> >
> >
> > On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <ca...@cybera.ca>
> > wrote:
> >
> > > Sorry for the silence from my end, I realized I forgot to mention I was
> > > going to be on vacation for the last week and a half. Anyways, it looks
> > > like Young's updates have addressed the main concerns we were having
> with
> > > regards to the command line client. Given the progress he's made we
> think
> > > going ahead with his module makes the most sense.
> > >
> > > Cameron
> > >
> > >
> > > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <oh...@gmail.com>
> > wrote:
> > >
> > > > Andy,
> > > >
> > > > Thank you for your comments. I've tried to apply what you addressed
> and
> > > > committed my module again. This module finds all openstack
> information
> > > > using OpenStack APIs and database. Thank you.
> > > >
> > > > Best regards,
> > > > Young-Hyun
> > > >
> > > >
> > > >
> > > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <an...@ncsu.edu>
> > wrote:
> > > >
> > > > > Thanks Young. Looks good! If I understand correctly, you are
> > avoiding
> > > > the
> > > > > need to use the CLI or cpan module by interacting directly with
> > > OpenStack
> > > > > via the REST API?
> > > > >
> > > > > It looks like the only commands you're running on the management
> node
> > > are
> > > > > "nova" and "qemu-img" in _get_flavor_type. Would it be possible to
> > > > > accomplish this via the API? I haven't traced through how your
> code
> > > > works
> > > > > too deeply, but was wondering if the following could be used:
> > > > > http://docs.openstack.org/api/openstack
> > > > > -compute/2/content/Flavors-d1e4180.html
> > > > >
> > > > > It would be wonderful if you can eliminate the need for these to be
> > > > > executed. This would mean a pure API solution with nothing special
> > > > needing
> > > > > to be installed on the management node.
> > > > >
> > > > > If you do need to call these commands, instead of using qx and
> > > backticks
> > > > > are used to run commands on the management node. Please change
> this
> > to
> > > > > use:
> > > > > my ($exit_status, $output) = $self->mn_os->execute($command);
> > > > >
> > > > > Also, always, always, always make sure $output and anything else
> you
> > > try
> > > > to
> > > > > parse with a regex are defined first. This will avoid some nasty
> > "Use
> > > of
> > > > > uninitialized value in pattern match" errors which could
> potentially
> > > lead
> > > > > to the entire process dying.
> > > > >
> > > > > The indentation looks great! :) There are a few places where the
> > > curly
> > > > > bracket style could be modified. Just about all of the existing
> code
> > > > > places opening brackets on the same line as the while/for statement
> > > such
> > > > > as:
> > > > > while ($loop > 0) {
> > > > > -instead of-
> > > > > while ($loop > 0)
> > > > > {
> > > > >
> > > > > Please add a pod "=head2 subroutine_name ... =cut" heading for
> every
> > > > > subroutine. This is helpful for others to read/understand your
> code.
> > > > The
> > > > > pod syntax can be a bit finicky. You can tell if it is formatted
> > > > properly
> > > > > by running "pod2text openstack.pm".
> > > > >
> > > > > Lastly (as mainly a reminder), we will need to incorporate all of
> the
> > > > > database changes in vcl.sql and whatever method we use for the next
> > > > release
> > > > > to replace update-vcl.sql. I made a reminder comment here:
> > > > > https://issues.apache.org/jira/browse/VCL-764
> > > > >
> > > > > Regards,
> > > > > Andy
> > > > >
> > > >
> > >
> >
>
Re: OpenStack Module
Posted by Cameron Mann <ca...@cybera.ca>.
Sounds like good progress to me. One comment though, it looks like
_terminate_os_instance does the DELETE request, checks the response for
success and then sleeps for 30 seconds while the instance deletes. However,
I don't believe a successful response to the DELETE request guarantees the
instance will actually be deleted. I've run into situations where an
instance gets stuck in the error or deleting states but the command line
client reports no errors when trying to delete it. This could result in a
situation where multiple instances with the same name exist which could
cause _get_os_instance_id to return the wrong ID since it filters the
instances based on name and selects the first in the list.
I think either returning to using openstackComputerMap or looping with a
timeout until the instance is actually deleted would be better choices. The
former would allow the new instance to be created even if the deletion of
the old one fails. The latter would put the computer in VCL into an error
state which would make it more obvious something has gone wrong, though at
the cost of potentially failing a user's reservation. As an added
precaution It might also be worth having _get_os_instance_id fail if
there's more than one instance in the response.
Cameron
On Fri, Jul 18, 2014 at 9:25 AM, YOUNG OH <oh...@gmail.com> wrote:
> Cameron,
>
> I hope you had a great time and welcome back to work :-). And, yes, the
> OpenStack module with directly using OpenStack APIs can solve the concerns
> we've discussed and it's more flexible to apply new version of OpenStack
> APIs, if necessary. In the updated openstack module, I've changed the two
> main things. First, I've used the hostname in Computer table (unique in the
> same VCL database) to create an instance and get the instance id to
> terminate rather than using the openstackComputerMap table. This can avoid
> using an additional table and database transactions. Second, I've changed
> the openstackImageMap to openstackimagerevision table that maps the
> imagerevision id with the openstack image id. This table consists of three
> fields (imagerevisionid, imagedetails, flavordetails). The imagedetails and
> flavordetails contains the details image and flavor information with json
> format. Thus, when VCL creates an instance, it gets each detail information
> and parse them to find the corresponding openstack image id and flavor id.
> In addition, I've implemented the get_image_size() subroutine because the
> image size information was not supported in OpenStack ESSEX but it supports
> now. This is a short summary about the changes. So, if you have any concern
> or questions about the updates, please let me know. Thank you.
>
> Best regards,
> Young-Hyun
>
>
> On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <ca...@cybera.ca>
> wrote:
>
> > Sorry for the silence from my end, I realized I forgot to mention I was
> > going to be on vacation for the last week and a half. Anyways, it looks
> > like Young's updates have addressed the main concerns we were having with
> > regards to the command line client. Given the progress he's made we think
> > going ahead with his module makes the most sense.
> >
> > Cameron
> >
> >
> > On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <oh...@gmail.com>
> wrote:
> >
> > > Andy,
> > >
> > > Thank you for your comments. I've tried to apply what you addressed and
> > > committed my module again. This module finds all openstack information
> > > using OpenStack APIs and database. Thank you.
> > >
> > > Best regards,
> > > Young-Hyun
> > >
> > >
> > >
> > > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <an...@ncsu.edu>
> wrote:
> > >
> > > > Thanks Young. Looks good! If I understand correctly, you are
> avoiding
> > > the
> > > > need to use the CLI or cpan module by interacting directly with
> > OpenStack
> > > > via the REST API?
> > > >
> > > > It looks like the only commands you're running on the management node
> > are
> > > > "nova" and "qemu-img" in _get_flavor_type. Would it be possible to
> > > > accomplish this via the API? I haven't traced through how your code
> > > works
> > > > too deeply, but was wondering if the following could be used:
> > > > http://docs.openstack.org/api/openstack
> > > > -compute/2/content/Flavors-d1e4180.html
> > > >
> > > > It would be wonderful if you can eliminate the need for these to be
> > > > executed. This would mean a pure API solution with nothing special
> > > needing
> > > > to be installed on the management node.
> > > >
> > > > If you do need to call these commands, instead of using qx and
> > backticks
> > > > are used to run commands on the management node. Please change this
> to
> > > > use:
> > > > my ($exit_status, $output) = $self->mn_os->execute($command);
> > > >
> > > > Also, always, always, always make sure $output and anything else you
> > try
> > > to
> > > > parse with a regex are defined first. This will avoid some nasty
> "Use
> > of
> > > > uninitialized value in pattern match" errors which could potentially
> > lead
> > > > to the entire process dying.
> > > >
> > > > The indentation looks great! :) There are a few places where the
> > curly
> > > > bracket style could be modified. Just about all of the existing code
> > > > places opening brackets on the same line as the while/for statement
> > such
> > > > as:
> > > > while ($loop > 0) {
> > > > -instead of-
> > > > while ($loop > 0)
> > > > {
> > > >
> > > > Please add a pod "=head2 subroutine_name ... =cut" heading for every
> > > > subroutine. This is helpful for others to read/understand your code.
> > > The
> > > > pod syntax can be a bit finicky. You can tell if it is formatted
> > > properly
> > > > by running "pod2text openstack.pm".
> > > >
> > > > Lastly (as mainly a reminder), we will need to incorporate all of the
> > > > database changes in vcl.sql and whatever method we use for the next
> > > release
> > > > to replace update-vcl.sql. I made a reminder comment here:
> > > > https://issues.apache.org/jira/browse/VCL-764
> > > >
> > > > Regards,
> > > > Andy
> > > >
> > >
> >
>
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Cameron,
I hope you had a great time and welcome back to work :-). And, yes, the
OpenStack module with directly using OpenStack APIs can solve the concerns
we've discussed and it's more flexible to apply new version of OpenStack
APIs, if necessary. In the updated openstack module, I've changed the two
main things. First, I've used the hostname in Computer table (unique in the
same VCL database) to create an instance and get the instance id to
terminate rather than using the openstackComputerMap table. This can avoid
using an additional table and database transactions. Second, I've changed
the openstackImageMap to openstackimagerevision table that maps the
imagerevision id with the openstack image id. This table consists of three
fields (imagerevisionid, imagedetails, flavordetails). The imagedetails and
flavordetails contains the details image and flavor information with json
format. Thus, when VCL creates an instance, it gets each detail information
and parse them to find the corresponding openstack image id and flavor id.
In addition, I've implemented the get_image_size() subroutine because the
image size information was not supported in OpenStack ESSEX but it supports
now. This is a short summary about the changes. So, if you have any concern
or questions about the updates, please let me know. Thank you.
Best regards,
Young-Hyun
On Thu, Jul 17, 2014 at 11:53 AM, Cameron Mann <ca...@cybera.ca>
wrote:
> Sorry for the silence from my end, I realized I forgot to mention I was
> going to be on vacation for the last week and a half. Anyways, it looks
> like Young's updates have addressed the main concerns we were having with
> regards to the command line client. Given the progress he's made we think
> going ahead with his module makes the most sense.
>
> Cameron
>
>
> On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <oh...@gmail.com> wrote:
>
> > Andy,
> >
> > Thank you for your comments. I've tried to apply what you addressed and
> > committed my module again. This module finds all openstack information
> > using OpenStack APIs and database. Thank you.
> >
> > Best regards,
> > Young-Hyun
> >
> >
> >
> > On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <an...@ncsu.edu> wrote:
> >
> > > Thanks Young. Looks good! If I understand correctly, you are avoiding
> > the
> > > need to use the CLI or cpan module by interacting directly with
> OpenStack
> > > via the REST API?
> > >
> > > It looks like the only commands you're running on the management node
> are
> > > "nova" and "qemu-img" in _get_flavor_type. Would it be possible to
> > > accomplish this via the API? I haven't traced through how your code
> > works
> > > too deeply, but was wondering if the following could be used:
> > > http://docs.openstack.org/api/openstack
> > > -compute/2/content/Flavors-d1e4180.html
> > >
> > > It would be wonderful if you can eliminate the need for these to be
> > > executed. This would mean a pure API solution with nothing special
> > needing
> > > to be installed on the management node.
> > >
> > > If you do need to call these commands, instead of using qx and
> backticks
> > > are used to run commands on the management node. Please change this to
> > > use:
> > > my ($exit_status, $output) = $self->mn_os->execute($command);
> > >
> > > Also, always, always, always make sure $output and anything else you
> try
> > to
> > > parse with a regex are defined first. This will avoid some nasty "Use
> of
> > > uninitialized value in pattern match" errors which could potentially
> lead
> > > to the entire process dying.
> > >
> > > The indentation looks great! :) There are a few places where the
> curly
> > > bracket style could be modified. Just about all of the existing code
> > > places opening brackets on the same line as the while/for statement
> such
> > > as:
> > > while ($loop > 0) {
> > > -instead of-
> > > while ($loop > 0)
> > > {
> > >
> > > Please add a pod "=head2 subroutine_name ... =cut" heading for every
> > > subroutine. This is helpful for others to read/understand your code.
> > The
> > > pod syntax can be a bit finicky. You can tell if it is formatted
> > properly
> > > by running "pod2text openstack.pm".
> > >
> > > Lastly (as mainly a reminder), we will need to incorporate all of the
> > > database changes in vcl.sql and whatever method we use for the next
> > release
> > > to replace update-vcl.sql. I made a reminder comment here:
> > > https://issues.apache.org/jira/browse/VCL-764
> > >
> > > Regards,
> > > Andy
> > >
> >
>
Re: OpenStack Module
Posted by Cameron Mann <ca...@cybera.ca>.
Sorry for the silence from my end, I realized I forgot to mention I was
going to be on vacation for the last week and a half. Anyways, it looks
like Young's updates have addressed the main concerns we were having with
regards to the command line client. Given the progress he's made we think
going ahead with his module makes the most sense.
Cameron
On Wed, Jul 16, 2014 at 9:27 AM, YOUNG OH <oh...@gmail.com> wrote:
> Andy,
>
> Thank you for your comments. I've tried to apply what you addressed and
> committed my module again. This module finds all openstack information
> using OpenStack APIs and database. Thank you.
>
> Best regards,
> Young-Hyun
>
>
>
> On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <an...@ncsu.edu> wrote:
>
> > Thanks Young. Looks good! If I understand correctly, you are avoiding
> the
> > need to use the CLI or cpan module by interacting directly with OpenStack
> > via the REST API?
> >
> > It looks like the only commands you're running on the management node are
> > "nova" and "qemu-img" in _get_flavor_type. Would it be possible to
> > accomplish this via the API? I haven't traced through how your code
> works
> > too deeply, but was wondering if the following could be used:
> > http://docs.openstack.org/api/openstack
> > -compute/2/content/Flavors-d1e4180.html
> >
> > It would be wonderful if you can eliminate the need for these to be
> > executed. This would mean a pure API solution with nothing special
> needing
> > to be installed on the management node.
> >
> > If you do need to call these commands, instead of using qx and backticks
> > are used to run commands on the management node. Please change this to
> > use:
> > my ($exit_status, $output) = $self->mn_os->execute($command);
> >
> > Also, always, always, always make sure $output and anything else you try
> to
> > parse with a regex are defined first. This will avoid some nasty "Use of
> > uninitialized value in pattern match" errors which could potentially lead
> > to the entire process dying.
> >
> > The indentation looks great! :) There are a few places where the curly
> > bracket style could be modified. Just about all of the existing code
> > places opening brackets on the same line as the while/for statement such
> > as:
> > while ($loop > 0) {
> > -instead of-
> > while ($loop > 0)
> > {
> >
> > Please add a pod "=head2 subroutine_name ... =cut" heading for every
> > subroutine. This is helpful for others to read/understand your code.
> The
> > pod syntax can be a bit finicky. You can tell if it is formatted
> properly
> > by running "pod2text openstack.pm".
> >
> > Lastly (as mainly a reminder), we will need to incorporate all of the
> > database changes in vcl.sql and whatever method we use for the next
> release
> > to replace update-vcl.sql. I made a reminder comment here:
> > https://issues.apache.org/jira/browse/VCL-764
> >
> > Regards,
> > Andy
> >
>
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Andy,
Thank you for your comments. I've tried to apply what you addressed and
committed my module again. This module finds all openstack information
using OpenStack APIs and database. Thank you.
Best regards,
Young-Hyun
On Wed, Jul 9, 2014 at 10:24 AM, Andy Kurth <an...@ncsu.edu> wrote:
> Thanks Young. Looks good! If I understand correctly, you are avoiding the
> need to use the CLI or cpan module by interacting directly with OpenStack
> via the REST API?
>
> It looks like the only commands you're running on the management node are
> "nova" and "qemu-img" in _get_flavor_type. Would it be possible to
> accomplish this via the API? I haven't traced through how your code works
> too deeply, but was wondering if the following could be used:
> http://docs.openstack.org/api/openstack
> -compute/2/content/Flavors-d1e4180.html
>
> It would be wonderful if you can eliminate the need for these to be
> executed. This would mean a pure API solution with nothing special needing
> to be installed on the management node.
>
> If you do need to call these commands, instead of using qx and backticks
> are used to run commands on the management node. Please change this to
> use:
> my ($exit_status, $output) = $self->mn_os->execute($command);
>
> Also, always, always, always make sure $output and anything else you try to
> parse with a regex are defined first. This will avoid some nasty "Use of
> uninitialized value in pattern match" errors which could potentially lead
> to the entire process dying.
>
> The indentation looks great! :) There are a few places where the curly
> bracket style could be modified. Just about all of the existing code
> places opening brackets on the same line as the while/for statement such
> as:
> while ($loop > 0) {
> -instead of-
> while ($loop > 0)
> {
>
> Please add a pod "=head2 subroutine_name ... =cut" heading for every
> subroutine. This is helpful for others to read/understand your code. The
> pod syntax can be a bit finicky. You can tell if it is formatted properly
> by running "pod2text openstack.pm".
>
> Lastly (as mainly a reminder), we will need to incorporate all of the
> database changes in vcl.sql and whatever method we use for the next release
> to replace update-vcl.sql. I made a reminder comment here:
> https://issues.apache.org/jira/browse/VCL-764
>
> Regards,
> Andy
>
Re: OpenStack Module
Posted by Andy Kurth <an...@ncsu.edu>.
Thanks Young. Looks good! If I understand correctly, you are avoiding the
need to use the CLI or cpan module by interacting directly with OpenStack
via the REST API?
It looks like the only commands you're running on the management node are
"nova" and "qemu-img" in _get_flavor_type. Would it be possible to
accomplish this via the API? I haven't traced through how your code works
too deeply, but was wondering if the following could be used:
http://docs.openstack.org/api/openstack
-compute/2/content/Flavors-d1e4180.html
It would be wonderful if you can eliminate the need for these to be
executed. This would mean a pure API solution with nothing special needing
to be installed on the management node.
If you do need to call these commands, instead of using qx and backticks
are used to run commands on the management node. Please change this to use:
my ($exit_status, $output) = $self->mn_os->execute($command);
Also, always, always, always make sure $output and anything else you try to
parse with a regex are defined first. This will avoid some nasty "Use of
uninitialized value in pattern match" errors which could potentially lead
to the entire process dying.
The indentation looks great! :) There are a few places where the curly
bracket style could be modified. Just about all of the existing code
places opening brackets on the same line as the while/for statement such as:
while ($loop > 0) {
-instead of-
while ($loop > 0)
{
Please add a pod "=head2 subroutine_name ... =cut" heading for every
subroutine. This is helpful for others to read/understand your code. The
pod syntax can be a bit finicky. You can tell if it is formatted properly
by running "pod2text openstack.pm".
Lastly (as mainly a reminder), we will need to incorporate all of the
database changes in vcl.sql and whatever method we use for the next release
to replace update-vcl.sql. I made a reminder comment here:
https://issues.apache.org/jira/browse/VCL-764
Regards,
Andy
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Hi All,
I've committed my OpenStack module that replaced OpenStack CLIs to
OpenStack Compute APIs v2. I've took a look at the details of OpenStack
Perl SDKs and referred some of their features to my module like how it
handles OpenStack Compute APIs. This update OpenStack module uses
LWP::UserAgent (OpenStack Perl SDKs uses both LWP and HTTP::Request) to
both dispatch web requests and receive responses so that it can avoid
parsing text outputs from running OpenStack CLIs (previous module) and also
can avoid using OpenStack Perl SDKs. Thus, I think this update module can
be a solution to integrate two versions of OpenStack Modules. I've tested
the update module in RHEL 6.5 x64 with OpenStack Icehouse and I could
successfully provisioning and capturing a CentOS 6.3 x64. Please check the
update opentack module (
https://svn.apache.org/repos/asf/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm)
and let me know about your opinions.
Thanks,
Young-Hyun
On Tue, Jul 1, 2014 at 12:29 PM, YOUNG OH <oh...@gmail.com> wrote:
> Hi Christopher,
>
> As I know, the format option is available for the openstack-neutronclient
> but not openstack-novaclient yet.
>
> -Young
>
>
> On Mon, Jun 30, 2014 at 4:11 PM, Christopher Wolfe <ch...@vt.edu>
> wrote:
>
>> Cameron,
>> AFAICT, the [--request-format {json,xml}] option is applicable to
>> virtually all of the latest CLI executables. Whether or not they correctly
>> observe the options, I can't say. I've used the CLI commands extensively,
>> but have only ever needed the default table format. I'll try and assess the
>> current state of JSON output compliance and get back to you.
>>
>> Regards,
>> Chris
>>
>> -----Original Message-----
>> From: Cameron Mann [mailto:cameron.mann@cybera.ca]
>> Sent: Monday, June 30, 2014 3:13 PM
>> To: dev@vcl.apache.org
>> Subject: Re: OpenStack Module
>>
>> Chris,
>>
>> Do you (or anyone else for that matter) know if there are plans for the
>> option of a standardized output format in the CLI? It doesn't seem to exist
>> now, though I did find a ticket for JSON output (
>> https://bugs.launchpad.net/python-novaclient/+bug/1254351), but it was
>> closed because another patch that included the same functionality was in
>> progress, and I couldn't find any more details. If that feature was
>> available it would make a good middle ground.
>>
>> Cameron
>>
>>
>> On Wed, Jun 25, 2014 at 1:00 PM, Christopher Wolfe <ch...@vt.edu>
>> wrote:
>>
>> > Cameron, All,
>> > I agree that, in principle text processing is fragile, but I
>> > think that the salient point is that the PERL library is not well
>> > supported (assuming that is, in fact, the case). Around the
>> > Essex-Folsom transition, there were a bunch of OpenStack API changes
>> > that renamed various CLI options, etc. The intent appears to have been
>> > to standardize the symbology across the various APIs, a goal which I
>> believe they have largely achieved.
>> > I'm not 100% hip with upcoming changes in OpenStack, but the only CLI
>> > changes I can see coming are possibly updating any holdover
>> > quantum-xxx to neutron-xxx names (most of these are already updated,
>> > but there may be a few; ones I've noticed have been in config files,
>> > and not the CLI API anyway). However, the output format of the
>> > OpenStack APIs has become quite standardized (commands generally
>> > output one of three formats: table, XML(YAML?), JSON, or can produce
>> > custom format specified by CLI options). I think the problem with
>> > investing in the PERL API is that you'll be stuck with whatever level
>> > of support the maintainer provides, ad infinitum. On the other hand,
>> > working with Young Oh's code means that necessary changes can be made
>> > expediently and without hacks around a middle-man. In short, I don't
>> > see the OpenStack API changing at a pace that would render Young's
>> > code obsolete, but I could imagine a scenario where the PERL module
>> > becomes out of date and requires special effort to prop up. Of course,
>> the point is moot if the PERL api is, in fact, well supported.
>> > As an aside, the burden of text processing could be alleviated
>> > somewhat by using the JSON output format and letting well-worn
>> > libraries do the actual parsing.
>> >
>> > Regards,
>> > Chris
>> >
>> >
>> > -----Original Message-----
>> > From: Cameron Mann [mailto:cameron.mann@cybera.ca]
>> > Sent: Wednesday, June 25, 2014 2:38 PM
>> > To: dev@vcl.apache.org
>> > Subject: Re: OpenStack Module
>> >
>> > Hi all,
>> >
>> > We had a call earlier today to discuss which OpenStack module we
>> > should focus our development efforts on and at this point a community
>> > decision is required. For reference, Young Oh's module is available in
>> > trunk and ours is on GitHub
>> > (https://github.com/cybera/openstack-vcl-module). Our module is based
>> > off Young's original module which we've also used successfully in
>> > production with only minor modifications. Both modules are perfectly
>> > feasible, and I think the end product won't differ much regardless of
>> which we use, but there is one key decision that needs to be made.
>> >
>> > Young's module currently calls out to and parses the output of the
>> > Nova command line client to interact with the OpenStack API whereas we
>> > use a third-party Perl SDK (
>> https://github.com/ironcamel/Net-OpenStack-Compute).
>> > The command line client is a more difficult and fragile approach
>> > (parsing textual output), but it's an official OpenStack package.
>> > There's no risk of it lagging behind OpenStack releases, so while
>> > breakages are more likely, they'll occur in areas that we can fix in
>> > the provisioning module. The SDK is easier and safer to work with
>> > since it's a programmatic way of accessing the API, but it's a third
>> > party package maintained by apparently one person. I believe
>> > OpenStack's API has generally been very stable; new features are added
>> > instead of changing existing ones, but there's always the remote
>> > possibility a change breaks the SDK and it never gets fixed which would
>> require replacing it with something else.
>> >
>> > There are other differences between the modules, but they're
>> > relatively minor and are going to be changed for general release
>> > regardless so the choice really comes down to which of these
>> > approaches the community would prefer.
>> >
>> > Cameron
>> >
>> >
>> > On Mon, Jun 16, 2014 at 9:59 AM, Andy Kurth <an...@ncsu.edu>
>> wrote:
>> >
>> > > I think we're all in agreement that removing dependencies on
>> > > /etc/hosts is an improvement. I'm working on this and should have
>> > > the changes committed this week.
>> > >
>> > > To summarize the situation and changes, the backend code currently
>> > > reads /etc/hosts in order to determine the private IP address of a
>> > > node. It does not rely on the computer.privateIPaddress field in
>> > > the database. Several node configuration tasks depend on knowing
>> > > the
>> > correct private IP address.
>> > > The backend code also currently uses the computer.hostname value to
>> > > SSH into nodes. As a result, it depends on hostname-private IP
>> > > address resolution working correctly -- which is usually
>> > > accomplished via /etc/hosts.
>> > >
>> > > I will change the code to:
>> > > (1) Not read or reference /etc/hosts at all
>> > > (2) Use the computer.privateIPaddress field as the authoritative
>> > > value
>> > > (3) Use the private IP address instead of the hostname for all SSH
>> > > and other connections
>> > > (4) Add utils.pm::update_private_ip_address
>> > >
>> > > This will allow any provisioning module to have control over how
>> > > private IP addresses are allocated. If they are dynamically
>> > > allocated when a node is loaded or instantiated, the provisioning
>> > > module can retrieve the dynamic private IP address from Openstack or
>> > > some other provisioning API, and call update_private_ip_address to
>> > > set the correct value in the database. The provisioning module
>> > > should also call
>> > $self->data->set_private_ip_address.
>> > > When control is passed from the provisioning to the OS module,
>> > > everything should be set up correctly.
>> > >
>> > > -Andy
>> > >
>> >
>> >
>>
>>
>
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Hi Christopher,
As I know, the format option is available for the openstack-neutronclient
but not openstack-novaclient yet.
-Young
On Mon, Jun 30, 2014 at 4:11 PM, Christopher Wolfe <ch...@vt.edu> wrote:
> Cameron,
> AFAICT, the [--request-format {json,xml}] option is applicable to
> virtually all of the latest CLI executables. Whether or not they correctly
> observe the options, I can't say. I've used the CLI commands extensively,
> but have only ever needed the default table format. I'll try and assess the
> current state of JSON output compliance and get back to you.
>
> Regards,
> Chris
>
> -----Original Message-----
> From: Cameron Mann [mailto:cameron.mann@cybera.ca]
> Sent: Monday, June 30, 2014 3:13 PM
> To: dev@vcl.apache.org
> Subject: Re: OpenStack Module
>
> Chris,
>
> Do you (or anyone else for that matter) know if there are plans for the
> option of a standardized output format in the CLI? It doesn't seem to exist
> now, though I did find a ticket for JSON output (
> https://bugs.launchpad.net/python-novaclient/+bug/1254351), but it was
> closed because another patch that included the same functionality was in
> progress, and I couldn't find any more details. If that feature was
> available it would make a good middle ground.
>
> Cameron
>
>
> On Wed, Jun 25, 2014 at 1:00 PM, Christopher Wolfe <ch...@vt.edu>
> wrote:
>
> > Cameron, All,
> > I agree that, in principle text processing is fragile, but I
> > think that the salient point is that the PERL library is not well
> > supported (assuming that is, in fact, the case). Around the
> > Essex-Folsom transition, there were a bunch of OpenStack API changes
> > that renamed various CLI options, etc. The intent appears to have been
> > to standardize the symbology across the various APIs, a goal which I
> believe they have largely achieved.
> > I'm not 100% hip with upcoming changes in OpenStack, but the only CLI
> > changes I can see coming are possibly updating any holdover
> > quantum-xxx to neutron-xxx names (most of these are already updated,
> > but there may be a few; ones I've noticed have been in config files,
> > and not the CLI API anyway). However, the output format of the
> > OpenStack APIs has become quite standardized (commands generally
> > output one of three formats: table, XML(YAML?), JSON, or can produce
> > custom format specified by CLI options). I think the problem with
> > investing in the PERL API is that you'll be stuck with whatever level
> > of support the maintainer provides, ad infinitum. On the other hand,
> > working with Young Oh's code means that necessary changes can be made
> > expediently and without hacks around a middle-man. In short, I don't
> > see the OpenStack API changing at a pace that would render Young's
> > code obsolete, but I could imagine a scenario where the PERL module
> > becomes out of date and requires special effort to prop up. Of course,
> the point is moot if the PERL api is, in fact, well supported.
> > As an aside, the burden of text processing could be alleviated
> > somewhat by using the JSON output format and letting well-worn
> > libraries do the actual parsing.
> >
> > Regards,
> > Chris
> >
> >
> > -----Original Message-----
> > From: Cameron Mann [mailto:cameron.mann@cybera.ca]
> > Sent: Wednesday, June 25, 2014 2:38 PM
> > To: dev@vcl.apache.org
> > Subject: Re: OpenStack Module
> >
> > Hi all,
> >
> > We had a call earlier today to discuss which OpenStack module we
> > should focus our development efforts on and at this point a community
> > decision is required. For reference, Young Oh's module is available in
> > trunk and ours is on GitHub
> > (https://github.com/cybera/openstack-vcl-module). Our module is based
> > off Young's original module which we've also used successfully in
> > production with only minor modifications. Both modules are perfectly
> > feasible, and I think the end product won't differ much regardless of
> which we use, but there is one key decision that needs to be made.
> >
> > Young's module currently calls out to and parses the output of the
> > Nova command line client to interact with the OpenStack API whereas we
> > use a third-party Perl SDK (
> https://github.com/ironcamel/Net-OpenStack-Compute).
> > The command line client is a more difficult and fragile approach
> > (parsing textual output), but it's an official OpenStack package.
> > There's no risk of it lagging behind OpenStack releases, so while
> > breakages are more likely, they'll occur in areas that we can fix in
> > the provisioning module. The SDK is easier and safer to work with
> > since it's a programmatic way of accessing the API, but it's a third
> > party package maintained by apparently one person. I believe
> > OpenStack's API has generally been very stable; new features are added
> > instead of changing existing ones, but there's always the remote
> > possibility a change breaks the SDK and it never gets fixed which would
> require replacing it with something else.
> >
> > There are other differences between the modules, but they're
> > relatively minor and are going to be changed for general release
> > regardless so the choice really comes down to which of these
> > approaches the community would prefer.
> >
> > Cameron
> >
> >
> > On Mon, Jun 16, 2014 at 9:59 AM, Andy Kurth <an...@ncsu.edu> wrote:
> >
> > > I think we're all in agreement that removing dependencies on
> > > /etc/hosts is an improvement. I'm working on this and should have
> > > the changes committed this week.
> > >
> > > To summarize the situation and changes, the backend code currently
> > > reads /etc/hosts in order to determine the private IP address of a
> > > node. It does not rely on the computer.privateIPaddress field in
> > > the database. Several node configuration tasks depend on knowing
> > > the
> > correct private IP address.
> > > The backend code also currently uses the computer.hostname value to
> > > SSH into nodes. As a result, it depends on hostname-private IP
> > > address resolution working correctly -- which is usually
> > > accomplished via /etc/hosts.
> > >
> > > I will change the code to:
> > > (1) Not read or reference /etc/hosts at all
> > > (2) Use the computer.privateIPaddress field as the authoritative
> > > value
> > > (3) Use the private IP address instead of the hostname for all SSH
> > > and other connections
> > > (4) Add utils.pm::update_private_ip_address
> > >
> > > This will allow any provisioning module to have control over how
> > > private IP addresses are allocated. If they are dynamically
> > > allocated when a node is loaded or instantiated, the provisioning
> > > module can retrieve the dynamic private IP address from Openstack or
> > > some other provisioning API, and call update_private_ip_address to
> > > set the correct value in the database. The provisioning module
> > > should also call
> > $self->data->set_private_ip_address.
> > > When control is passed from the provisioning to the OS module,
> > > everything should be set up correctly.
> > >
> > > -Andy
> > >
> >
> >
>
>
RE: OpenStack Module
Posted by Christopher Wolfe <ch...@vt.edu>.
Cameron,
AFAICT, the [--request-format {json,xml}] option is applicable to virtually all of the latest CLI executables. Whether or not they correctly observe the options, I can't say. I've used the CLI commands extensively, but have only ever needed the default table format. I'll try and assess the current state of JSON output compliance and get back to you.
Regards,
Chris
-----Original Message-----
From: Cameron Mann [mailto:cameron.mann@cybera.ca]
Sent: Monday, June 30, 2014 3:13 PM
To: dev@vcl.apache.org
Subject: Re: OpenStack Module
Chris,
Do you (or anyone else for that matter) know if there are plans for the option of a standardized output format in the CLI? It doesn't seem to exist now, though I did find a ticket for JSON output ( https://bugs.launchpad.net/python-novaclient/+bug/1254351), but it was closed because another patch that included the same functionality was in progress, and I couldn't find any more details. If that feature was available it would make a good middle ground.
Cameron
On Wed, Jun 25, 2014 at 1:00 PM, Christopher Wolfe <ch...@vt.edu> wrote:
> Cameron, All,
> I agree that, in principle text processing is fragile, but I
> think that the salient point is that the PERL library is not well
> supported (assuming that is, in fact, the case). Around the
> Essex-Folsom transition, there were a bunch of OpenStack API changes
> that renamed various CLI options, etc. The intent appears to have been
> to standardize the symbology across the various APIs, a goal which I believe they have largely achieved.
> I'm not 100% hip with upcoming changes in OpenStack, but the only CLI
> changes I can see coming are possibly updating any holdover
> quantum-xxx to neutron-xxx names (most of these are already updated,
> but there may be a few; ones I've noticed have been in config files,
> and not the CLI API anyway). However, the output format of the
> OpenStack APIs has become quite standardized (commands generally
> output one of three formats: table, XML(YAML?), JSON, or can produce
> custom format specified by CLI options). I think the problem with
> investing in the PERL API is that you'll be stuck with whatever level
> of support the maintainer provides, ad infinitum. On the other hand,
> working with Young Oh's code means that necessary changes can be made
> expediently and without hacks around a middle-man. In short, I don't
> see the OpenStack API changing at a pace that would render Young's
> code obsolete, but I could imagine a scenario where the PERL module
> becomes out of date and requires special effort to prop up. Of course, the point is moot if the PERL api is, in fact, well supported.
> As an aside, the burden of text processing could be alleviated
> somewhat by using the JSON output format and letting well-worn
> libraries do the actual parsing.
>
> Regards,
> Chris
>
>
> -----Original Message-----
> From: Cameron Mann [mailto:cameron.mann@cybera.ca]
> Sent: Wednesday, June 25, 2014 2:38 PM
> To: dev@vcl.apache.org
> Subject: Re: OpenStack Module
>
> Hi all,
>
> We had a call earlier today to discuss which OpenStack module we
> should focus our development efforts on and at this point a community
> decision is required. For reference, Young Oh's module is available in
> trunk and ours is on GitHub
> (https://github.com/cybera/openstack-vcl-module). Our module is based
> off Young's original module which we've also used successfully in
> production with only minor modifications. Both modules are perfectly
> feasible, and I think the end product won't differ much regardless of which we use, but there is one key decision that needs to be made.
>
> Young's module currently calls out to and parses the output of the
> Nova command line client to interact with the OpenStack API whereas we
> use a third-party Perl SDK (https://github.com/ironcamel/Net-OpenStack-Compute).
> The command line client is a more difficult and fragile approach
> (parsing textual output), but it's an official OpenStack package.
> There's no risk of it lagging behind OpenStack releases, so while
> breakages are more likely, they'll occur in areas that we can fix in
> the provisioning module. The SDK is easier and safer to work with
> since it's a programmatic way of accessing the API, but it's a third
> party package maintained by apparently one person. I believe
> OpenStack's API has generally been very stable; new features are added
> instead of changing existing ones, but there's always the remote
> possibility a change breaks the SDK and it never gets fixed which would require replacing it with something else.
>
> There are other differences between the modules, but they're
> relatively minor and are going to be changed for general release
> regardless so the choice really comes down to which of these
> approaches the community would prefer.
>
> Cameron
>
>
> On Mon, Jun 16, 2014 at 9:59 AM, Andy Kurth <an...@ncsu.edu> wrote:
>
> > I think we're all in agreement that removing dependencies on
> > /etc/hosts is an improvement. I'm working on this and should have
> > the changes committed this week.
> >
> > To summarize the situation and changes, the backend code currently
> > reads /etc/hosts in order to determine the private IP address of a
> > node. It does not rely on the computer.privateIPaddress field in
> > the database. Several node configuration tasks depend on knowing
> > the
> correct private IP address.
> > The backend code also currently uses the computer.hostname value to
> > SSH into nodes. As a result, it depends on hostname-private IP
> > address resolution working correctly -- which is usually
> > accomplished via /etc/hosts.
> >
> > I will change the code to:
> > (1) Not read or reference /etc/hosts at all
> > (2) Use the computer.privateIPaddress field as the authoritative
> > value
> > (3) Use the private IP address instead of the hostname for all SSH
> > and other connections
> > (4) Add utils.pm::update_private_ip_address
> >
> > This will allow any provisioning module to have control over how
> > private IP addresses are allocated. If they are dynamically
> > allocated when a node is loaded or instantiated, the provisioning
> > module can retrieve the dynamic private IP address from Openstack or
> > some other provisioning API, and call update_private_ip_address to
> > set the correct value in the database. The provisioning module
> > should also call
> $self->data->set_private_ip_address.
> > When control is passed from the provisioning to the OS module,
> > everything should be set up correctly.
> >
> > -Andy
> >
>
>
Re: OpenStack Module
Posted by Cameron Mann <ca...@cybera.ca>.
Chris,
Do you (or anyone else for that matter) know if there are plans for the
option of a standardized output format in the CLI? It doesn't seem to exist
now, though I did find a ticket for JSON output (
https://bugs.launchpad.net/python-novaclient/+bug/1254351), but it was
closed because another patch that included the same functionality was in
progress, and I couldn't find any more details. If that feature was
available it would make a good middle ground.
Cameron
On Wed, Jun 25, 2014 at 1:00 PM, Christopher Wolfe <ch...@vt.edu> wrote:
> Cameron, All,
> I agree that, in principle text processing is fragile, but I think
> that the salient point is that the PERL library is not well supported
> (assuming that is, in fact, the case). Around the Essex-Folsom transition,
> there were a bunch of OpenStack API changes that renamed various CLI
> options, etc. The intent appears to have been to standardize the symbology
> across the various APIs, a goal which I believe they have largely achieved.
> I'm not 100% hip with upcoming changes in OpenStack, but the only CLI
> changes I can see coming are possibly updating any holdover quantum-xxx to
> neutron-xxx names (most of these are already updated, but there may be a
> few; ones I've noticed have been in config files, and not the CLI API
> anyway). However, the output format of the OpenStack APIs has become quite
> standardized (commands generally output one of three formats: table,
> XML(YAML?), JSON, or can produce custom format specified by CLI options). I
> think the problem with investing in the PERL API is that you'll be stuck
> with whatever level of support the maintainer provides, ad infinitum. On
> the other hand, working with Young Oh's code means that necessary changes
> can be made expediently and without hacks around a middle-man. In short, I
> don't see the OpenStack API changing at a pace that would render Young's
> code obsolete, but I could imagine a scenario where the PERL module becomes
> out of date and requires special effort to prop up. Of course, the point is
> moot if the PERL api is, in fact, well supported.
> As an aside, the burden of text processing could be alleviated
> somewhat by using the JSON output format and letting well-worn libraries do
> the actual parsing.
>
> Regards,
> Chris
>
>
> -----Original Message-----
> From: Cameron Mann [mailto:cameron.mann@cybera.ca]
> Sent: Wednesday, June 25, 2014 2:38 PM
> To: dev@vcl.apache.org
> Subject: Re: OpenStack Module
>
> Hi all,
>
> We had a call earlier today to discuss which OpenStack module we should
> focus our development efforts on and at this point a community decision is
> required. For reference, Young Oh's module is available in trunk and ours
> is on GitHub (https://github.com/cybera/openstack-vcl-module). Our module
> is based off Young's original module which we've also used successfully in
> production with only minor modifications. Both modules are perfectly
> feasible, and I think the end product won't differ much regardless of which
> we use, but there is one key decision that needs to be made.
>
> Young's module currently calls out to and parses the output of the Nova
> command line client to interact with the OpenStack API whereas we use a
> third-party Perl SDK (https://github.com/ironcamel/Net-OpenStack-Compute).
> The command line client is a more difficult and fragile approach (parsing
> textual output), but it's an official OpenStack package. There's no risk of
> it lagging behind OpenStack releases, so while breakages are more likely,
> they'll occur in areas that we can fix in the provisioning module. The SDK
> is easier and safer to work with since it's a programmatic way of accessing
> the API, but it's a third party package maintained by apparently one
> person. I believe OpenStack's API has generally been very stable; new
> features are added instead of changing existing ones, but there's always
> the remote possibility a change breaks the SDK and it never gets fixed
> which would require replacing it with something else.
>
> There are other differences between the modules, but they're relatively
> minor and are going to be changed for general release regardless so the
> choice really comes down to which of these approaches the community would
> prefer.
>
> Cameron
>
>
> On Mon, Jun 16, 2014 at 9:59 AM, Andy Kurth <an...@ncsu.edu> wrote:
>
> > I think we're all in agreement that removing dependencies on
> > /etc/hosts is an improvement. I'm working on this and should have the
> > changes committed this week.
> >
> > To summarize the situation and changes, the backend code currently
> > reads /etc/hosts in order to determine the private IP address of a
> > node. It does not rely on the computer.privateIPaddress field in the
> > database. Several node configuration tasks depend on knowing the
> correct private IP address.
> > The backend code also currently uses the computer.hostname value to
> > SSH into nodes. As a result, it depends on hostname-private IP
> > address resolution working correctly -- which is usually accomplished
> > via /etc/hosts.
> >
> > I will change the code to:
> > (1) Not read or reference /etc/hosts at all
> > (2) Use the computer.privateIPaddress field as the authoritative value
> > (3) Use the private IP address instead of the hostname for all SSH and
> > other connections
> > (4) Add utils.pm::update_private_ip_address
> >
> > This will allow any provisioning module to have control over how
> > private IP addresses are allocated. If they are dynamically allocated
> > when a node is loaded or instantiated, the provisioning module can
> > retrieve the dynamic private IP address from Openstack or some other
> > provisioning API, and call update_private_ip_address to set the
> > correct value in the database. The provisioning module should also call
> $self->data->set_private_ip_address.
> > When control is passed from the provisioning to the OS module,
> > everything should be set up correctly.
> >
> > -Andy
> >
>
>
RE: OpenStack Module
Posted by Christopher Wolfe <ch...@vt.edu>.
Cameron, All,
I agree that, in principle text processing is fragile, but I think that the salient point is that the PERL library is not well supported (assuming that is, in fact, the case). Around the Essex-Folsom transition, there were a bunch of OpenStack API changes that renamed various CLI options, etc. The intent appears to have been to standardize the symbology across the various APIs, a goal which I believe they have largely achieved. I'm not 100% hip with upcoming changes in OpenStack, but the only CLI changes I can see coming are possibly updating any holdover quantum-xxx to neutron-xxx names (most of these are already updated, but there may be a few; ones I've noticed have been in config files, and not the CLI API anyway). However, the output format of the OpenStack APIs has become quite standardized (commands generally output one of three formats: table, XML(YAML?), JSON, or can produce custom format specified by CLI options). I think the problem with investing in the PERL API is that you'll be stuck with whatever level of support the maintainer provides, ad infinitum. On the other hand, working with Young Oh's code means that necessary changes can be made expediently and without hacks around a middle-man. In short, I don't see the OpenStack API changing at a pace that would render Young's code obsolete, but I could imagine a scenario where the PERL module becomes out of date and requires special effort to prop up. Of course, the point is moot if the PERL api is, in fact, well supported.
As an aside, the burden of text processing could be alleviated somewhat by using the JSON output format and letting well-worn libraries do the actual parsing.
Regards,
Chris
-----Original Message-----
From: Cameron Mann [mailto:cameron.mann@cybera.ca]
Sent: Wednesday, June 25, 2014 2:38 PM
To: dev@vcl.apache.org
Subject: Re: OpenStack Module
Hi all,
We had a call earlier today to discuss which OpenStack module we should focus our development efforts on and at this point a community decision is required. For reference, Young Oh's module is available in trunk and ours is on GitHub (https://github.com/cybera/openstack-vcl-module). Our module is based off Young's original module which we've also used successfully in production with only minor modifications. Both modules are perfectly feasible, and I think the end product won't differ much regardless of which we use, but there is one key decision that needs to be made.
Young's module currently calls out to and parses the output of the Nova command line client to interact with the OpenStack API whereas we use a third-party Perl SDK (https://github.com/ironcamel/Net-OpenStack-Compute).
The command line client is a more difficult and fragile approach (parsing textual output), but it's an official OpenStack package. There's no risk of it lagging behind OpenStack releases, so while breakages are more likely, they'll occur in areas that we can fix in the provisioning module. The SDK is easier and safer to work with since it's a programmatic way of accessing the API, but it's a third party package maintained by apparently one person. I believe OpenStack's API has generally been very stable; new features are added instead of changing existing ones, but there's always the remote possibility a change breaks the SDK and it never gets fixed which would require replacing it with something else.
There are other differences between the modules, but they're relatively minor and are going to be changed for general release regardless so the choice really comes down to which of these approaches the community would prefer.
Cameron
On Mon, Jun 16, 2014 at 9:59 AM, Andy Kurth <an...@ncsu.edu> wrote:
> I think we're all in agreement that removing dependencies on
> /etc/hosts is an improvement. I'm working on this and should have the
> changes committed this week.
>
> To summarize the situation and changes, the backend code currently
> reads /etc/hosts in order to determine the private IP address of a
> node. It does not rely on the computer.privateIPaddress field in the
> database. Several node configuration tasks depend on knowing the correct private IP address.
> The backend code also currently uses the computer.hostname value to
> SSH into nodes. As a result, it depends on hostname-private IP
> address resolution working correctly -- which is usually accomplished
> via /etc/hosts.
>
> I will change the code to:
> (1) Not read or reference /etc/hosts at all
> (2) Use the computer.privateIPaddress field as the authoritative value
> (3) Use the private IP address instead of the hostname for all SSH and
> other connections
> (4) Add utils.pm::update_private_ip_address
>
> This will allow any provisioning module to have control over how
> private IP addresses are allocated. If they are dynamically allocated
> when a node is loaded or instantiated, the provisioning module can
> retrieve the dynamic private IP address from Openstack or some other
> provisioning API, and call update_private_ip_address to set the
> correct value in the database. The provisioning module should also call $self->data->set_private_ip_address.
> When control is passed from the provisioning to the OS module,
> everything should be set up correctly.
>
> -Andy
>
Re: OpenStack Module
Posted by Cameron Mann <ca...@cybera.ca>.
Hi all,
We had a call earlier today to discuss which OpenStack module we should
focus our development efforts on and at this point a community decision is
required. For reference, Young Oh's module is available in trunk and ours
is on GitHub (https://github.com/cybera/openstack-vcl-module). Our module
is based off Young's original module which we've also used successfully in
production with only minor modifications. Both modules are perfectly
feasible, and I think the end product won't differ much regardless of which
we use, but there is one key decision that needs to be made.
Young's module currently calls out to and parses the output of the Nova
command line client to interact with the OpenStack API whereas we use a
third-party Perl SDK (https://github.com/ironcamel/Net-OpenStack-Compute).
The command line client is a more difficult and fragile approach (parsing
textual output), but it's an official OpenStack package. There's no risk of
it lagging behind OpenStack releases, so while breakages are more likely,
they'll occur in areas that we can fix in the provisioning module. The SDK
is easier and safer to work with since it's a programmatic way of accessing
the API, but it's a third party package maintained by apparently one
person. I believe OpenStack's API has generally been very stable; new
features are added instead of changing existing ones, but there's always
the remote possibility a change breaks the SDK and it never gets fixed
which would require replacing it with something else.
There are other differences between the modules, but they're relatively
minor and are going to be changed for general release regardless so the
choice really comes down to which of these approaches the community would
prefer.
Cameron
On Mon, Jun 16, 2014 at 9:59 AM, Andy Kurth <an...@ncsu.edu> wrote:
> I think we're all in agreement that removing dependencies on /etc/hosts is
> an improvement. I'm working on this and should have the changes committed
> this week.
>
> To summarize the situation and changes, the backend code currently reads
> /etc/hosts in order to determine the private IP address of a node. It does
> not rely on the computer.privateIPaddress field in the database. Several
> node configuration tasks depend on knowing the correct private IP address.
> The backend code also currently uses the computer.hostname value to SSH
> into nodes. As a result, it depends on hostname-private IP address
> resolution working correctly -- which is usually accomplished via
> /etc/hosts.
>
> I will change the code to:
> (1) Not read or reference /etc/hosts at all
> (2) Use the computer.privateIPaddress field as the authoritative value
> (3) Use the private IP address instead of the hostname for all SSH and
> other connections
> (4) Add utils.pm::update_private_ip_address
>
> This will allow any provisioning module to have control over how private IP
> addresses are allocated. If they are dynamically allocated when a node is
> loaded or instantiated, the provisioning module can retrieve the dynamic
> private IP address from Openstack or some other provisioning API, and call
> update_private_ip_address to set the correct value in the database. The
> provisioning module should also call $self->data->set_private_ip_address.
> When control is passed from the provisioning to the OS module, everything
> should be set up correctly.
>
> -Andy
>
Re: OpenStack Module
Posted by Andy Kurth <an...@ncsu.edu>.
I think we're all in agreement that removing dependencies on /etc/hosts is
an improvement. I'm working on this and should have the changes committed
this week.
To summarize the situation and changes, the backend code currently reads
/etc/hosts in order to determine the private IP address of a node. It does
not rely on the computer.privateIPaddress field in the database. Several
node configuration tasks depend on knowing the correct private IP address.
The backend code also currently uses the computer.hostname value to SSH
into nodes. As a result, it depends on hostname-private IP address
resolution working correctly -- which is usually accomplished via
/etc/hosts.
I will change the code to:
(1) Not read or reference /etc/hosts at all
(2) Use the computer.privateIPaddress field as the authoritative value
(3) Use the private IP address instead of the hostname for all SSH and
other connections
(4) Add utils.pm::update_private_ip_address
This will allow any provisioning module to have control over how private IP
addresses are allocated. If they are dynamically allocated when a node is
loaded or instantiated, the provisioning module can retrieve the dynamic
private IP address from Openstack or some other provisioning API, and call
update_private_ip_address to set the correct value in the database. The
provisioning module should also call $self->data->set_private_ip_address.
When control is passed from the provisioning to the OS module, everything
should be set up correctly.
-Andy
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
dnsmasq protocol is for OpenStack. We might need to find another way to
solve this problem.
Thanks,
Young-Hyun
On Wed, Jun 4, 2014 at 1:55 PM, Curtis <se...@gmail.com> wrote:
> On Wed, Jun 4, 2014 at 11:49 AM, YOUNG OH <oh...@gmail.com> wrote:
> > Hi Curtis,
> >
> > I think you can change the default lease time for dnsmasq protocol in
> > /etc/dnsmasq.conf. It seems the default dhcp lease time is 150 (150
> seconds
> > I guess).
>
> Where are you suggesting changing it? We can't change it in OpenStack
> because I'm installing Apache VCL into a cloud with many tenants in
> this situation, ie. I don't control "the cloud" in this case. As for
> the virtual machine, I'm speaking only of Windows 7, so there isn't a
> /etc/dnsmasq.conf. :)
>
> Thanks,
> Curtis.
>
>
> >
> > Thanks,
> > Young-Hyun
> >
> >
> >
> >
> >
> > On Wed, Jun 4, 2014 at 11:52 AM, Curtis <se...@gmail.com> wrote:
> >
> >> Also, as another note/issue, in openstack the dhcp times are usually
> >> set to a minute or two, which I find quite low but that is what it is
> >> by default. For windows, during the provisioning process VCL sets the
> >> time which causes the dhcp ticket to time out and the instance is left
> >> without an IP and reservations fail. Right now I have commented out
> >> the part of the code that sets the time.
> >>
> >> On Tue, Jun 3, 2014 at 2:21 PM, Aaron Peeler <aa...@ncsu.edu>
> >> wrote:
> >> > It was Andy's idea :)
> >> >
> >> > Aaron
> >> >
> >> > On Tue, Jun 3, 2014 at 4:19 PM, YOUNG OH <oh...@gmail.com>
> >> wrote:
> >> >> I think so too.
> >> >>
> >> >> Young-Hyun
> >> >>
> >> >>
> >> >> On Tue, Jun 3, 2014 at 3:58 PM, Curtis <se...@gmail.com>
> wrote:
> >> >>
> >> >>> On Tue, Jun 3, 2014 at 1:52 PM, Aaron Peeler <aaron_peeler@ncsu.edu
> >
> >> >>> wrote:
> >> >>> > Would using the private IP instead of hostnames resolve it? It
> would
> >> >>> > take a bit of work, but could be done.
> >> >>>
> >> >>> Yup that would work...as far as I can tell. :)
> >> >>>
> >> >>> Thanks,
> >> >>> Curtis.
> >> >>>
> >> >>> >
> >> >>> > Aaron
> >> >>> >
> >> >>> >
> >> >>> >
> >> >>> > On Tue, Jun 3, 2014 at 3:22 PM, Curtis <se...@gmail.com>
> >> wrote:
> >> >>> >> On Tue, Jun 3, 2014 at 11:53 AM, YOUNG OH <
> oh.younghyun2@gmail.com>
> >> >>> wrote:
> >> >>> >>> Hi Curtis,
> >> >>> >>>
> >> >>> >>> Thank you for updating the status and correction about the
> >> OpenStack
> >> >>> Perl
> >> >>> >>> SDKs.
> >> >>> >>>
> >> >>> >>> If DNS lookup is not reliable to find the private ip of an
> instance
> >> >>> for a
> >> >>> >>> multi-host openstack environment, then do you have any
> suggestion
> >> to
> >> >>> deal
> >> >>> >>> with this issue?
> >> >>> >>>
> >> >>> >>> At this point, I think at least we have an agreement that we do
> NOT
> >> >>> want to
> >> >>> >>> use /etc/hosts anymore, right?
> >> >>> >>> If so, we can first try to use the database to get/update the
> >> private
> >> >>> ip
> >> >>> >>> address with DNS lookup for a single-host openstack environment.
> >> After
> >> >>> >>> that, we can try to find a solution to manage the DNS lookup or
> >> other
> >> >>> >>> methods of finding the private ip of an instance in multi-host
> >> >>> openstack
> >> >>> >>> environment. If you have any other suggestions, please let me
> know.
> >> >>> >>>
> >> >>> >>
> >> >>> >> I'm not too sure what to do. I'm hoping the Apache VCL core devs
> >> chime
> >> >>> in.
> >> >>> >>
> >> >>> >> As far as I can tell, Apache VCL needs DNS resolution to work, so
> >> >>> >> simply adding the IP into the database isn't going to be enough.
> >> >>> >>
> >> >>> >> For the current Apache VCL + OpenStack multihost cloud
> installation
> >> >>> >> I'm working on I'm just going to add a python script that queries
> >> >>> >> OpenStack and generates /etc/hosts every 20 or 30 seconds or
> >> something
> >> >>> >> like that.
> >> >>> >>
> >> >>> >> Thanks,
> >> >>> >> Curtis.
> >> >>> >>
> >> >>> >>> Thanks,
> >> >>> >>> Young-Hyun
> >> >>> >>>
> >> >>> >>>
> >> >>> >>>
> >> >>> >>> On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com>
> >> wrote:
> >> >>> >>>
> >> >>> >>>> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <
> >> oh.younghyun2@gmail.com>
> >> >>> wrote:
> >> >>> >>>> > Hi All,
> >> >>> >>>> >
> >> >>> >>>> > I would like to bring your attention again to discuss what
> >> OpenStack
> >> >>> >>>> module
> >> >>> >>>> > should include. I would like to discus two issues first.
> >> >>> >>>> >
> >> >>> >>>> > First, we know that using /etc/hosts to get the private ip
> of an
> >> >>> instance
> >> >>> >>>> > can be problematic. Specifically, Cameron (at Cybera) and I
> had
> >> >>> found
> >> >>> >>>> that
> >> >>> >>>> > there might duplicated or blank entries and rarely but
> OpenStack
> >> >>> APIs
> >> >>> >>>> > cannot get the private ip (not populated) of an instance
> >> properly.
> >> >>> For
> >> >>> >>>> the
> >> >>> >>>> > later case, Cameron added DNS Lookup function to get the
> correct
> >> >>> private
> >> >>> >>>> IP
> >> >>> >>>> > (Cameron, correct me if I am wrong). This problem leads us to
> >> avoid
> >> >>> using
> >> >>> >>>> > /etc/hosts file to get the private ip but I think we need to
> >> first
> >> >>> >>>> discuss
> >> >>> >>>> > what the best way is to handle the private ip:
> >> >>> >>>> >
> >> >>> >>>> > (a). Use the privateIPaddress field in computer table.
> >> >>> >>>> > Andy suggests that we can change the get_computer_private_ip
> to
> >> get
> >> >>> >>>> private
> >> >>> >>>> > ip from the database instead of using /etc/hosts (Andy,
> correct
> >> me
> >> >>> if I
> >> >>> >>>> am
> >> >>> >>>> > wrong). I agree with his idea because this can avoid
> duplicated
> >> or
> >> >>> blank
> >> >>> >>>> > entry problem of using /etc/hosts.
> >> >>> >>>> >
> >> >>> >>>> > (b). OpenStack (DNS lookup for finding unpopulated private
> ip)
> >> >>> >>>> > In our openstack module, DNS lookup or other methods (if any)
> >> can
> >> >>> give
> >> >>> >>>> the
> >> >>> >>>> > correct the private ip of the instance in order to deal with
> the
> >> >>> problem
> >> >>> >>>> > for the private ip not being populated in the hosts file.
> >> Cameron
> >> >>> >>>> modified
> >> >>> >>>> > the get_computer_private_ip in DataStructure.pm to do a DNS
> >> lookup
> >> >>> >>>> instead
> >> >>> >>>> > of using the hosts file. But I would like to suggest that if
> >> >>> possible, it
> >> >>> >>>> > can be better to add the DNS lookup function to openstack
> module
> >> >>> rather
> >> >>> >>>> > than changing the DataStructure.pm. That is, we can update
> the
> >> >>> >>>> > privateIPaddress field in computer table using DNS lookup
> >> instead of
> >> >>> >>>> > injecting the private ip to /etc/hosts in openstack module.
> >> >>> >>>>
> >> >>> >>>> We've just found out recently that the helpful DNS resolution
> that
> >> >>> >>>> openstack provides does not work well in a mutlihost openstack
> >> >>> >>>> environment, so can't be relied on. In multihost mode each
> compute
> >> >>> >>>> host only knows about the vms running on it locally.
> >> >>> >>>>
> >> >>> >>>> >
> >> >>> >>>> > I think, if possible, one of the best methods for dealing
> with
> >> the
> >> >>> >>>> private
> >> >>> >>>> > ip is that we can use the database to get the private ip of
> an
> >> >>> instance
> >> >>> >>>> and
> >> >>> >>>> > using DNS lookup in openstack module to update the
> information.
> >> Any
> >> >>> >>>> > suggestions and corrections about my opinion would be very
> >> helpful
> >> >>> to
> >> >>> >>>> solve
> >> >>> >>>> > this problem.
> >> >>> >>>> >
> >> >>> >>>> > Second, currently we have two versions (not exactly but for
> >> >>> convenience);
> >> >>> >>>> > one uses OpenStack command line interfaces (CLIs) and one
> uses
> >> >>> OpenStack
> >> >>> >>>> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs
> for
> >> the
> >> >>> >>>> > OpenStcak CLIs and required to install through CPAN. I think
> >> both
> >> >>> >>>> versions
> >> >>> >>>> > have pros and cons. So, I would like to ask your opinions
> >> whether
> >> >>> it is
> >> >>> >>>> > better to include two different openstack versions to the
> next
> >> VCL
> >> >>> >>>> release,
> >> >>> >>>> > to find a way to merge two versions into one openstack
> module,
> >> OR to
> >> >>> >>>> create
> >> >>> >>>> > a higher level of openstack module so that it can choose one
> >> version
> >> >>> >>>> based
> >> >>> >>>> > on user's environment. Any suggestions would be also very
> >> helpful to
> >> >>> >>>> decide
> >> >>> >>>> > how we can manage openstack module. Thank you.
> >> >>> >>>>
> >> >>> >>>> FYI -- The perl openstack sdk is not a wrapper for the command
> >> line
> >> >>> >>>> utils. It uses the openstack api, not the command line tools.
> >> >>> >>>>
> >> >>> >>>> Thanks,
> >> >>> >>>> Curtis.
> >> >>> >>>>
> >> >>> >>>> >
> >> >>> >>>> > Best regards,
> >> >>> >>>> > Young-Hyun
> >> >>> >>>> >
> >> >>> >>>> >
> >> >>> >>>> >
> >> >>> >>>> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <
> >> oh.younghyun2@gmail.com>
> >> >>> >>>> wrote:
> >> >>> >>>> >
> >> >>> >>>> >> Hi All,
> >> >>> >>>> >>
> >> >>> >>>> >> I have tested my openstack module (
> >> >>> >>>> >> https://issues.apache.org/jira/browse/VCL-590) on the
> >> OpenStack
> >> >>> >>>> Icehouse
> >> >>> >>>> >> (The ninth release of OpenStack, April 17, 2014) and I could
> >> >>> >>>> provisioning a
> >> >>> >>>> >> Linux image through it.
> >> >>> >>>> >>
> >> >>> >>>> >> The environment details are as follows:
> >> >>> >>>> >>
> >> >>> >>>> >> 1. Host Blade
> >> >>> >>>> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
> >> >>> >>>> >> :- Memory: 49G
> >> >>> >>>> >> :- Disk: 134G
> >> >>> >>>> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
> >> >>> >>>> >> 2. OpenStack Icehouse Components
> >> >>> >>>> >> :- Compute
> >> >>> >>>> >> :- Network (Nova-Network, not OpenStack Neutron)
> >> >>> >>>> >> :- Glance
> >> >>> >>>> >> 3. Provisioning Linux image
> >> >>> >>>> >> :- CentOS 6.3 x64
> >> >>> >>>> >> 4. VCL 2.3
> >> >>> >>>> >>
> >> >>> >>>> >> In this test, I've just tested the provisioning an image
> but I
> >> >>> would
> >> >>> >>>> like
> >> >>> >>>> >> to post the detail information to jira once I finish other
> >> test. In
> >> >>> >>>> >> addition, I will try to add a function of selecting
> OpenStack
> >> >>> flavors
> >> >>> >>>> based
> >> >>> >>>> >> on the size of an image. The current openstack module sets
> >> flavors
> >> >>> for
> >> >>> >>>> each
> >> >>> >>>> >> image because the previous OpenStack releases (Essex as I
> know)
> >> >>> didn't
> >> >>> >>>> >> support the size information of images but now it supports.
> I
> >> will
> >> >>> also
> >> >>> >>>> >> post to jira issue when I add the function to my module.
> Thank
> >> you.
> >> >>> >>>> >>
> >> >>> >>>> >> Best regards,
> >> >>> >>>> >> Young-Hyun
> >> >>> >>>> >>
> >> >>> >>>> >>
> >> >>> >>>> >>
> >> >>> >>>> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <
> >> >>> cameron.mann@cybera.ca>
> >> >>> >>>> >> wrote:
> >> >>> >>>> >>
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception
> >> handling
> >> >>> >>>> features
> >> >>> >>>> >>> of
> >> >>> >>>> >>> > Perl, but I'd prefer to keep the number of external
> modules
> >> to a
> >> >>> >>>> >>> minimum if
> >> >>> >>>> >>> > possible. If there are new features in Perl which would
> be
> >> >>> >>>> beneficial,
> >> >>> >>>> >>> I'd
> >> >>> >>>> >>> > rather make the newer version of Perl a requirement and
> use
> >> the
> >> >>> >>>> built in
> >> >>> >>>> >>> > features. Otherwise, we're locked into using an external
> >> >>> module,
> >> >>> >>>> >>> usually
> >> >>> >>>> >>> > from CPAN, which has no quality assurance. I regret
> adding
> >> >>> some of
> >> >>> >>>> the
> >> >>> >>>> >>> > current modules such as InsideOut, rather then writing
> the
> >> code
> >> >>> which
> >> >>> >>>> >>> could
> >> >>> >>>> >>> > accomplish the same objective.
> >> >>> >>>> >>> > Did you need to catch exceptions because one of the
> >> OpenStack
> >> >>> modules
> >> >>> >>>> >>> > you're using may throw a die exception? When this
> happens,
> >> the
> >> >>> >>>> entire
> >> >>> >>>> >>> vcld
> >> >>> >>>> >>> > process for the reservation exits abruptly which causes
> >> problems
> >> >>> >>>> such as
> >> >>> >>>> >>> > the request state remaining in pending indefinitely.
> This
> >> >>> happens
> >> >>> >>>> even
> >> >>> >>>> >>> if
> >> >>> >>>> >>> > you wrap the call in an eval block. I have worked around
> >> this
> >> >>> >>>> problem
> >> >>> >>>> >>> > before by locally overriding the die handler. Take a
> look
> >> at
> >> >>> >>>> >>> > vSphere_SDK.pm and find lines such as:
> >> >>> >>>> >>> > # Override the die handler
> >> >>> >>>> >>> > local $SIG{__DIE__} = sub{};
> >> >>> >>>> >>> > The vSphere SDK is one example which may call die (via
> >> Carp).
> >> >>> If
> >> >>> >>>> this
> >> >>> >>>> >>> > happens with die overridden, the eval block returns
> >> normally.
> >> >>> If an
> >> >>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
> >> >>> >>>> >>>
> >> >>> >>>> >>>
> >> >>> >>>> >>> The OpenStack SDK throws exceptions when requests that
> >> >>> >>>> >>> delete/modify/create
> >> >>> >>>> >>> resources fail, no die exceptions though. There wasn't any
> >> >>> specific
> >> >>> >>>> >>> feature
> >> >>> >>>> >>> that made me choose Try::Tiny, it was more my unfamiliarity
> >> with
> >> >>> >>>> exception
> >> >>> >>>> >>> handling in Perl which seemed to have a number of gotchas
> >> prior to
> >> >>> >>>> 5.14 so
> >> >>> >>>> >>> I figured it'd be better to let someone else's code worry
> >> about
> >> >>> that.
> >> >>> >>>> >>>
> >> >>> >>>> >>>
> >> >>> >>>> >>>
> >> >>> >>>>
> >> >>>
> >>
> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
> >> >>> >>>> >>>
> >> >>> >>>> >>> I see no problems. Any barriers or difficulty you
> encounter
> >> with
> >> >>> the
> >> >>> >>>> core
> >> >>> >>>> >>> > code should be addressed by improving the core code.
> >> >>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd
> >> like to
> >> >>> >>>> improve
> >> >>> >>>> >>> > regardless. People often encounter problems with this if
> >> they
> >> >>> >>>> forget to
> >> >>> >>>> >>> > add entries to /etc/hosts for all their computers,
> >> including the
> >> >>> >>>> >>> management
> >> >>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the
> management
> >> >>> node at
> >> >>> >>>> all
> >> >>> >>>> >>> and
> >> >>> >>>> >>> > have the value in the computer table be authoritative.
> This
> >> >>> should
> >> >>> >>>> >>> > facilitate cases where the provisioning module needs to
> do
> >> >>> something
> >> >>> >>>> >>> > different regarding private IPs such as if they are
> >> dynamically
> >> >>> >>>> >>> allocated.
> >> >>> >>>> >>> > The provisioning module would retrieve the IP when the
> >> image
> >> >>> gets
> >> >>> >>>> >>> loaded
> >> >>> >>>> >>> > by querying DNS or some other method and then update the
> >> >>> database.
> >> >>> >>>> The
> >> >>> >>>> >>> OS
> >> >>> >>>> >>> > module would then use this value to configure the
> computer.
> >> >>> >>>> >>>
> >> >>> >>>> >>>
> >> >>> >>>> >>> Sounds good. I agree that avoiding the hosts file would be
> >> best,
> >> >>> >>>> >>> especially
> >> >>> >>>> >>> in a case like this where it needs to be continuously
> >> modified.
> >> >>> Here's
> >> >>> >>>> our
> >> >>> >>>> >>> changed get_computer_private_ip_address, lines 45-55 are
> the
> >> new
> >> >>> code:
> >> >>> >>>> >>>
> >> >>> >>>> >>> https://gist.github.com/cmann/9896513
> >> >>> >>>> >>>
> >> >>> >>>> >>> Finally we're still working on putting together more
> >> comprehensive
> >> >>> >>>> >>> installation documentation for anyone who wants to try it
> out.
> >> >>> We're
> >> >>> >>>> use
> >> >>> >>>> >>> automation for a number of the tasks and I haven't had a
> >> chance
> >> >>> to run
> >> >>> >>>> >>> through it from scratch yet. For anyone feeling adventurous
> >> these
> >> >>> are
> >> >>> >>>> the
> >> >>> >>>> >>> most basic instructions:
> >> >>> >>>> >>>
> >> >>> >>>> >>> 1. Apply the NAT patch
> >> >>> >>>> >>> (https://issues.apache.org/jira/browse/VCL-174tested on
> 2.3
> >> and
> >> >>> 2.3.1,
> >> >>> >>>> >>> make sure to read the Google doc)
> >> >>> >>>> >>> 2. Follow the instructions in the readme in the Github repo
> >> for
> >> >>> the
> >> >>> >>>> >>> OpenStack module.
> >> >>> >>>> >>>
> >> >>> >>>> >>> Cameron
> >> >>> >>>> >>>
> >> >>> >>>> >>>
> >> >>> >>>> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <
> >> andy_kurth@ncsu.edu>
> >> >>> >>>> wrote:
> >> >>> >>>> >>>
> >> >>> >>>> >>> > >
> >> >>> >>>> >>> > >
> >> >>> >>>> >>> > > 2. We use the Try::Tiny module to handle exceptions
> since
> >> the
> >> >>> >>>> version
> >> >>> >>>> >>> of
> >> >>> >>>> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch
> >> >>> mechanisms
> >> >>> >>>> >>> > available
> >> >>> >>>> >>> > > in newer releases, however this would add an additional
> >> >>> dependency
> >> >>> >>>> to
> >> >>> >>>> >>> > VCL.
> >> >>> >>>> >>> > > Depending on the version of Perl VCL 2.4 is planning to
> >> use
> >> >>> what
> >> >>> >>>> are
> >> >>> >>>> >>> > > people's thoughts on using Try::Tiny versus switching
> to
> >> >>> Perl's
> >> >>> >>>> >>> internal
> >> >>> >>>> >>> > > mechanisms?
> >> >>> >>>> >>> > >
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception
> >> handling
> >> >>> >>>> features
> >> >>> >>>> >>> of
> >> >>> >>>> >>> > Perl, but I'd prefer to keep the number of external
> modules
> >> to a
> >> >>> >>>> >>> minimum if
> >> >>> >>>> >>> > possible. If there are new features in Perl which would
> be
> >> >>> >>>> beneficial,
> >> >>> >>>> >>> I'd
> >> >>> >>>> >>> > rather make the newer version of Perl a requirement and
> use
> >> the
> >> >>> >>>> built in
> >> >>> >>>> >>> > features. Otherwise, we're locked into using an external
> >> >>> module,
> >> >>> >>>> >>> usually
> >> >>> >>>> >>> > from CPAN, which has no quality assurance. I regret
> adding
> >> >>> some of
> >> >>> >>>> the
> >> >>> >>>> >>> > current modules such as InsideOut, rather then writing
> the
> >> code
> >> >>> which
> >> >>> >>>> >>> could
> >> >>> >>>> >>> > accomplish the same objective.
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > Did you need to catch exceptions because one of the
> >> OpenStack
> >> >>> modules
> >> >>> >>>> >>> > you're using may throw a die exception? When this
> happens,
> >> the
> >> >>> >>>> entire
> >> >>> >>>> >>> vcld
> >> >>> >>>> >>> > process for the reservation exits abruptly which causes
> >> problems
> >> >>> >>>> such as
> >> >>> >>>> >>> > the request state remaining in pending indefinitely.
> This
> >> >>> happens
> >> >>> >>>> even
> >> >>> >>>> >>> if
> >> >>> >>>> >>> > you wrap the call in an eval block. I have worked around
> >> this
> >> >>> >>>> problem
> >> >>> >>>> >>> > before by locally overriding the die handler. Take a
> look
> >> at
> >> >>> >>>> >>> > vSphere_SDK.pm and find lines such as:
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > # Override the die handler
> >> >>> >>>> >>> > local $SIG{__DIE__} = sub{};
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > The vSphere SDK is one example which may call die (via
> >> Carp).
> >> >>> If
> >> >>> >>>> this
> >> >>> >>>> >>> > happens with die overridden, the eval block returns
> >> normally.
> >> >>> If an
> >> >>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
> >> >>> >>>> >>> >
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > >
> >> >>> >>>> >>> > > 3. I've saved the best for last, but first some
> >> background.
> >> >>> The
> >> >>> >>>> >>> biggest
> >> >>> >>>> >>> > > change we've made is that we no longer rely on the
> >> /etc/hosts
> >> >>> file
> >> >>> >>>> at
> >> >>> >>>> >>> all
> >> >>> >>>> >>> > > (though we haven't removed the code that keeps it up to
> >> >>> date). We
> >> >>> >>>> had
> >> >>> >>>> >>> a
> >> >>> >>>> >>> > > number of issues with duplicate entries ending up in
> the
> >> >>> hosts file
> >> >>> >>>> >>> and
> >> >>> >>>> >>> > > weren't able to pin down the exact cause. This led us
> to
> >> >>> adding a
> >> >>> >>>> >>> table
> >> >>> >>>> >>> > to
> >> >>> >>>> >>> > > the database to track VCL computer to OpenStack
> instance
> >> >>> mappings.
> >> >>> >>>> The
> >> >>> >>>> >>> > next
> >> >>> >>>> >>> > > issue we ran into was the private IP address not being
> >> >>> populated in
> >> >>> >>>> >>> the
> >> >>> >>>> >>> > > hosts file. This happened very rarely and we're still
> >> unsure
> >> >>> of the
> >> >>> >>>> >>> cause
> >> >>> >>>> >>> > > especially since there's an explicit check that the
> >> address is
> >> >>> >>>> >>> populated
> >> >>> >>>> >>> > > with a value before we write the hosts file. I'd assume
> >> that
> >> >>> the
> >> >>> >>>> Nova
> >> >>> >>>> >>> API
> >> >>> >>>> >>> > > occasionally returns a response where the addresses
> >> component
> >> >>> is
> >> >>> >>>> >>> > structured
> >> >>> >>>> >>> > > differently than we expect, though I was never able to
> >> >>> directly
> >> >>> >>>> >>> observe
> >> >>> >>>> >>> > > this behavior. Since OpenStack automatically creates
> DNS
> >> >>> entries
> >> >>> >>>> for
> >> >>> >>>> >>> new
> >> >>> >>>> >>> > > instances we decided the best course of action was to
> >> bypass
> >> >>> the
> >> >>> >>>> hosts
> >> >>> >>>> >>> > file
> >> >>> >>>> >>> > > entirely. In the end we modified
> >> >>> get_computer_private_ip_address in
> >> >>> >>>> >>> > > DataStructure.pm to do a DNS lookup rather than looking
> >> in the
> >> >>> >>>> hosts
> >> >>> >>>> >>> > file.
> >> >>> >>>> >>> > >
> >> >>> >>>> >>> > > The question for the community is are changes to core
> VCL
> >> code
> >> >>> >>>> >>> > acceptable?
> >> >>> >>>> >>> > > Or should we find a solution that keeps everything
> >> contained
> >> >>> to the
> >> >>> >>>> >>> > > provisioning module? If changes to core code are
> >> acceptable
> >> >>> we'd
> >> >>> >>>> also
> >> >>> >>>> >>> > have
> >> >>> >>>> >>> > > to decide on a method of detecting when to do a DNS
> >> lookup.
> >> >>> Should
> >> >>> >>>> it
> >> >>> >>>> >>> > > depend on the provisioning module in use? A
> configuration
> >> >>> option?
> >> >>> >>>> >>> >
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > I see no problems. Any barriers or difficulty you
> encounter
> >> >>> with the
> >> >>> >>>> >>> core
> >> >>> >>>> >>> > code should be addressed by improving the core code.
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd
> >> like to
> >> >>> >>>> improve
> >> >>> >>>> >>> > regardless. People often encounter problems with this if
> >> they
> >> >>> >>>> forget to
> >> >>> >>>> >>> > add entries to /etc/hosts for all their computers,
> >> including the
> >> >>> >>>> >>> management
> >> >>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the
> management
> >> >>> node at
> >> >>> >>>> all
> >> >>> >>>> >>> and
> >> >>> >>>> >>> > have the value in the computer table be authoritative.
> This
> >> >>> should
> >> >>> >>>> >>> > facilitate cases where the provisioning module needs to
> do
> >> >>> something
> >> >>> >>>> >>> > different regarding private IPs such as if they are
> >> dynamically
> >> >>> >>>> >>> allocated.
> >> >>> >>>> >>> > The provisioning module would retrieve the IP when the
> >> image
> >> >>> gets
> >> >>> >>>> >>> loaded
> >> >>> >>>> >>> > by querying DNS or some other method and then update the
> >> >>> database.
> >> >>> >>>> The
> >> >>> >>>> >>> OS
> >> >>> >>>> >>> > module would then use this value to configure the
> computer.
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > One comment regarding adding tables... great! Add all
> the
> >> >>> tables you
> >> >>> >>>> >>> think
> >> >>> >>>> >>> > are beneficial. I have seen some try to work around the
> >> current
> >> >>> >>>> >>> database
> >> >>> >>>> >>> > schema rather than adding to it. There's no reason for
> >> this.
> >> >>> If
> >> >>> >>>> there
> >> >>> >>>> >>> are
> >> >>> >>>> >>> > configuration options which apply only to OpenStack, add
> >> >>> something
> >> >>> >>>> like
> >> >>> >>>> >>> an
> >> >>> >>>> >>> > openstackconfig table. If the vmprofile table doesn't
> >> align,
> >> >>> add
> >> >>> >>>> >>> something
> >> >>> >>>> >>> > like an openstackprofile table. If there are general
> >> options
> >> >>> such as
> >> >>> >>>> >>> how
> >> >>> >>>> >>> > to handle DNS or private IP resolution, we could add a
> more
> >> >>> general
> >> >>> >>>> >>> table
> >> >>> >>>> >>> > or possibly extend the managementnode or computer table.
> >> >>> >>>> >>> >
> >> >>> >>>> >>> > Thanks,
> >> >>> >>>> >>> > Andy
> >> >>> >>>> >>> >
> >> >>> >>>> >>>
> >> >>> >>>> >>
> >> >>> >>>> >>
> >> >>> >>>>
> >> >>> >>>>
> >> >>> >>>>
> >> >>> >>>> --
> >> >>> >>>> Twitter: @serverascode
> >> >>> >>>> Blog: serverascode.com
> >> >>> >>>>
> >> >>> >>
> >> >>> >>
> >> >>> >>
> >> >>> >> --
> >> >>> >> Twitter: @serverascode
> >> >>> >> Blog: serverascode.com
> >> >>> >
> >> >>> >
> >> >>> >
> >> >>> > --
> >> >>> > Aaron Peeler
> >> >>> > Program Manager
> >> >>> > Virtual Computing Lab
> >> >>> > NC State University
> >> >>> >
> >> >>> > All electronic mail messages in connection with State business
> which
> >> >>> > are sent to or received by this account are subject to the NC
> Public
> >> >>> > Records Law and may be disclosed to third parties.
> >> >>>
> >> >>>
> >> >>>
> >> >>> --
> >> >>> Twitter: @serverascode
> >> >>> Blog: serverascode.com
> >> >>>
> >> >
> >> >
> >> >
> >> > --
> >> > Aaron Peeler
> >> > Program Manager
> >> > Virtual Computing Lab
> >> > NC State University
> >> >
> >> > All electronic mail messages in connection with State business which
> >> > are sent to or received by this account are subject to the NC Public
> >> > Records Law and may be disclosed to third parties.
> >>
> >>
> >>
> >> --
> >> Twitter: @serverascode
> >> Blog: serverascode.com
> >>
>
>
>
> --
> Twitter: @serverascode
> Blog: serverascode.com
>
Re: OpenStack Module
Posted by Curtis <se...@gmail.com>.
On Wed, Jun 4, 2014 at 11:49 AM, YOUNG OH <oh...@gmail.com> wrote:
> Hi Curtis,
>
> I think you can change the default lease time for dnsmasq protocol in
> /etc/dnsmasq.conf. It seems the default dhcp lease time is 150 (150 seconds
> I guess).
Where are you suggesting changing it? We can't change it in OpenStack
because I'm installing Apache VCL into a cloud with many tenants in
this situation, ie. I don't control "the cloud" in this case. As for
the virtual machine, I'm speaking only of Windows 7, so there isn't a
/etc/dnsmasq.conf. :)
Thanks,
Curtis.
>
> Thanks,
> Young-Hyun
>
>
>
>
>
> On Wed, Jun 4, 2014 at 11:52 AM, Curtis <se...@gmail.com> wrote:
>
>> Also, as another note/issue, in openstack the dhcp times are usually
>> set to a minute or two, which I find quite low but that is what it is
>> by default. For windows, during the provisioning process VCL sets the
>> time which causes the dhcp ticket to time out and the instance is left
>> without an IP and reservations fail. Right now I have commented out
>> the part of the code that sets the time.
>>
>> On Tue, Jun 3, 2014 at 2:21 PM, Aaron Peeler <aa...@ncsu.edu>
>> wrote:
>> > It was Andy's idea :)
>> >
>> > Aaron
>> >
>> > On Tue, Jun 3, 2014 at 4:19 PM, YOUNG OH <oh...@gmail.com>
>> wrote:
>> >> I think so too.
>> >>
>> >> Young-Hyun
>> >>
>> >>
>> >> On Tue, Jun 3, 2014 at 3:58 PM, Curtis <se...@gmail.com> wrote:
>> >>
>> >>> On Tue, Jun 3, 2014 at 1:52 PM, Aaron Peeler <aa...@ncsu.edu>
>> >>> wrote:
>> >>> > Would using the private IP instead of hostnames resolve it? It would
>> >>> > take a bit of work, but could be done.
>> >>>
>> >>> Yup that would work...as far as I can tell. :)
>> >>>
>> >>> Thanks,
>> >>> Curtis.
>> >>>
>> >>> >
>> >>> > Aaron
>> >>> >
>> >>> >
>> >>> >
>> >>> > On Tue, Jun 3, 2014 at 3:22 PM, Curtis <se...@gmail.com>
>> wrote:
>> >>> >> On Tue, Jun 3, 2014 at 11:53 AM, YOUNG OH <oh...@gmail.com>
>> >>> wrote:
>> >>> >>> Hi Curtis,
>> >>> >>>
>> >>> >>> Thank you for updating the status and correction about the
>> OpenStack
>> >>> Perl
>> >>> >>> SDKs.
>> >>> >>>
>> >>> >>> If DNS lookup is not reliable to find the private ip of an instance
>> >>> for a
>> >>> >>> multi-host openstack environment, then do you have any suggestion
>> to
>> >>> deal
>> >>> >>> with this issue?
>> >>> >>>
>> >>> >>> At this point, I think at least we have an agreement that we do NOT
>> >>> want to
>> >>> >>> use /etc/hosts anymore, right?
>> >>> >>> If so, we can first try to use the database to get/update the
>> private
>> >>> ip
>> >>> >>> address with DNS lookup for a single-host openstack environment.
>> After
>> >>> >>> that, we can try to find a solution to manage the DNS lookup or
>> other
>> >>> >>> methods of finding the private ip of an instance in multi-host
>> >>> openstack
>> >>> >>> environment. If you have any other suggestions, please let me know.
>> >>> >>>
>> >>> >>
>> >>> >> I'm not too sure what to do. I'm hoping the Apache VCL core devs
>> chime
>> >>> in.
>> >>> >>
>> >>> >> As far as I can tell, Apache VCL needs DNS resolution to work, so
>> >>> >> simply adding the IP into the database isn't going to be enough.
>> >>> >>
>> >>> >> For the current Apache VCL + OpenStack multihost cloud installation
>> >>> >> I'm working on I'm just going to add a python script that queries
>> >>> >> OpenStack and generates /etc/hosts every 20 or 30 seconds or
>> something
>> >>> >> like that.
>> >>> >>
>> >>> >> Thanks,
>> >>> >> Curtis.
>> >>> >>
>> >>> >>> Thanks,
>> >>> >>> Young-Hyun
>> >>> >>>
>> >>> >>>
>> >>> >>>
>> >>> >>> On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com>
>> wrote:
>> >>> >>>
>> >>> >>>> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <
>> oh.younghyun2@gmail.com>
>> >>> wrote:
>> >>> >>>> > Hi All,
>> >>> >>>> >
>> >>> >>>> > I would like to bring your attention again to discuss what
>> OpenStack
>> >>> >>>> module
>> >>> >>>> > should include. I would like to discus two issues first.
>> >>> >>>> >
>> >>> >>>> > First, we know that using /etc/hosts to get the private ip of an
>> >>> instance
>> >>> >>>> > can be problematic. Specifically, Cameron (at Cybera) and I had
>> >>> found
>> >>> >>>> that
>> >>> >>>> > there might duplicated or blank entries and rarely but OpenStack
>> >>> APIs
>> >>> >>>> > cannot get the private ip (not populated) of an instance
>> properly.
>> >>> For
>> >>> >>>> the
>> >>> >>>> > later case, Cameron added DNS Lookup function to get the correct
>> >>> private
>> >>> >>>> IP
>> >>> >>>> > (Cameron, correct me if I am wrong). This problem leads us to
>> avoid
>> >>> using
>> >>> >>>> > /etc/hosts file to get the private ip but I think we need to
>> first
>> >>> >>>> discuss
>> >>> >>>> > what the best way is to handle the private ip:
>> >>> >>>> >
>> >>> >>>> > (a). Use the privateIPaddress field in computer table.
>> >>> >>>> > Andy suggests that we can change the get_computer_private_ip to
>> get
>> >>> >>>> private
>> >>> >>>> > ip from the database instead of using /etc/hosts (Andy, correct
>> me
>> >>> if I
>> >>> >>>> am
>> >>> >>>> > wrong). I agree with his idea because this can avoid duplicated
>> or
>> >>> blank
>> >>> >>>> > entry problem of using /etc/hosts.
>> >>> >>>> >
>> >>> >>>> > (b). OpenStack (DNS lookup for finding unpopulated private ip)
>> >>> >>>> > In our openstack module, DNS lookup or other methods (if any)
>> can
>> >>> give
>> >>> >>>> the
>> >>> >>>> > correct the private ip of the instance in order to deal with the
>> >>> problem
>> >>> >>>> > for the private ip not being populated in the hosts file.
>> Cameron
>> >>> >>>> modified
>> >>> >>>> > the get_computer_private_ip in DataStructure.pm to do a DNS
>> lookup
>> >>> >>>> instead
>> >>> >>>> > of using the hosts file. But I would like to suggest that if
>> >>> possible, it
>> >>> >>>> > can be better to add the DNS lookup function to openstack module
>> >>> rather
>> >>> >>>> > than changing the DataStructure.pm. That is, we can update the
>> >>> >>>> > privateIPaddress field in computer table using DNS lookup
>> instead of
>> >>> >>>> > injecting the private ip to /etc/hosts in openstack module.
>> >>> >>>>
>> >>> >>>> We've just found out recently that the helpful DNS resolution that
>> >>> >>>> openstack provides does not work well in a mutlihost openstack
>> >>> >>>> environment, so can't be relied on. In multihost mode each compute
>> >>> >>>> host only knows about the vms running on it locally.
>> >>> >>>>
>> >>> >>>> >
>> >>> >>>> > I think, if possible, one of the best methods for dealing with
>> the
>> >>> >>>> private
>> >>> >>>> > ip is that we can use the database to get the private ip of an
>> >>> instance
>> >>> >>>> and
>> >>> >>>> > using DNS lookup in openstack module to update the information.
>> Any
>> >>> >>>> > suggestions and corrections about my opinion would be very
>> helpful
>> >>> to
>> >>> >>>> solve
>> >>> >>>> > this problem.
>> >>> >>>> >
>> >>> >>>> > Second, currently we have two versions (not exactly but for
>> >>> convenience);
>> >>> >>>> > one uses OpenStack command line interfaces (CLIs) and one uses
>> >>> OpenStack
>> >>> >>>> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for
>> the
>> >>> >>>> > OpenStcak CLIs and required to install through CPAN. I think
>> both
>> >>> >>>> versions
>> >>> >>>> > have pros and cons. So, I would like to ask your opinions
>> whether
>> >>> it is
>> >>> >>>> > better to include two different openstack versions to the next
>> VCL
>> >>> >>>> release,
>> >>> >>>> > to find a way to merge two versions into one openstack module,
>> OR to
>> >>> >>>> create
>> >>> >>>> > a higher level of openstack module so that it can choose one
>> version
>> >>> >>>> based
>> >>> >>>> > on user's environment. Any suggestions would be also very
>> helpful to
>> >>> >>>> decide
>> >>> >>>> > how we can manage openstack module. Thank you.
>> >>> >>>>
>> >>> >>>> FYI -- The perl openstack sdk is not a wrapper for the command
>> line
>> >>> >>>> utils. It uses the openstack api, not the command line tools.
>> >>> >>>>
>> >>> >>>> Thanks,
>> >>> >>>> Curtis.
>> >>> >>>>
>> >>> >>>> >
>> >>> >>>> > Best regards,
>> >>> >>>> > Young-Hyun
>> >>> >>>> >
>> >>> >>>> >
>> >>> >>>> >
>> >>> >>>> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <
>> oh.younghyun2@gmail.com>
>> >>> >>>> wrote:
>> >>> >>>> >
>> >>> >>>> >> Hi All,
>> >>> >>>> >>
>> >>> >>>> >> I have tested my openstack module (
>> >>> >>>> >> https://issues.apache.org/jira/browse/VCL-590) on the
>> OpenStack
>> >>> >>>> Icehouse
>> >>> >>>> >> (The ninth release of OpenStack, April 17, 2014) and I could
>> >>> >>>> provisioning a
>> >>> >>>> >> Linux image through it.
>> >>> >>>> >>
>> >>> >>>> >> The environment details are as follows:
>> >>> >>>> >>
>> >>> >>>> >> 1. Host Blade
>> >>> >>>> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
>> >>> >>>> >> :- Memory: 49G
>> >>> >>>> >> :- Disk: 134G
>> >>> >>>> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
>> >>> >>>> >> 2. OpenStack Icehouse Components
>> >>> >>>> >> :- Compute
>> >>> >>>> >> :- Network (Nova-Network, not OpenStack Neutron)
>> >>> >>>> >> :- Glance
>> >>> >>>> >> 3. Provisioning Linux image
>> >>> >>>> >> :- CentOS 6.3 x64
>> >>> >>>> >> 4. VCL 2.3
>> >>> >>>> >>
>> >>> >>>> >> In this test, I've just tested the provisioning an image but I
>> >>> would
>> >>> >>>> like
>> >>> >>>> >> to post the detail information to jira once I finish other
>> test. In
>> >>> >>>> >> addition, I will try to add a function of selecting OpenStack
>> >>> flavors
>> >>> >>>> based
>> >>> >>>> >> on the size of an image. The current openstack module sets
>> flavors
>> >>> for
>> >>> >>>> each
>> >>> >>>> >> image because the previous OpenStack releases (Essex as I know)
>> >>> didn't
>> >>> >>>> >> support the size information of images but now it supports. I
>> will
>> >>> also
>> >>> >>>> >> post to jira issue when I add the function to my module. Thank
>> you.
>> >>> >>>> >>
>> >>> >>>> >> Best regards,
>> >>> >>>> >> Young-Hyun
>> >>> >>>> >>
>> >>> >>>> >>
>> >>> >>>> >>
>> >>> >>>> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <
>> >>> cameron.mann@cybera.ca>
>> >>> >>>> >> wrote:
>> >>> >>>> >>
>> >>> >>>> >>> >
>> >>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception
>> handling
>> >>> >>>> features
>> >>> >>>> >>> of
>> >>> >>>> >>> > Perl, but I'd prefer to keep the number of external modules
>> to a
>> >>> >>>> >>> minimum if
>> >>> >>>> >>> > possible. If there are new features in Perl which would be
>> >>> >>>> beneficial,
>> >>> >>>> >>> I'd
>> >>> >>>> >>> > rather make the newer version of Perl a requirement and use
>> the
>> >>> >>>> built in
>> >>> >>>> >>> > features. Otherwise, we're locked into using an external
>> >>> module,
>> >>> >>>> >>> usually
>> >>> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
>> >>> some of
>> >>> >>>> the
>> >>> >>>> >>> > current modules such as InsideOut, rather then writing the
>> code
>> >>> which
>> >>> >>>> >>> could
>> >>> >>>> >>> > accomplish the same objective.
>> >>> >>>> >>> > Did you need to catch exceptions because one of the
>> OpenStack
>> >>> modules
>> >>> >>>> >>> > you're using may throw a die exception? When this happens,
>> the
>> >>> >>>> entire
>> >>> >>>> >>> vcld
>> >>> >>>> >>> > process for the reservation exits abruptly which causes
>> problems
>> >>> >>>> such as
>> >>> >>>> >>> > the request state remaining in pending indefinitely. This
>> >>> happens
>> >>> >>>> even
>> >>> >>>> >>> if
>> >>> >>>> >>> > you wrap the call in an eval block. I have worked around
>> this
>> >>> >>>> problem
>> >>> >>>> >>> > before by locally overriding the die handler. Take a look
>> at
>> >>> >>>> >>> > vSphere_SDK.pm and find lines such as:
>> >>> >>>> >>> > # Override the die handler
>> >>> >>>> >>> > local $SIG{__DIE__} = sub{};
>> >>> >>>> >>> > The vSphere SDK is one example which may call die (via
>> Carp).
>> >>> If
>> >>> >>>> this
>> >>> >>>> >>> > happens with die overridden, the eval block returns
>> normally.
>> >>> If an
>> >>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
>> >>> >>>> >>>
>> >>> >>>> >>>
>> >>> >>>> >>> The OpenStack SDK throws exceptions when requests that
>> >>> >>>> >>> delete/modify/create
>> >>> >>>> >>> resources fail, no die exceptions though. There wasn't any
>> >>> specific
>> >>> >>>> >>> feature
>> >>> >>>> >>> that made me choose Try::Tiny, it was more my unfamiliarity
>> with
>> >>> >>>> exception
>> >>> >>>> >>> handling in Perl which seemed to have a number of gotchas
>> prior to
>> >>> >>>> 5.14 so
>> >>> >>>> >>> I figured it'd be better to let someone else's code worry
>> about
>> >>> that.
>> >>> >>>> >>>
>> >>> >>>> >>>
>> >>> >>>> >>>
>> >>> >>>>
>> >>>
>> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
>> >>> >>>> >>>
>> >>> >>>> >>> I see no problems. Any barriers or difficulty you encounter
>> with
>> >>> the
>> >>> >>>> core
>> >>> >>>> >>> > code should be addressed by improving the core code.
>> >>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd
>> like to
>> >>> >>>> improve
>> >>> >>>> >>> > regardless. People often encounter problems with this if
>> they
>> >>> >>>> forget to
>> >>> >>>> >>> > add entries to /etc/hosts for all their computers,
>> including the
>> >>> >>>> >>> management
>> >>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
>> >>> node at
>> >>> >>>> all
>> >>> >>>> >>> and
>> >>> >>>> >>> > have the value in the computer table be authoritative. This
>> >>> should
>> >>> >>>> >>> > facilitate cases where the provisioning module needs to do
>> >>> something
>> >>> >>>> >>> > different regarding private IPs such as if they are
>> dynamically
>> >>> >>>> >>> allocated.
>> >>> >>>> >>> > The provisioning module would retrieve the IP when the
>> image
>> >>> gets
>> >>> >>>> >>> loaded
>> >>> >>>> >>> > by querying DNS or some other method and then update the
>> >>> database.
>> >>> >>>> The
>> >>> >>>> >>> OS
>> >>> >>>> >>> > module would then use this value to configure the computer.
>> >>> >>>> >>>
>> >>> >>>> >>>
>> >>> >>>> >>> Sounds good. I agree that avoiding the hosts file would be
>> best,
>> >>> >>>> >>> especially
>> >>> >>>> >>> in a case like this where it needs to be continuously
>> modified.
>> >>> Here's
>> >>> >>>> our
>> >>> >>>> >>> changed get_computer_private_ip_address, lines 45-55 are the
>> new
>> >>> code:
>> >>> >>>> >>>
>> >>> >>>> >>> https://gist.github.com/cmann/9896513
>> >>> >>>> >>>
>> >>> >>>> >>> Finally we're still working on putting together more
>> comprehensive
>> >>> >>>> >>> installation documentation for anyone who wants to try it out.
>> >>> We're
>> >>> >>>> use
>> >>> >>>> >>> automation for a number of the tasks and I haven't had a
>> chance
>> >>> to run
>> >>> >>>> >>> through it from scratch yet. For anyone feeling adventurous
>> these
>> >>> are
>> >>> >>>> the
>> >>> >>>> >>> most basic instructions:
>> >>> >>>> >>>
>> >>> >>>> >>> 1. Apply the NAT patch
>> >>> >>>> >>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3
>> and
>> >>> 2.3.1,
>> >>> >>>> >>> make sure to read the Google doc)
>> >>> >>>> >>> 2. Follow the instructions in the readme in the Github repo
>> for
>> >>> the
>> >>> >>>> >>> OpenStack module.
>> >>> >>>> >>>
>> >>> >>>> >>> Cameron
>> >>> >>>> >>>
>> >>> >>>> >>>
>> >>> >>>> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <
>> andy_kurth@ncsu.edu>
>> >>> >>>> wrote:
>> >>> >>>> >>>
>> >>> >>>> >>> > >
>> >>> >>>> >>> > >
>> >>> >>>> >>> > > 2. We use the Try::Tiny module to handle exceptions since
>> the
>> >>> >>>> version
>> >>> >>>> >>> of
>> >>> >>>> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch
>> >>> mechanisms
>> >>> >>>> >>> > available
>> >>> >>>> >>> > > in newer releases, however this would add an additional
>> >>> dependency
>> >>> >>>> to
>> >>> >>>> >>> > VCL.
>> >>> >>>> >>> > > Depending on the version of Perl VCL 2.4 is planning to
>> use
>> >>> what
>> >>> >>>> are
>> >>> >>>> >>> > > people's thoughts on using Try::Tiny versus switching to
>> >>> Perl's
>> >>> >>>> >>> internal
>> >>> >>>> >>> > > mechanisms?
>> >>> >>>> >>> > >
>> >>> >>>> >>> >
>> >>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception
>> handling
>> >>> >>>> features
>> >>> >>>> >>> of
>> >>> >>>> >>> > Perl, but I'd prefer to keep the number of external modules
>> to a
>> >>> >>>> >>> minimum if
>> >>> >>>> >>> > possible. If there are new features in Perl which would be
>> >>> >>>> beneficial,
>> >>> >>>> >>> I'd
>> >>> >>>> >>> > rather make the newer version of Perl a requirement and use
>> the
>> >>> >>>> built in
>> >>> >>>> >>> > features. Otherwise, we're locked into using an external
>> >>> module,
>> >>> >>>> >>> usually
>> >>> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
>> >>> some of
>> >>> >>>> the
>> >>> >>>> >>> > current modules such as InsideOut, rather then writing the
>> code
>> >>> which
>> >>> >>>> >>> could
>> >>> >>>> >>> > accomplish the same objective.
>> >>> >>>> >>> >
>> >>> >>>> >>> > Did you need to catch exceptions because one of the
>> OpenStack
>> >>> modules
>> >>> >>>> >>> > you're using may throw a die exception? When this happens,
>> the
>> >>> >>>> entire
>> >>> >>>> >>> vcld
>> >>> >>>> >>> > process for the reservation exits abruptly which causes
>> problems
>> >>> >>>> such as
>> >>> >>>> >>> > the request state remaining in pending indefinitely. This
>> >>> happens
>> >>> >>>> even
>> >>> >>>> >>> if
>> >>> >>>> >>> > you wrap the call in an eval block. I have worked around
>> this
>> >>> >>>> problem
>> >>> >>>> >>> > before by locally overriding the die handler. Take a look
>> at
>> >>> >>>> >>> > vSphere_SDK.pm and find lines such as:
>> >>> >>>> >>> >
>> >>> >>>> >>> > # Override the die handler
>> >>> >>>> >>> > local $SIG{__DIE__} = sub{};
>> >>> >>>> >>> >
>> >>> >>>> >>> > The vSphere SDK is one example which may call die (via
>> Carp).
>> >>> If
>> >>> >>>> this
>> >>> >>>> >>> > happens with die overridden, the eval block returns
>> normally.
>> >>> If an
>> >>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
>> >>> >>>> >>> >
>> >>> >>>> >>> >
>> >>> >>>> >>> > >
>> >>> >>>> >>> > > 3. I've saved the best for last, but first some
>> background.
>> >>> The
>> >>> >>>> >>> biggest
>> >>> >>>> >>> > > change we've made is that we no longer rely on the
>> /etc/hosts
>> >>> file
>> >>> >>>> at
>> >>> >>>> >>> all
>> >>> >>>> >>> > > (though we haven't removed the code that keeps it up to
>> >>> date). We
>> >>> >>>> had
>> >>> >>>> >>> a
>> >>> >>>> >>> > > number of issues with duplicate entries ending up in the
>> >>> hosts file
>> >>> >>>> >>> and
>> >>> >>>> >>> > > weren't able to pin down the exact cause. This led us to
>> >>> adding a
>> >>> >>>> >>> table
>> >>> >>>> >>> > to
>> >>> >>>> >>> > > the database to track VCL computer to OpenStack instance
>> >>> mappings.
>> >>> >>>> The
>> >>> >>>> >>> > next
>> >>> >>>> >>> > > issue we ran into was the private IP address not being
>> >>> populated in
>> >>> >>>> >>> the
>> >>> >>>> >>> > > hosts file. This happened very rarely and we're still
>> unsure
>> >>> of the
>> >>> >>>> >>> cause
>> >>> >>>> >>> > > especially since there's an explicit check that the
>> address is
>> >>> >>>> >>> populated
>> >>> >>>> >>> > > with a value before we write the hosts file. I'd assume
>> that
>> >>> the
>> >>> >>>> Nova
>> >>> >>>> >>> API
>> >>> >>>> >>> > > occasionally returns a response where the addresses
>> component
>> >>> is
>> >>> >>>> >>> > structured
>> >>> >>>> >>> > > differently than we expect, though I was never able to
>> >>> directly
>> >>> >>>> >>> observe
>> >>> >>>> >>> > > this behavior. Since OpenStack automatically creates DNS
>> >>> entries
>> >>> >>>> for
>> >>> >>>> >>> new
>> >>> >>>> >>> > > instances we decided the best course of action was to
>> bypass
>> >>> the
>> >>> >>>> hosts
>> >>> >>>> >>> > file
>> >>> >>>> >>> > > entirely. In the end we modified
>> >>> get_computer_private_ip_address in
>> >>> >>>> >>> > > DataStructure.pm to do a DNS lookup rather than looking
>> in the
>> >>> >>>> hosts
>> >>> >>>> >>> > file.
>> >>> >>>> >>> > >
>> >>> >>>> >>> > > The question for the community is are changes to core VCL
>> code
>> >>> >>>> >>> > acceptable?
>> >>> >>>> >>> > > Or should we find a solution that keeps everything
>> contained
>> >>> to the
>> >>> >>>> >>> > > provisioning module? If changes to core code are
>> acceptable
>> >>> we'd
>> >>> >>>> also
>> >>> >>>> >>> > have
>> >>> >>>> >>> > > to decide on a method of detecting when to do a DNS
>> lookup.
>> >>> Should
>> >>> >>>> it
>> >>> >>>> >>> > > depend on the provisioning module in use? A configuration
>> >>> option?
>> >>> >>>> >>> >
>> >>> >>>> >>> >
>> >>> >>>> >>> > I see no problems. Any barriers or difficulty you encounter
>> >>> with the
>> >>> >>>> >>> core
>> >>> >>>> >>> > code should be addressed by improving the core code.
>> >>> >>>> >>> >
>> >>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd
>> like to
>> >>> >>>> improve
>> >>> >>>> >>> > regardless. People often encounter problems with this if
>> they
>> >>> >>>> forget to
>> >>> >>>> >>> > add entries to /etc/hosts for all their computers,
>> including the
>> >>> >>>> >>> management
>> >>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
>> >>> node at
>> >>> >>>> all
>> >>> >>>> >>> and
>> >>> >>>> >>> > have the value in the computer table be authoritative. This
>> >>> should
>> >>> >>>> >>> > facilitate cases where the provisioning module needs to do
>> >>> something
>> >>> >>>> >>> > different regarding private IPs such as if they are
>> dynamically
>> >>> >>>> >>> allocated.
>> >>> >>>> >>> > The provisioning module would retrieve the IP when the
>> image
>> >>> gets
>> >>> >>>> >>> loaded
>> >>> >>>> >>> > by querying DNS or some other method and then update the
>> >>> database.
>> >>> >>>> The
>> >>> >>>> >>> OS
>> >>> >>>> >>> > module would then use this value to configure the computer.
>> >>> >>>> >>> >
>> >>> >>>> >>> > One comment regarding adding tables... great! Add all the
>> >>> tables you
>> >>> >>>> >>> think
>> >>> >>>> >>> > are beneficial. I have seen some try to work around the
>> current
>> >>> >>>> >>> database
>> >>> >>>> >>> > schema rather than adding to it. There's no reason for
>> this.
>> >>> If
>> >>> >>>> there
>> >>> >>>> >>> are
>> >>> >>>> >>> > configuration options which apply only to OpenStack, add
>> >>> something
>> >>> >>>> like
>> >>> >>>> >>> an
>> >>> >>>> >>> > openstackconfig table. If the vmprofile table doesn't
>> align,
>> >>> add
>> >>> >>>> >>> something
>> >>> >>>> >>> > like an openstackprofile table. If there are general
>> options
>> >>> such as
>> >>> >>>> >>> how
>> >>> >>>> >>> > to handle DNS or private IP resolution, we could add a more
>> >>> general
>> >>> >>>> >>> table
>> >>> >>>> >>> > or possibly extend the managementnode or computer table.
>> >>> >>>> >>> >
>> >>> >>>> >>> > Thanks,
>> >>> >>>> >>> > Andy
>> >>> >>>> >>> >
>> >>> >>>> >>>
>> >>> >>>> >>
>> >>> >>>> >>
>> >>> >>>>
>> >>> >>>>
>> >>> >>>>
>> >>> >>>> --
>> >>> >>>> Twitter: @serverascode
>> >>> >>>> Blog: serverascode.com
>> >>> >>>>
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >> --
>> >>> >> Twitter: @serverascode
>> >>> >> Blog: serverascode.com
>> >>> >
>> >>> >
>> >>> >
>> >>> > --
>> >>> > Aaron Peeler
>> >>> > Program Manager
>> >>> > Virtual Computing Lab
>> >>> > NC State University
>> >>> >
>> >>> > All electronic mail messages in connection with State business which
>> >>> > are sent to or received by this account are subject to the NC Public
>> >>> > Records Law and may be disclosed to third parties.
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Twitter: @serverascode
>> >>> Blog: serverascode.com
>> >>>
>> >
>> >
>> >
>> > --
>> > Aaron Peeler
>> > Program Manager
>> > Virtual Computing Lab
>> > NC State University
>> >
>> > All electronic mail messages in connection with State business which
>> > are sent to or received by this account are subject to the NC Public
>> > Records Law and may be disclosed to third parties.
>>
>>
>>
>> --
>> Twitter: @serverascode
>> Blog: serverascode.com
>>
--
Twitter: @serverascode
Blog: serverascode.com
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Hi Curtis,
I think you can change the default lease time for dnsmasq protocol in
/etc/dnsmasq.conf. It seems the default dhcp lease time is 150 (150 seconds
I guess).
Thanks,
Young-Hyun
On Wed, Jun 4, 2014 at 11:52 AM, Curtis <se...@gmail.com> wrote:
> Also, as another note/issue, in openstack the dhcp times are usually
> set to a minute or two, which I find quite low but that is what it is
> by default. For windows, during the provisioning process VCL sets the
> time which causes the dhcp ticket to time out and the instance is left
> without an IP and reservations fail. Right now I have commented out
> the part of the code that sets the time.
>
> On Tue, Jun 3, 2014 at 2:21 PM, Aaron Peeler <aa...@ncsu.edu>
> wrote:
> > It was Andy's idea :)
> >
> > Aaron
> >
> > On Tue, Jun 3, 2014 at 4:19 PM, YOUNG OH <oh...@gmail.com>
> wrote:
> >> I think so too.
> >>
> >> Young-Hyun
> >>
> >>
> >> On Tue, Jun 3, 2014 at 3:58 PM, Curtis <se...@gmail.com> wrote:
> >>
> >>> On Tue, Jun 3, 2014 at 1:52 PM, Aaron Peeler <aa...@ncsu.edu>
> >>> wrote:
> >>> > Would using the private IP instead of hostnames resolve it? It would
> >>> > take a bit of work, but could be done.
> >>>
> >>> Yup that would work...as far as I can tell. :)
> >>>
> >>> Thanks,
> >>> Curtis.
> >>>
> >>> >
> >>> > Aaron
> >>> >
> >>> >
> >>> >
> >>> > On Tue, Jun 3, 2014 at 3:22 PM, Curtis <se...@gmail.com>
> wrote:
> >>> >> On Tue, Jun 3, 2014 at 11:53 AM, YOUNG OH <oh...@gmail.com>
> >>> wrote:
> >>> >>> Hi Curtis,
> >>> >>>
> >>> >>> Thank you for updating the status and correction about the
> OpenStack
> >>> Perl
> >>> >>> SDKs.
> >>> >>>
> >>> >>> If DNS lookup is not reliable to find the private ip of an instance
> >>> for a
> >>> >>> multi-host openstack environment, then do you have any suggestion
> to
> >>> deal
> >>> >>> with this issue?
> >>> >>>
> >>> >>> At this point, I think at least we have an agreement that we do NOT
> >>> want to
> >>> >>> use /etc/hosts anymore, right?
> >>> >>> If so, we can first try to use the database to get/update the
> private
> >>> ip
> >>> >>> address with DNS lookup for a single-host openstack environment.
> After
> >>> >>> that, we can try to find a solution to manage the DNS lookup or
> other
> >>> >>> methods of finding the private ip of an instance in multi-host
> >>> openstack
> >>> >>> environment. If you have any other suggestions, please let me know.
> >>> >>>
> >>> >>
> >>> >> I'm not too sure what to do. I'm hoping the Apache VCL core devs
> chime
> >>> in.
> >>> >>
> >>> >> As far as I can tell, Apache VCL needs DNS resolution to work, so
> >>> >> simply adding the IP into the database isn't going to be enough.
> >>> >>
> >>> >> For the current Apache VCL + OpenStack multihost cloud installation
> >>> >> I'm working on I'm just going to add a python script that queries
> >>> >> OpenStack and generates /etc/hosts every 20 or 30 seconds or
> something
> >>> >> like that.
> >>> >>
> >>> >> Thanks,
> >>> >> Curtis.
> >>> >>
> >>> >>> Thanks,
> >>> >>> Young-Hyun
> >>> >>>
> >>> >>>
> >>> >>>
> >>> >>> On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com>
> wrote:
> >>> >>>
> >>> >>>> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <
> oh.younghyun2@gmail.com>
> >>> wrote:
> >>> >>>> > Hi All,
> >>> >>>> >
> >>> >>>> > I would like to bring your attention again to discuss what
> OpenStack
> >>> >>>> module
> >>> >>>> > should include. I would like to discus two issues first.
> >>> >>>> >
> >>> >>>> > First, we know that using /etc/hosts to get the private ip of an
> >>> instance
> >>> >>>> > can be problematic. Specifically, Cameron (at Cybera) and I had
> >>> found
> >>> >>>> that
> >>> >>>> > there might duplicated or blank entries and rarely but OpenStack
> >>> APIs
> >>> >>>> > cannot get the private ip (not populated) of an instance
> properly.
> >>> For
> >>> >>>> the
> >>> >>>> > later case, Cameron added DNS Lookup function to get the correct
> >>> private
> >>> >>>> IP
> >>> >>>> > (Cameron, correct me if I am wrong). This problem leads us to
> avoid
> >>> using
> >>> >>>> > /etc/hosts file to get the private ip but I think we need to
> first
> >>> >>>> discuss
> >>> >>>> > what the best way is to handle the private ip:
> >>> >>>> >
> >>> >>>> > (a). Use the privateIPaddress field in computer table.
> >>> >>>> > Andy suggests that we can change the get_computer_private_ip to
> get
> >>> >>>> private
> >>> >>>> > ip from the database instead of using /etc/hosts (Andy, correct
> me
> >>> if I
> >>> >>>> am
> >>> >>>> > wrong). I agree with his idea because this can avoid duplicated
> or
> >>> blank
> >>> >>>> > entry problem of using /etc/hosts.
> >>> >>>> >
> >>> >>>> > (b). OpenStack (DNS lookup for finding unpopulated private ip)
> >>> >>>> > In our openstack module, DNS lookup or other methods (if any)
> can
> >>> give
> >>> >>>> the
> >>> >>>> > correct the private ip of the instance in order to deal with the
> >>> problem
> >>> >>>> > for the private ip not being populated in the hosts file.
> Cameron
> >>> >>>> modified
> >>> >>>> > the get_computer_private_ip in DataStructure.pm to do a DNS
> lookup
> >>> >>>> instead
> >>> >>>> > of using the hosts file. But I would like to suggest that if
> >>> possible, it
> >>> >>>> > can be better to add the DNS lookup function to openstack module
> >>> rather
> >>> >>>> > than changing the DataStructure.pm. That is, we can update the
> >>> >>>> > privateIPaddress field in computer table using DNS lookup
> instead of
> >>> >>>> > injecting the private ip to /etc/hosts in openstack module.
> >>> >>>>
> >>> >>>> We've just found out recently that the helpful DNS resolution that
> >>> >>>> openstack provides does not work well in a mutlihost openstack
> >>> >>>> environment, so can't be relied on. In multihost mode each compute
> >>> >>>> host only knows about the vms running on it locally.
> >>> >>>>
> >>> >>>> >
> >>> >>>> > I think, if possible, one of the best methods for dealing with
> the
> >>> >>>> private
> >>> >>>> > ip is that we can use the database to get the private ip of an
> >>> instance
> >>> >>>> and
> >>> >>>> > using DNS lookup in openstack module to update the information.
> Any
> >>> >>>> > suggestions and corrections about my opinion would be very
> helpful
> >>> to
> >>> >>>> solve
> >>> >>>> > this problem.
> >>> >>>> >
> >>> >>>> > Second, currently we have two versions (not exactly but for
> >>> convenience);
> >>> >>>> > one uses OpenStack command line interfaces (CLIs) and one uses
> >>> OpenStack
> >>> >>>> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for
> the
> >>> >>>> > OpenStcak CLIs and required to install through CPAN. I think
> both
> >>> >>>> versions
> >>> >>>> > have pros and cons. So, I would like to ask your opinions
> whether
> >>> it is
> >>> >>>> > better to include two different openstack versions to the next
> VCL
> >>> >>>> release,
> >>> >>>> > to find a way to merge two versions into one openstack module,
> OR to
> >>> >>>> create
> >>> >>>> > a higher level of openstack module so that it can choose one
> version
> >>> >>>> based
> >>> >>>> > on user's environment. Any suggestions would be also very
> helpful to
> >>> >>>> decide
> >>> >>>> > how we can manage openstack module. Thank you.
> >>> >>>>
> >>> >>>> FYI -- The perl openstack sdk is not a wrapper for the command
> line
> >>> >>>> utils. It uses the openstack api, not the command line tools.
> >>> >>>>
> >>> >>>> Thanks,
> >>> >>>> Curtis.
> >>> >>>>
> >>> >>>> >
> >>> >>>> > Best regards,
> >>> >>>> > Young-Hyun
> >>> >>>> >
> >>> >>>> >
> >>> >>>> >
> >>> >>>> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <
> oh.younghyun2@gmail.com>
> >>> >>>> wrote:
> >>> >>>> >
> >>> >>>> >> Hi All,
> >>> >>>> >>
> >>> >>>> >> I have tested my openstack module (
> >>> >>>> >> https://issues.apache.org/jira/browse/VCL-590) on the
> OpenStack
> >>> >>>> Icehouse
> >>> >>>> >> (The ninth release of OpenStack, April 17, 2014) and I could
> >>> >>>> provisioning a
> >>> >>>> >> Linux image through it.
> >>> >>>> >>
> >>> >>>> >> The environment details are as follows:
> >>> >>>> >>
> >>> >>>> >> 1. Host Blade
> >>> >>>> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
> >>> >>>> >> :- Memory: 49G
> >>> >>>> >> :- Disk: 134G
> >>> >>>> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
> >>> >>>> >> 2. OpenStack Icehouse Components
> >>> >>>> >> :- Compute
> >>> >>>> >> :- Network (Nova-Network, not OpenStack Neutron)
> >>> >>>> >> :- Glance
> >>> >>>> >> 3. Provisioning Linux image
> >>> >>>> >> :- CentOS 6.3 x64
> >>> >>>> >> 4. VCL 2.3
> >>> >>>> >>
> >>> >>>> >> In this test, I've just tested the provisioning an image but I
> >>> would
> >>> >>>> like
> >>> >>>> >> to post the detail information to jira once I finish other
> test. In
> >>> >>>> >> addition, I will try to add a function of selecting OpenStack
> >>> flavors
> >>> >>>> based
> >>> >>>> >> on the size of an image. The current openstack module sets
> flavors
> >>> for
> >>> >>>> each
> >>> >>>> >> image because the previous OpenStack releases (Essex as I know)
> >>> didn't
> >>> >>>> >> support the size information of images but now it supports. I
> will
> >>> also
> >>> >>>> >> post to jira issue when I add the function to my module. Thank
> you.
> >>> >>>> >>
> >>> >>>> >> Best regards,
> >>> >>>> >> Young-Hyun
> >>> >>>> >>
> >>> >>>> >>
> >>> >>>> >>
> >>> >>>> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <
> >>> cameron.mann@cybera.ca>
> >>> >>>> >> wrote:
> >>> >>>> >>
> >>> >>>> >>> >
> >>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception
> handling
> >>> >>>> features
> >>> >>>> >>> of
> >>> >>>> >>> > Perl, but I'd prefer to keep the number of external modules
> to a
> >>> >>>> >>> minimum if
> >>> >>>> >>> > possible. If there are new features in Perl which would be
> >>> >>>> beneficial,
> >>> >>>> >>> I'd
> >>> >>>> >>> > rather make the newer version of Perl a requirement and use
> the
> >>> >>>> built in
> >>> >>>> >>> > features. Otherwise, we're locked into using an external
> >>> module,
> >>> >>>> >>> usually
> >>> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
> >>> some of
> >>> >>>> the
> >>> >>>> >>> > current modules such as InsideOut, rather then writing the
> code
> >>> which
> >>> >>>> >>> could
> >>> >>>> >>> > accomplish the same objective.
> >>> >>>> >>> > Did you need to catch exceptions because one of the
> OpenStack
> >>> modules
> >>> >>>> >>> > you're using may throw a die exception? When this happens,
> the
> >>> >>>> entire
> >>> >>>> >>> vcld
> >>> >>>> >>> > process for the reservation exits abruptly which causes
> problems
> >>> >>>> such as
> >>> >>>> >>> > the request state remaining in pending indefinitely. This
> >>> happens
> >>> >>>> even
> >>> >>>> >>> if
> >>> >>>> >>> > you wrap the call in an eval block. I have worked around
> this
> >>> >>>> problem
> >>> >>>> >>> > before by locally overriding the die handler. Take a look
> at
> >>> >>>> >>> > vSphere_SDK.pm and find lines such as:
> >>> >>>> >>> > # Override the die handler
> >>> >>>> >>> > local $SIG{__DIE__} = sub{};
> >>> >>>> >>> > The vSphere SDK is one example which may call die (via
> Carp).
> >>> If
> >>> >>>> this
> >>> >>>> >>> > happens with die overridden, the eval block returns
> normally.
> >>> If an
> >>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
> >>> >>>> >>>
> >>> >>>> >>>
> >>> >>>> >>> The OpenStack SDK throws exceptions when requests that
> >>> >>>> >>> delete/modify/create
> >>> >>>> >>> resources fail, no die exceptions though. There wasn't any
> >>> specific
> >>> >>>> >>> feature
> >>> >>>> >>> that made me choose Try::Tiny, it was more my unfamiliarity
> with
> >>> >>>> exception
> >>> >>>> >>> handling in Perl which seemed to have a number of gotchas
> prior to
> >>> >>>> 5.14 so
> >>> >>>> >>> I figured it'd be better to let someone else's code worry
> about
> >>> that.
> >>> >>>> >>>
> >>> >>>> >>>
> >>> >>>> >>>
> >>> >>>>
> >>>
> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
> >>> >>>> >>>
> >>> >>>> >>> I see no problems. Any barriers or difficulty you encounter
> with
> >>> the
> >>> >>>> core
> >>> >>>> >>> > code should be addressed by improving the core code.
> >>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd
> like to
> >>> >>>> improve
> >>> >>>> >>> > regardless. People often encounter problems with this if
> they
> >>> >>>> forget to
> >>> >>>> >>> > add entries to /etc/hosts for all their computers,
> including the
> >>> >>>> >>> management
> >>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
> >>> node at
> >>> >>>> all
> >>> >>>> >>> and
> >>> >>>> >>> > have the value in the computer table be authoritative. This
> >>> should
> >>> >>>> >>> > facilitate cases where the provisioning module needs to do
> >>> something
> >>> >>>> >>> > different regarding private IPs such as if they are
> dynamically
> >>> >>>> >>> allocated.
> >>> >>>> >>> > The provisioning module would retrieve the IP when the
> image
> >>> gets
> >>> >>>> >>> loaded
> >>> >>>> >>> > by querying DNS or some other method and then update the
> >>> database.
> >>> >>>> The
> >>> >>>> >>> OS
> >>> >>>> >>> > module would then use this value to configure the computer.
> >>> >>>> >>>
> >>> >>>> >>>
> >>> >>>> >>> Sounds good. I agree that avoiding the hosts file would be
> best,
> >>> >>>> >>> especially
> >>> >>>> >>> in a case like this where it needs to be continuously
> modified.
> >>> Here's
> >>> >>>> our
> >>> >>>> >>> changed get_computer_private_ip_address, lines 45-55 are the
> new
> >>> code:
> >>> >>>> >>>
> >>> >>>> >>> https://gist.github.com/cmann/9896513
> >>> >>>> >>>
> >>> >>>> >>> Finally we're still working on putting together more
> comprehensive
> >>> >>>> >>> installation documentation for anyone who wants to try it out.
> >>> We're
> >>> >>>> use
> >>> >>>> >>> automation for a number of the tasks and I haven't had a
> chance
> >>> to run
> >>> >>>> >>> through it from scratch yet. For anyone feeling adventurous
> these
> >>> are
> >>> >>>> the
> >>> >>>> >>> most basic instructions:
> >>> >>>> >>>
> >>> >>>> >>> 1. Apply the NAT patch
> >>> >>>> >>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3
> and
> >>> 2.3.1,
> >>> >>>> >>> make sure to read the Google doc)
> >>> >>>> >>> 2. Follow the instructions in the readme in the Github repo
> for
> >>> the
> >>> >>>> >>> OpenStack module.
> >>> >>>> >>>
> >>> >>>> >>> Cameron
> >>> >>>> >>>
> >>> >>>> >>>
> >>> >>>> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <
> andy_kurth@ncsu.edu>
> >>> >>>> wrote:
> >>> >>>> >>>
> >>> >>>> >>> > >
> >>> >>>> >>> > >
> >>> >>>> >>> > > 2. We use the Try::Tiny module to handle exceptions since
> the
> >>> >>>> version
> >>> >>>> >>> of
> >>> >>>> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch
> >>> mechanisms
> >>> >>>> >>> > available
> >>> >>>> >>> > > in newer releases, however this would add an additional
> >>> dependency
> >>> >>>> to
> >>> >>>> >>> > VCL.
> >>> >>>> >>> > > Depending on the version of Perl VCL 2.4 is planning to
> use
> >>> what
> >>> >>>> are
> >>> >>>> >>> > > people's thoughts on using Try::Tiny versus switching to
> >>> Perl's
> >>> >>>> >>> internal
> >>> >>>> >>> > > mechanisms?
> >>> >>>> >>> > >
> >>> >>>> >>> >
> >>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception
> handling
> >>> >>>> features
> >>> >>>> >>> of
> >>> >>>> >>> > Perl, but I'd prefer to keep the number of external modules
> to a
> >>> >>>> >>> minimum if
> >>> >>>> >>> > possible. If there are new features in Perl which would be
> >>> >>>> beneficial,
> >>> >>>> >>> I'd
> >>> >>>> >>> > rather make the newer version of Perl a requirement and use
> the
> >>> >>>> built in
> >>> >>>> >>> > features. Otherwise, we're locked into using an external
> >>> module,
> >>> >>>> >>> usually
> >>> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
> >>> some of
> >>> >>>> the
> >>> >>>> >>> > current modules such as InsideOut, rather then writing the
> code
> >>> which
> >>> >>>> >>> could
> >>> >>>> >>> > accomplish the same objective.
> >>> >>>> >>> >
> >>> >>>> >>> > Did you need to catch exceptions because one of the
> OpenStack
> >>> modules
> >>> >>>> >>> > you're using may throw a die exception? When this happens,
> the
> >>> >>>> entire
> >>> >>>> >>> vcld
> >>> >>>> >>> > process for the reservation exits abruptly which causes
> problems
> >>> >>>> such as
> >>> >>>> >>> > the request state remaining in pending indefinitely. This
> >>> happens
> >>> >>>> even
> >>> >>>> >>> if
> >>> >>>> >>> > you wrap the call in an eval block. I have worked around
> this
> >>> >>>> problem
> >>> >>>> >>> > before by locally overriding the die handler. Take a look
> at
> >>> >>>> >>> > vSphere_SDK.pm and find lines such as:
> >>> >>>> >>> >
> >>> >>>> >>> > # Override the die handler
> >>> >>>> >>> > local $SIG{__DIE__} = sub{};
> >>> >>>> >>> >
> >>> >>>> >>> > The vSphere SDK is one example which may call die (via
> Carp).
> >>> If
> >>> >>>> this
> >>> >>>> >>> > happens with die overridden, the eval block returns
> normally.
> >>> If an
> >>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
> >>> >>>> >>> >
> >>> >>>> >>> >
> >>> >>>> >>> > >
> >>> >>>> >>> > > 3. I've saved the best for last, but first some
> background.
> >>> The
> >>> >>>> >>> biggest
> >>> >>>> >>> > > change we've made is that we no longer rely on the
> /etc/hosts
> >>> file
> >>> >>>> at
> >>> >>>> >>> all
> >>> >>>> >>> > > (though we haven't removed the code that keeps it up to
> >>> date). We
> >>> >>>> had
> >>> >>>> >>> a
> >>> >>>> >>> > > number of issues with duplicate entries ending up in the
> >>> hosts file
> >>> >>>> >>> and
> >>> >>>> >>> > > weren't able to pin down the exact cause. This led us to
> >>> adding a
> >>> >>>> >>> table
> >>> >>>> >>> > to
> >>> >>>> >>> > > the database to track VCL computer to OpenStack instance
> >>> mappings.
> >>> >>>> The
> >>> >>>> >>> > next
> >>> >>>> >>> > > issue we ran into was the private IP address not being
> >>> populated in
> >>> >>>> >>> the
> >>> >>>> >>> > > hosts file. This happened very rarely and we're still
> unsure
> >>> of the
> >>> >>>> >>> cause
> >>> >>>> >>> > > especially since there's an explicit check that the
> address is
> >>> >>>> >>> populated
> >>> >>>> >>> > > with a value before we write the hosts file. I'd assume
> that
> >>> the
> >>> >>>> Nova
> >>> >>>> >>> API
> >>> >>>> >>> > > occasionally returns a response where the addresses
> component
> >>> is
> >>> >>>> >>> > structured
> >>> >>>> >>> > > differently than we expect, though I was never able to
> >>> directly
> >>> >>>> >>> observe
> >>> >>>> >>> > > this behavior. Since OpenStack automatically creates DNS
> >>> entries
> >>> >>>> for
> >>> >>>> >>> new
> >>> >>>> >>> > > instances we decided the best course of action was to
> bypass
> >>> the
> >>> >>>> hosts
> >>> >>>> >>> > file
> >>> >>>> >>> > > entirely. In the end we modified
> >>> get_computer_private_ip_address in
> >>> >>>> >>> > > DataStructure.pm to do a DNS lookup rather than looking
> in the
> >>> >>>> hosts
> >>> >>>> >>> > file.
> >>> >>>> >>> > >
> >>> >>>> >>> > > The question for the community is are changes to core VCL
> code
> >>> >>>> >>> > acceptable?
> >>> >>>> >>> > > Or should we find a solution that keeps everything
> contained
> >>> to the
> >>> >>>> >>> > > provisioning module? If changes to core code are
> acceptable
> >>> we'd
> >>> >>>> also
> >>> >>>> >>> > have
> >>> >>>> >>> > > to decide on a method of detecting when to do a DNS
> lookup.
> >>> Should
> >>> >>>> it
> >>> >>>> >>> > > depend on the provisioning module in use? A configuration
> >>> option?
> >>> >>>> >>> >
> >>> >>>> >>> >
> >>> >>>> >>> > I see no problems. Any barriers or difficulty you encounter
> >>> with the
> >>> >>>> >>> core
> >>> >>>> >>> > code should be addressed by improving the core code.
> >>> >>>> >>> >
> >>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd
> like to
> >>> >>>> improve
> >>> >>>> >>> > regardless. People often encounter problems with this if
> they
> >>> >>>> forget to
> >>> >>>> >>> > add entries to /etc/hosts for all their computers,
> including the
> >>> >>>> >>> management
> >>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
> >>> node at
> >>> >>>> all
> >>> >>>> >>> and
> >>> >>>> >>> > have the value in the computer table be authoritative. This
> >>> should
> >>> >>>> >>> > facilitate cases where the provisioning module needs to do
> >>> something
> >>> >>>> >>> > different regarding private IPs such as if they are
> dynamically
> >>> >>>> >>> allocated.
> >>> >>>> >>> > The provisioning module would retrieve the IP when the
> image
> >>> gets
> >>> >>>> >>> loaded
> >>> >>>> >>> > by querying DNS or some other method and then update the
> >>> database.
> >>> >>>> The
> >>> >>>> >>> OS
> >>> >>>> >>> > module would then use this value to configure the computer.
> >>> >>>> >>> >
> >>> >>>> >>> > One comment regarding adding tables... great! Add all the
> >>> tables you
> >>> >>>> >>> think
> >>> >>>> >>> > are beneficial. I have seen some try to work around the
> current
> >>> >>>> >>> database
> >>> >>>> >>> > schema rather than adding to it. There's no reason for
> this.
> >>> If
> >>> >>>> there
> >>> >>>> >>> are
> >>> >>>> >>> > configuration options which apply only to OpenStack, add
> >>> something
> >>> >>>> like
> >>> >>>> >>> an
> >>> >>>> >>> > openstackconfig table. If the vmprofile table doesn't
> align,
> >>> add
> >>> >>>> >>> something
> >>> >>>> >>> > like an openstackprofile table. If there are general
> options
> >>> such as
> >>> >>>> >>> how
> >>> >>>> >>> > to handle DNS or private IP resolution, we could add a more
> >>> general
> >>> >>>> >>> table
> >>> >>>> >>> > or possibly extend the managementnode or computer table.
> >>> >>>> >>> >
> >>> >>>> >>> > Thanks,
> >>> >>>> >>> > Andy
> >>> >>>> >>> >
> >>> >>>> >>>
> >>> >>>> >>
> >>> >>>> >>
> >>> >>>>
> >>> >>>>
> >>> >>>>
> >>> >>>> --
> >>> >>>> Twitter: @serverascode
> >>> >>>> Blog: serverascode.com
> >>> >>>>
> >>> >>
> >>> >>
> >>> >>
> >>> >> --
> >>> >> Twitter: @serverascode
> >>> >> Blog: serverascode.com
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > Aaron Peeler
> >>> > Program Manager
> >>> > Virtual Computing Lab
> >>> > NC State University
> >>> >
> >>> > All electronic mail messages in connection with State business which
> >>> > are sent to or received by this account are subject to the NC Public
> >>> > Records Law and may be disclosed to third parties.
> >>>
> >>>
> >>>
> >>> --
> >>> Twitter: @serverascode
> >>> Blog: serverascode.com
> >>>
> >
> >
> >
> > --
> > Aaron Peeler
> > Program Manager
> > Virtual Computing Lab
> > NC State University
> >
> > All electronic mail messages in connection with State business which
> > are sent to or received by this account are subject to the NC Public
> > Records Law and may be disclosed to third parties.
>
>
>
> --
> Twitter: @serverascode
> Blog: serverascode.com
>
Re: OpenStack Module
Posted by Curtis <se...@gmail.com>.
Also, as another note/issue, in openstack the dhcp times are usually
set to a minute or two, which I find quite low but that is what it is
by default. For windows, during the provisioning process VCL sets the
time which causes the dhcp ticket to time out and the instance is left
without an IP and reservations fail. Right now I have commented out
the part of the code that sets the time.
On Tue, Jun 3, 2014 at 2:21 PM, Aaron Peeler <aa...@ncsu.edu> wrote:
> It was Andy's idea :)
>
> Aaron
>
> On Tue, Jun 3, 2014 at 4:19 PM, YOUNG OH <oh...@gmail.com> wrote:
>> I think so too.
>>
>> Young-Hyun
>>
>>
>> On Tue, Jun 3, 2014 at 3:58 PM, Curtis <se...@gmail.com> wrote:
>>
>>> On Tue, Jun 3, 2014 at 1:52 PM, Aaron Peeler <aa...@ncsu.edu>
>>> wrote:
>>> > Would using the private IP instead of hostnames resolve it? It would
>>> > take a bit of work, but could be done.
>>>
>>> Yup that would work...as far as I can tell. :)
>>>
>>> Thanks,
>>> Curtis.
>>>
>>> >
>>> > Aaron
>>> >
>>> >
>>> >
>>> > On Tue, Jun 3, 2014 at 3:22 PM, Curtis <se...@gmail.com> wrote:
>>> >> On Tue, Jun 3, 2014 at 11:53 AM, YOUNG OH <oh...@gmail.com>
>>> wrote:
>>> >>> Hi Curtis,
>>> >>>
>>> >>> Thank you for updating the status and correction about the OpenStack
>>> Perl
>>> >>> SDKs.
>>> >>>
>>> >>> If DNS lookup is not reliable to find the private ip of an instance
>>> for a
>>> >>> multi-host openstack environment, then do you have any suggestion to
>>> deal
>>> >>> with this issue?
>>> >>>
>>> >>> At this point, I think at least we have an agreement that we do NOT
>>> want to
>>> >>> use /etc/hosts anymore, right?
>>> >>> If so, we can first try to use the database to get/update the private
>>> ip
>>> >>> address with DNS lookup for a single-host openstack environment. After
>>> >>> that, we can try to find a solution to manage the DNS lookup or other
>>> >>> methods of finding the private ip of an instance in multi-host
>>> openstack
>>> >>> environment. If you have any other suggestions, please let me know.
>>> >>>
>>> >>
>>> >> I'm not too sure what to do. I'm hoping the Apache VCL core devs chime
>>> in.
>>> >>
>>> >> As far as I can tell, Apache VCL needs DNS resolution to work, so
>>> >> simply adding the IP into the database isn't going to be enough.
>>> >>
>>> >> For the current Apache VCL + OpenStack multihost cloud installation
>>> >> I'm working on I'm just going to add a python script that queries
>>> >> OpenStack and generates /etc/hosts every 20 or 30 seconds or something
>>> >> like that.
>>> >>
>>> >> Thanks,
>>> >> Curtis.
>>> >>
>>> >>> Thanks,
>>> >>> Young-Hyun
>>> >>>
>>> >>>
>>> >>>
>>> >>> On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com> wrote:
>>> >>>
>>> >>>> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <oh...@gmail.com>
>>> wrote:
>>> >>>> > Hi All,
>>> >>>> >
>>> >>>> > I would like to bring your attention again to discuss what OpenStack
>>> >>>> module
>>> >>>> > should include. I would like to discus two issues first.
>>> >>>> >
>>> >>>> > First, we know that using /etc/hosts to get the private ip of an
>>> instance
>>> >>>> > can be problematic. Specifically, Cameron (at Cybera) and I had
>>> found
>>> >>>> that
>>> >>>> > there might duplicated or blank entries and rarely but OpenStack
>>> APIs
>>> >>>> > cannot get the private ip (not populated) of an instance properly.
>>> For
>>> >>>> the
>>> >>>> > later case, Cameron added DNS Lookup function to get the correct
>>> private
>>> >>>> IP
>>> >>>> > (Cameron, correct me if I am wrong). This problem leads us to avoid
>>> using
>>> >>>> > /etc/hosts file to get the private ip but I think we need to first
>>> >>>> discuss
>>> >>>> > what the best way is to handle the private ip:
>>> >>>> >
>>> >>>> > (a). Use the privateIPaddress field in computer table.
>>> >>>> > Andy suggests that we can change the get_computer_private_ip to get
>>> >>>> private
>>> >>>> > ip from the database instead of using /etc/hosts (Andy, correct me
>>> if I
>>> >>>> am
>>> >>>> > wrong). I agree with his idea because this can avoid duplicated or
>>> blank
>>> >>>> > entry problem of using /etc/hosts.
>>> >>>> >
>>> >>>> > (b). OpenStack (DNS lookup for finding unpopulated private ip)
>>> >>>> > In our openstack module, DNS lookup or other methods (if any) can
>>> give
>>> >>>> the
>>> >>>> > correct the private ip of the instance in order to deal with the
>>> problem
>>> >>>> > for the private ip not being populated in the hosts file. Cameron
>>> >>>> modified
>>> >>>> > the get_computer_private_ip in DataStructure.pm to do a DNS lookup
>>> >>>> instead
>>> >>>> > of using the hosts file. But I would like to suggest that if
>>> possible, it
>>> >>>> > can be better to add the DNS lookup function to openstack module
>>> rather
>>> >>>> > than changing the DataStructure.pm. That is, we can update the
>>> >>>> > privateIPaddress field in computer table using DNS lookup instead of
>>> >>>> > injecting the private ip to /etc/hosts in openstack module.
>>> >>>>
>>> >>>> We've just found out recently that the helpful DNS resolution that
>>> >>>> openstack provides does not work well in a mutlihost openstack
>>> >>>> environment, so can't be relied on. In multihost mode each compute
>>> >>>> host only knows about the vms running on it locally.
>>> >>>>
>>> >>>> >
>>> >>>> > I think, if possible, one of the best methods for dealing with the
>>> >>>> private
>>> >>>> > ip is that we can use the database to get the private ip of an
>>> instance
>>> >>>> and
>>> >>>> > using DNS lookup in openstack module to update the information. Any
>>> >>>> > suggestions and corrections about my opinion would be very helpful
>>> to
>>> >>>> solve
>>> >>>> > this problem.
>>> >>>> >
>>> >>>> > Second, currently we have two versions (not exactly but for
>>> convenience);
>>> >>>> > one uses OpenStack command line interfaces (CLIs) and one uses
>>> OpenStack
>>> >>>> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for the
>>> >>>> > OpenStcak CLIs and required to install through CPAN. I think both
>>> >>>> versions
>>> >>>> > have pros and cons. So, I would like to ask your opinions whether
>>> it is
>>> >>>> > better to include two different openstack versions to the next VCL
>>> >>>> release,
>>> >>>> > to find a way to merge two versions into one openstack module, OR to
>>> >>>> create
>>> >>>> > a higher level of openstack module so that it can choose one version
>>> >>>> based
>>> >>>> > on user's environment. Any suggestions would be also very helpful to
>>> >>>> decide
>>> >>>> > how we can manage openstack module. Thank you.
>>> >>>>
>>> >>>> FYI -- The perl openstack sdk is not a wrapper for the command line
>>> >>>> utils. It uses the openstack api, not the command line tools.
>>> >>>>
>>> >>>> Thanks,
>>> >>>> Curtis.
>>> >>>>
>>> >>>> >
>>> >>>> > Best regards,
>>> >>>> > Young-Hyun
>>> >>>> >
>>> >>>> >
>>> >>>> >
>>> >>>> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <oh...@gmail.com>
>>> >>>> wrote:
>>> >>>> >
>>> >>>> >> Hi All,
>>> >>>> >>
>>> >>>> >> I have tested my openstack module (
>>> >>>> >> https://issues.apache.org/jira/browse/VCL-590) on the OpenStack
>>> >>>> Icehouse
>>> >>>> >> (The ninth release of OpenStack, April 17, 2014) and I could
>>> >>>> provisioning a
>>> >>>> >> Linux image through it.
>>> >>>> >>
>>> >>>> >> The environment details are as follows:
>>> >>>> >>
>>> >>>> >> 1. Host Blade
>>> >>>> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
>>> >>>> >> :- Memory: 49G
>>> >>>> >> :- Disk: 134G
>>> >>>> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
>>> >>>> >> 2. OpenStack Icehouse Components
>>> >>>> >> :- Compute
>>> >>>> >> :- Network (Nova-Network, not OpenStack Neutron)
>>> >>>> >> :- Glance
>>> >>>> >> 3. Provisioning Linux image
>>> >>>> >> :- CentOS 6.3 x64
>>> >>>> >> 4. VCL 2.3
>>> >>>> >>
>>> >>>> >> In this test, I've just tested the provisioning an image but I
>>> would
>>> >>>> like
>>> >>>> >> to post the detail information to jira once I finish other test. In
>>> >>>> >> addition, I will try to add a function of selecting OpenStack
>>> flavors
>>> >>>> based
>>> >>>> >> on the size of an image. The current openstack module sets flavors
>>> for
>>> >>>> each
>>> >>>> >> image because the previous OpenStack releases (Essex as I know)
>>> didn't
>>> >>>> >> support the size information of images but now it supports. I will
>>> also
>>> >>>> >> post to jira issue when I add the function to my module. Thank you.
>>> >>>> >>
>>> >>>> >> Best regards,
>>> >>>> >> Young-Hyun
>>> >>>> >>
>>> >>>> >>
>>> >>>> >>
>>> >>>> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <
>>> cameron.mann@cybera.ca>
>>> >>>> >> wrote:
>>> >>>> >>
>>> >>>> >>> >
>>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>>> >>>> features
>>> >>>> >>> of
>>> >>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>>> >>>> >>> minimum if
>>> >>>> >>> > possible. If there are new features in Perl which would be
>>> >>>> beneficial,
>>> >>>> >>> I'd
>>> >>>> >>> > rather make the newer version of Perl a requirement and use the
>>> >>>> built in
>>> >>>> >>> > features. Otherwise, we're locked into using an external
>>> module,
>>> >>>> >>> usually
>>> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
>>> some of
>>> >>>> the
>>> >>>> >>> > current modules such as InsideOut, rather then writing the code
>>> which
>>> >>>> >>> could
>>> >>>> >>> > accomplish the same objective.
>>> >>>> >>> > Did you need to catch exceptions because one of the OpenStack
>>> modules
>>> >>>> >>> > you're using may throw a die exception? When this happens, the
>>> >>>> entire
>>> >>>> >>> vcld
>>> >>>> >>> > process for the reservation exits abruptly which causes problems
>>> >>>> such as
>>> >>>> >>> > the request state remaining in pending indefinitely. This
>>> happens
>>> >>>> even
>>> >>>> >>> if
>>> >>>> >>> > you wrap the call in an eval block. I have worked around this
>>> >>>> problem
>>> >>>> >>> > before by locally overriding the die handler. Take a look at
>>> >>>> >>> > vSphere_SDK.pm and find lines such as:
>>> >>>> >>> > # Override the die handler
>>> >>>> >>> > local $SIG{__DIE__} = sub{};
>>> >>>> >>> > The vSphere SDK is one example which may call die (via Carp).
>>> If
>>> >>>> this
>>> >>>> >>> > happens with die overridden, the eval block returns normally.
>>> If an
>>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
>>> >>>> >>>
>>> >>>> >>>
>>> >>>> >>> The OpenStack SDK throws exceptions when requests that
>>> >>>> >>> delete/modify/create
>>> >>>> >>> resources fail, no die exceptions though. There wasn't any
>>> specific
>>> >>>> >>> feature
>>> >>>> >>> that made me choose Try::Tiny, it was more my unfamiliarity with
>>> >>>> exception
>>> >>>> >>> handling in Perl which seemed to have a number of gotchas prior to
>>> >>>> 5.14 so
>>> >>>> >>> I figured it'd be better to let someone else's code worry about
>>> that.
>>> >>>> >>>
>>> >>>> >>>
>>> >>>> >>>
>>> >>>>
>>> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
>>> >>>> >>>
>>> >>>> >>> I see no problems. Any barriers or difficulty you encounter with
>>> the
>>> >>>> core
>>> >>>> >>> > code should be addressed by improving the core code.
>>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>>> >>>> improve
>>> >>>> >>> > regardless. People often encounter problems with this if they
>>> >>>> forget to
>>> >>>> >>> > add entries to /etc/hosts for all their computers, including the
>>> >>>> >>> management
>>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
>>> node at
>>> >>>> all
>>> >>>> >>> and
>>> >>>> >>> > have the value in the computer table be authoritative. This
>>> should
>>> >>>> >>> > facilitate cases where the provisioning module needs to do
>>> something
>>> >>>> >>> > different regarding private IPs such as if they are dynamically
>>> >>>> >>> allocated.
>>> >>>> >>> > The provisioning module would retrieve the IP when the image
>>> gets
>>> >>>> >>> loaded
>>> >>>> >>> > by querying DNS or some other method and then update the
>>> database.
>>> >>>> The
>>> >>>> >>> OS
>>> >>>> >>> > module would then use this value to configure the computer.
>>> >>>> >>>
>>> >>>> >>>
>>> >>>> >>> Sounds good. I agree that avoiding the hosts file would be best,
>>> >>>> >>> especially
>>> >>>> >>> in a case like this where it needs to be continuously modified.
>>> Here's
>>> >>>> our
>>> >>>> >>> changed get_computer_private_ip_address, lines 45-55 are the new
>>> code:
>>> >>>> >>>
>>> >>>> >>> https://gist.github.com/cmann/9896513
>>> >>>> >>>
>>> >>>> >>> Finally we're still working on putting together more comprehensive
>>> >>>> >>> installation documentation for anyone who wants to try it out.
>>> We're
>>> >>>> use
>>> >>>> >>> automation for a number of the tasks and I haven't had a chance
>>> to run
>>> >>>> >>> through it from scratch yet. For anyone feeling adventurous these
>>> are
>>> >>>> the
>>> >>>> >>> most basic instructions:
>>> >>>> >>>
>>> >>>> >>> 1. Apply the NAT patch
>>> >>>> >>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and
>>> 2.3.1,
>>> >>>> >>> make sure to read the Google doc)
>>> >>>> >>> 2. Follow the instructions in the readme in the Github repo for
>>> the
>>> >>>> >>> OpenStack module.
>>> >>>> >>>
>>> >>>> >>> Cameron
>>> >>>> >>>
>>> >>>> >>>
>>> >>>> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu>
>>> >>>> wrote:
>>> >>>> >>>
>>> >>>> >>> > >
>>> >>>> >>> > >
>>> >>>> >>> > > 2. We use the Try::Tiny module to handle exceptions since the
>>> >>>> version
>>> >>>> >>> of
>>> >>>> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch
>>> mechanisms
>>> >>>> >>> > available
>>> >>>> >>> > > in newer releases, however this would add an additional
>>> dependency
>>> >>>> to
>>> >>>> >>> > VCL.
>>> >>>> >>> > > Depending on the version of Perl VCL 2.4 is planning to use
>>> what
>>> >>>> are
>>> >>>> >>> > > people's thoughts on using Try::Tiny versus switching to
>>> Perl's
>>> >>>> >>> internal
>>> >>>> >>> > > mechanisms?
>>> >>>> >>> > >
>>> >>>> >>> >
>>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>>> >>>> features
>>> >>>> >>> of
>>> >>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>>> >>>> >>> minimum if
>>> >>>> >>> > possible. If there are new features in Perl which would be
>>> >>>> beneficial,
>>> >>>> >>> I'd
>>> >>>> >>> > rather make the newer version of Perl a requirement and use the
>>> >>>> built in
>>> >>>> >>> > features. Otherwise, we're locked into using an external
>>> module,
>>> >>>> >>> usually
>>> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
>>> some of
>>> >>>> the
>>> >>>> >>> > current modules such as InsideOut, rather then writing the code
>>> which
>>> >>>> >>> could
>>> >>>> >>> > accomplish the same objective.
>>> >>>> >>> >
>>> >>>> >>> > Did you need to catch exceptions because one of the OpenStack
>>> modules
>>> >>>> >>> > you're using may throw a die exception? When this happens, the
>>> >>>> entire
>>> >>>> >>> vcld
>>> >>>> >>> > process for the reservation exits abruptly which causes problems
>>> >>>> such as
>>> >>>> >>> > the request state remaining in pending indefinitely. This
>>> happens
>>> >>>> even
>>> >>>> >>> if
>>> >>>> >>> > you wrap the call in an eval block. I have worked around this
>>> >>>> problem
>>> >>>> >>> > before by locally overriding the die handler. Take a look at
>>> >>>> >>> > vSphere_SDK.pm and find lines such as:
>>> >>>> >>> >
>>> >>>> >>> > # Override the die handler
>>> >>>> >>> > local $SIG{__DIE__} = sub{};
>>> >>>> >>> >
>>> >>>> >>> > The vSphere SDK is one example which may call die (via Carp).
>>> If
>>> >>>> this
>>> >>>> >>> > happens with die overridden, the eval block returns normally.
>>> If an
>>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
>>> >>>> >>> >
>>> >>>> >>> >
>>> >>>> >>> > >
>>> >>>> >>> > > 3. I've saved the best for last, but first some background.
>>> The
>>> >>>> >>> biggest
>>> >>>> >>> > > change we've made is that we no longer rely on the /etc/hosts
>>> file
>>> >>>> at
>>> >>>> >>> all
>>> >>>> >>> > > (though we haven't removed the code that keeps it up to
>>> date). We
>>> >>>> had
>>> >>>> >>> a
>>> >>>> >>> > > number of issues with duplicate entries ending up in the
>>> hosts file
>>> >>>> >>> and
>>> >>>> >>> > > weren't able to pin down the exact cause. This led us to
>>> adding a
>>> >>>> >>> table
>>> >>>> >>> > to
>>> >>>> >>> > > the database to track VCL computer to OpenStack instance
>>> mappings.
>>> >>>> The
>>> >>>> >>> > next
>>> >>>> >>> > > issue we ran into was the private IP address not being
>>> populated in
>>> >>>> >>> the
>>> >>>> >>> > > hosts file. This happened very rarely and we're still unsure
>>> of the
>>> >>>> >>> cause
>>> >>>> >>> > > especially since there's an explicit check that the address is
>>> >>>> >>> populated
>>> >>>> >>> > > with a value before we write the hosts file. I'd assume that
>>> the
>>> >>>> Nova
>>> >>>> >>> API
>>> >>>> >>> > > occasionally returns a response where the addresses component
>>> is
>>> >>>> >>> > structured
>>> >>>> >>> > > differently than we expect, though I was never able to
>>> directly
>>> >>>> >>> observe
>>> >>>> >>> > > this behavior. Since OpenStack automatically creates DNS
>>> entries
>>> >>>> for
>>> >>>> >>> new
>>> >>>> >>> > > instances we decided the best course of action was to bypass
>>> the
>>> >>>> hosts
>>> >>>> >>> > file
>>> >>>> >>> > > entirely. In the end we modified
>>> get_computer_private_ip_address in
>>> >>>> >>> > > DataStructure.pm to do a DNS lookup rather than looking in the
>>> >>>> hosts
>>> >>>> >>> > file.
>>> >>>> >>> > >
>>> >>>> >>> > > The question for the community is are changes to core VCL code
>>> >>>> >>> > acceptable?
>>> >>>> >>> > > Or should we find a solution that keeps everything contained
>>> to the
>>> >>>> >>> > > provisioning module? If changes to core code are acceptable
>>> we'd
>>> >>>> also
>>> >>>> >>> > have
>>> >>>> >>> > > to decide on a method of detecting when to do a DNS lookup.
>>> Should
>>> >>>> it
>>> >>>> >>> > > depend on the provisioning module in use? A configuration
>>> option?
>>> >>>> >>> >
>>> >>>> >>> >
>>> >>>> >>> > I see no problems. Any barriers or difficulty you encounter
>>> with the
>>> >>>> >>> core
>>> >>>> >>> > code should be addressed by improving the core code.
>>> >>>> >>> >
>>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>>> >>>> improve
>>> >>>> >>> > regardless. People often encounter problems with this if they
>>> >>>> forget to
>>> >>>> >>> > add entries to /etc/hosts for all their computers, including the
>>> >>>> >>> management
>>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
>>> node at
>>> >>>> all
>>> >>>> >>> and
>>> >>>> >>> > have the value in the computer table be authoritative. This
>>> should
>>> >>>> >>> > facilitate cases where the provisioning module needs to do
>>> something
>>> >>>> >>> > different regarding private IPs such as if they are dynamically
>>> >>>> >>> allocated.
>>> >>>> >>> > The provisioning module would retrieve the IP when the image
>>> gets
>>> >>>> >>> loaded
>>> >>>> >>> > by querying DNS or some other method and then update the
>>> database.
>>> >>>> The
>>> >>>> >>> OS
>>> >>>> >>> > module would then use this value to configure the computer.
>>> >>>> >>> >
>>> >>>> >>> > One comment regarding adding tables... great! Add all the
>>> tables you
>>> >>>> >>> think
>>> >>>> >>> > are beneficial. I have seen some try to work around the current
>>> >>>> >>> database
>>> >>>> >>> > schema rather than adding to it. There's no reason for this.
>>> If
>>> >>>> there
>>> >>>> >>> are
>>> >>>> >>> > configuration options which apply only to OpenStack, add
>>> something
>>> >>>> like
>>> >>>> >>> an
>>> >>>> >>> > openstackconfig table. If the vmprofile table doesn't align,
>>> add
>>> >>>> >>> something
>>> >>>> >>> > like an openstackprofile table. If there are general options
>>> such as
>>> >>>> >>> how
>>> >>>> >>> > to handle DNS or private IP resolution, we could add a more
>>> general
>>> >>>> >>> table
>>> >>>> >>> > or possibly extend the managementnode or computer table.
>>> >>>> >>> >
>>> >>>> >>> > Thanks,
>>> >>>> >>> > Andy
>>> >>>> >>> >
>>> >>>> >>>
>>> >>>> >>
>>> >>>> >>
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> --
>>> >>>> Twitter: @serverascode
>>> >>>> Blog: serverascode.com
>>> >>>>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Twitter: @serverascode
>>> >> Blog: serverascode.com
>>> >
>>> >
>>> >
>>> > --
>>> > Aaron Peeler
>>> > Program Manager
>>> > Virtual Computing Lab
>>> > NC State University
>>> >
>>> > All electronic mail messages in connection with State business which
>>> > are sent to or received by this account are subject to the NC Public
>>> > Records Law and may be disclosed to third parties.
>>>
>>>
>>>
>>> --
>>> Twitter: @serverascode
>>> Blog: serverascode.com
>>>
>
>
>
> --
> Aaron Peeler
> Program Manager
> Virtual Computing Lab
> NC State University
>
> All electronic mail messages in connection with State business which
> are sent to or received by this account are subject to the NC Public
> Records Law and may be disclosed to third parties.
--
Twitter: @serverascode
Blog: serverascode.com
Re: OpenStack Module
Posted by Aaron Peeler <aa...@ncsu.edu>.
It was Andy's idea :)
Aaron
On Tue, Jun 3, 2014 at 4:19 PM, YOUNG OH <oh...@gmail.com> wrote:
> I think so too.
>
> Young-Hyun
>
>
> On Tue, Jun 3, 2014 at 3:58 PM, Curtis <se...@gmail.com> wrote:
>
>> On Tue, Jun 3, 2014 at 1:52 PM, Aaron Peeler <aa...@ncsu.edu>
>> wrote:
>> > Would using the private IP instead of hostnames resolve it? It would
>> > take a bit of work, but could be done.
>>
>> Yup that would work...as far as I can tell. :)
>>
>> Thanks,
>> Curtis.
>>
>> >
>> > Aaron
>> >
>> >
>> >
>> > On Tue, Jun 3, 2014 at 3:22 PM, Curtis <se...@gmail.com> wrote:
>> >> On Tue, Jun 3, 2014 at 11:53 AM, YOUNG OH <oh...@gmail.com>
>> wrote:
>> >>> Hi Curtis,
>> >>>
>> >>> Thank you for updating the status and correction about the OpenStack
>> Perl
>> >>> SDKs.
>> >>>
>> >>> If DNS lookup is not reliable to find the private ip of an instance
>> for a
>> >>> multi-host openstack environment, then do you have any suggestion to
>> deal
>> >>> with this issue?
>> >>>
>> >>> At this point, I think at least we have an agreement that we do NOT
>> want to
>> >>> use /etc/hosts anymore, right?
>> >>> If so, we can first try to use the database to get/update the private
>> ip
>> >>> address with DNS lookup for a single-host openstack environment. After
>> >>> that, we can try to find a solution to manage the DNS lookup or other
>> >>> methods of finding the private ip of an instance in multi-host
>> openstack
>> >>> environment. If you have any other suggestions, please let me know.
>> >>>
>> >>
>> >> I'm not too sure what to do. I'm hoping the Apache VCL core devs chime
>> in.
>> >>
>> >> As far as I can tell, Apache VCL needs DNS resolution to work, so
>> >> simply adding the IP into the database isn't going to be enough.
>> >>
>> >> For the current Apache VCL + OpenStack multihost cloud installation
>> >> I'm working on I'm just going to add a python script that queries
>> >> OpenStack and generates /etc/hosts every 20 or 30 seconds or something
>> >> like that.
>> >>
>> >> Thanks,
>> >> Curtis.
>> >>
>> >>> Thanks,
>> >>> Young-Hyun
>> >>>
>> >>>
>> >>>
>> >>> On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com> wrote:
>> >>>
>> >>>> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <oh...@gmail.com>
>> wrote:
>> >>>> > Hi All,
>> >>>> >
>> >>>> > I would like to bring your attention again to discuss what OpenStack
>> >>>> module
>> >>>> > should include. I would like to discus two issues first.
>> >>>> >
>> >>>> > First, we know that using /etc/hosts to get the private ip of an
>> instance
>> >>>> > can be problematic. Specifically, Cameron (at Cybera) and I had
>> found
>> >>>> that
>> >>>> > there might duplicated or blank entries and rarely but OpenStack
>> APIs
>> >>>> > cannot get the private ip (not populated) of an instance properly.
>> For
>> >>>> the
>> >>>> > later case, Cameron added DNS Lookup function to get the correct
>> private
>> >>>> IP
>> >>>> > (Cameron, correct me if I am wrong). This problem leads us to avoid
>> using
>> >>>> > /etc/hosts file to get the private ip but I think we need to first
>> >>>> discuss
>> >>>> > what the best way is to handle the private ip:
>> >>>> >
>> >>>> > (a). Use the privateIPaddress field in computer table.
>> >>>> > Andy suggests that we can change the get_computer_private_ip to get
>> >>>> private
>> >>>> > ip from the database instead of using /etc/hosts (Andy, correct me
>> if I
>> >>>> am
>> >>>> > wrong). I agree with his idea because this can avoid duplicated or
>> blank
>> >>>> > entry problem of using /etc/hosts.
>> >>>> >
>> >>>> > (b). OpenStack (DNS lookup for finding unpopulated private ip)
>> >>>> > In our openstack module, DNS lookup or other methods (if any) can
>> give
>> >>>> the
>> >>>> > correct the private ip of the instance in order to deal with the
>> problem
>> >>>> > for the private ip not being populated in the hosts file. Cameron
>> >>>> modified
>> >>>> > the get_computer_private_ip in DataStructure.pm to do a DNS lookup
>> >>>> instead
>> >>>> > of using the hosts file. But I would like to suggest that if
>> possible, it
>> >>>> > can be better to add the DNS lookup function to openstack module
>> rather
>> >>>> > than changing the DataStructure.pm. That is, we can update the
>> >>>> > privateIPaddress field in computer table using DNS lookup instead of
>> >>>> > injecting the private ip to /etc/hosts in openstack module.
>> >>>>
>> >>>> We've just found out recently that the helpful DNS resolution that
>> >>>> openstack provides does not work well in a mutlihost openstack
>> >>>> environment, so can't be relied on. In multihost mode each compute
>> >>>> host only knows about the vms running on it locally.
>> >>>>
>> >>>> >
>> >>>> > I think, if possible, one of the best methods for dealing with the
>> >>>> private
>> >>>> > ip is that we can use the database to get the private ip of an
>> instance
>> >>>> and
>> >>>> > using DNS lookup in openstack module to update the information. Any
>> >>>> > suggestions and corrections about my opinion would be very helpful
>> to
>> >>>> solve
>> >>>> > this problem.
>> >>>> >
>> >>>> > Second, currently we have two versions (not exactly but for
>> convenience);
>> >>>> > one uses OpenStack command line interfaces (CLIs) and one uses
>> OpenStack
>> >>>> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for the
>> >>>> > OpenStcak CLIs and required to install through CPAN. I think both
>> >>>> versions
>> >>>> > have pros and cons. So, I would like to ask your opinions whether
>> it is
>> >>>> > better to include two different openstack versions to the next VCL
>> >>>> release,
>> >>>> > to find a way to merge two versions into one openstack module, OR to
>> >>>> create
>> >>>> > a higher level of openstack module so that it can choose one version
>> >>>> based
>> >>>> > on user's environment. Any suggestions would be also very helpful to
>> >>>> decide
>> >>>> > how we can manage openstack module. Thank you.
>> >>>>
>> >>>> FYI -- The perl openstack sdk is not a wrapper for the command line
>> >>>> utils. It uses the openstack api, not the command line tools.
>> >>>>
>> >>>> Thanks,
>> >>>> Curtis.
>> >>>>
>> >>>> >
>> >>>> > Best regards,
>> >>>> > Young-Hyun
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <oh...@gmail.com>
>> >>>> wrote:
>> >>>> >
>> >>>> >> Hi All,
>> >>>> >>
>> >>>> >> I have tested my openstack module (
>> >>>> >> https://issues.apache.org/jira/browse/VCL-590) on the OpenStack
>> >>>> Icehouse
>> >>>> >> (The ninth release of OpenStack, April 17, 2014) and I could
>> >>>> provisioning a
>> >>>> >> Linux image through it.
>> >>>> >>
>> >>>> >> The environment details are as follows:
>> >>>> >>
>> >>>> >> 1. Host Blade
>> >>>> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
>> >>>> >> :- Memory: 49G
>> >>>> >> :- Disk: 134G
>> >>>> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
>> >>>> >> 2. OpenStack Icehouse Components
>> >>>> >> :- Compute
>> >>>> >> :- Network (Nova-Network, not OpenStack Neutron)
>> >>>> >> :- Glance
>> >>>> >> 3. Provisioning Linux image
>> >>>> >> :- CentOS 6.3 x64
>> >>>> >> 4. VCL 2.3
>> >>>> >>
>> >>>> >> In this test, I've just tested the provisioning an image but I
>> would
>> >>>> like
>> >>>> >> to post the detail information to jira once I finish other test. In
>> >>>> >> addition, I will try to add a function of selecting OpenStack
>> flavors
>> >>>> based
>> >>>> >> on the size of an image. The current openstack module sets flavors
>> for
>> >>>> each
>> >>>> >> image because the previous OpenStack releases (Essex as I know)
>> didn't
>> >>>> >> support the size information of images but now it supports. I will
>> also
>> >>>> >> post to jira issue when I add the function to my module. Thank you.
>> >>>> >>
>> >>>> >> Best regards,
>> >>>> >> Young-Hyun
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <
>> cameron.mann@cybera.ca>
>> >>>> >> wrote:
>> >>>> >>
>> >>>> >>> >
>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>> >>>> features
>> >>>> >>> of
>> >>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>> >>>> >>> minimum if
>> >>>> >>> > possible. If there are new features in Perl which would be
>> >>>> beneficial,
>> >>>> >>> I'd
>> >>>> >>> > rather make the newer version of Perl a requirement and use the
>> >>>> built in
>> >>>> >>> > features. Otherwise, we're locked into using an external
>> module,
>> >>>> >>> usually
>> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
>> some of
>> >>>> the
>> >>>> >>> > current modules such as InsideOut, rather then writing the code
>> which
>> >>>> >>> could
>> >>>> >>> > accomplish the same objective.
>> >>>> >>> > Did you need to catch exceptions because one of the OpenStack
>> modules
>> >>>> >>> > you're using may throw a die exception? When this happens, the
>> >>>> entire
>> >>>> >>> vcld
>> >>>> >>> > process for the reservation exits abruptly which causes problems
>> >>>> such as
>> >>>> >>> > the request state remaining in pending indefinitely. This
>> happens
>> >>>> even
>> >>>> >>> if
>> >>>> >>> > you wrap the call in an eval block. I have worked around this
>> >>>> problem
>> >>>> >>> > before by locally overriding the die handler. Take a look at
>> >>>> >>> > vSphere_SDK.pm and find lines such as:
>> >>>> >>> > # Override the die handler
>> >>>> >>> > local $SIG{__DIE__} = sub{};
>> >>>> >>> > The vSphere SDK is one example which may call die (via Carp).
>> If
>> >>>> this
>> >>>> >>> > happens with die overridden, the eval block returns normally.
>> If an
>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
>> >>>> >>>
>> >>>> >>>
>> >>>> >>> The OpenStack SDK throws exceptions when requests that
>> >>>> >>> delete/modify/create
>> >>>> >>> resources fail, no die exceptions though. There wasn't any
>> specific
>> >>>> >>> feature
>> >>>> >>> that made me choose Try::Tiny, it was more my unfamiliarity with
>> >>>> exception
>> >>>> >>> handling in Perl which seemed to have a number of gotchas prior to
>> >>>> 5.14 so
>> >>>> >>> I figured it'd be better to let someone else's code worry about
>> that.
>> >>>> >>>
>> >>>> >>>
>> >>>> >>>
>> >>>>
>> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
>> >>>> >>>
>> >>>> >>> I see no problems. Any barriers or difficulty you encounter with
>> the
>> >>>> core
>> >>>> >>> > code should be addressed by improving the core code.
>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>> >>>> improve
>> >>>> >>> > regardless. People often encounter problems with this if they
>> >>>> forget to
>> >>>> >>> > add entries to /etc/hosts for all their computers, including the
>> >>>> >>> management
>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
>> node at
>> >>>> all
>> >>>> >>> and
>> >>>> >>> > have the value in the computer table be authoritative. This
>> should
>> >>>> >>> > facilitate cases where the provisioning module needs to do
>> something
>> >>>> >>> > different regarding private IPs such as if they are dynamically
>> >>>> >>> allocated.
>> >>>> >>> > The provisioning module would retrieve the IP when the image
>> gets
>> >>>> >>> loaded
>> >>>> >>> > by querying DNS or some other method and then update the
>> database.
>> >>>> The
>> >>>> >>> OS
>> >>>> >>> > module would then use this value to configure the computer.
>> >>>> >>>
>> >>>> >>>
>> >>>> >>> Sounds good. I agree that avoiding the hosts file would be best,
>> >>>> >>> especially
>> >>>> >>> in a case like this where it needs to be continuously modified.
>> Here's
>> >>>> our
>> >>>> >>> changed get_computer_private_ip_address, lines 45-55 are the new
>> code:
>> >>>> >>>
>> >>>> >>> https://gist.github.com/cmann/9896513
>> >>>> >>>
>> >>>> >>> Finally we're still working on putting together more comprehensive
>> >>>> >>> installation documentation for anyone who wants to try it out.
>> We're
>> >>>> use
>> >>>> >>> automation for a number of the tasks and I haven't had a chance
>> to run
>> >>>> >>> through it from scratch yet. For anyone feeling adventurous these
>> are
>> >>>> the
>> >>>> >>> most basic instructions:
>> >>>> >>>
>> >>>> >>> 1. Apply the NAT patch
>> >>>> >>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and
>> 2.3.1,
>> >>>> >>> make sure to read the Google doc)
>> >>>> >>> 2. Follow the instructions in the readme in the Github repo for
>> the
>> >>>> >>> OpenStack module.
>> >>>> >>>
>> >>>> >>> Cameron
>> >>>> >>>
>> >>>> >>>
>> >>>> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu>
>> >>>> wrote:
>> >>>> >>>
>> >>>> >>> > >
>> >>>> >>> > >
>> >>>> >>> > > 2. We use the Try::Tiny module to handle exceptions since the
>> >>>> version
>> >>>> >>> of
>> >>>> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch
>> mechanisms
>> >>>> >>> > available
>> >>>> >>> > > in newer releases, however this would add an additional
>> dependency
>> >>>> to
>> >>>> >>> > VCL.
>> >>>> >>> > > Depending on the version of Perl VCL 2.4 is planning to use
>> what
>> >>>> are
>> >>>> >>> > > people's thoughts on using Try::Tiny versus switching to
>> Perl's
>> >>>> >>> internal
>> >>>> >>> > > mechanisms?
>> >>>> >>> > >
>> >>>> >>> >
>> >>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>> >>>> features
>> >>>> >>> of
>> >>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>> >>>> >>> minimum if
>> >>>> >>> > possible. If there are new features in Perl which would be
>> >>>> beneficial,
>> >>>> >>> I'd
>> >>>> >>> > rather make the newer version of Perl a requirement and use the
>> >>>> built in
>> >>>> >>> > features. Otherwise, we're locked into using an external
>> module,
>> >>>> >>> usually
>> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
>> some of
>> >>>> the
>> >>>> >>> > current modules such as InsideOut, rather then writing the code
>> which
>> >>>> >>> could
>> >>>> >>> > accomplish the same objective.
>> >>>> >>> >
>> >>>> >>> > Did you need to catch exceptions because one of the OpenStack
>> modules
>> >>>> >>> > you're using may throw a die exception? When this happens, the
>> >>>> entire
>> >>>> >>> vcld
>> >>>> >>> > process for the reservation exits abruptly which causes problems
>> >>>> such as
>> >>>> >>> > the request state remaining in pending indefinitely. This
>> happens
>> >>>> even
>> >>>> >>> if
>> >>>> >>> > you wrap the call in an eval block. I have worked around this
>> >>>> problem
>> >>>> >>> > before by locally overriding the die handler. Take a look at
>> >>>> >>> > vSphere_SDK.pm and find lines such as:
>> >>>> >>> >
>> >>>> >>> > # Override the die handler
>> >>>> >>> > local $SIG{__DIE__} = sub{};
>> >>>> >>> >
>> >>>> >>> > The vSphere SDK is one example which may call die (via Carp).
>> If
>> >>>> this
>> >>>> >>> > happens with die overridden, the eval block returns normally.
>> If an
>> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
>> >>>> >>> >
>> >>>> >>> >
>> >>>> >>> > >
>> >>>> >>> > > 3. I've saved the best for last, but first some background.
>> The
>> >>>> >>> biggest
>> >>>> >>> > > change we've made is that we no longer rely on the /etc/hosts
>> file
>> >>>> at
>> >>>> >>> all
>> >>>> >>> > > (though we haven't removed the code that keeps it up to
>> date). We
>> >>>> had
>> >>>> >>> a
>> >>>> >>> > > number of issues with duplicate entries ending up in the
>> hosts file
>> >>>> >>> and
>> >>>> >>> > > weren't able to pin down the exact cause. This led us to
>> adding a
>> >>>> >>> table
>> >>>> >>> > to
>> >>>> >>> > > the database to track VCL computer to OpenStack instance
>> mappings.
>> >>>> The
>> >>>> >>> > next
>> >>>> >>> > > issue we ran into was the private IP address not being
>> populated in
>> >>>> >>> the
>> >>>> >>> > > hosts file. This happened very rarely and we're still unsure
>> of the
>> >>>> >>> cause
>> >>>> >>> > > especially since there's an explicit check that the address is
>> >>>> >>> populated
>> >>>> >>> > > with a value before we write the hosts file. I'd assume that
>> the
>> >>>> Nova
>> >>>> >>> API
>> >>>> >>> > > occasionally returns a response where the addresses component
>> is
>> >>>> >>> > structured
>> >>>> >>> > > differently than we expect, though I was never able to
>> directly
>> >>>> >>> observe
>> >>>> >>> > > this behavior. Since OpenStack automatically creates DNS
>> entries
>> >>>> for
>> >>>> >>> new
>> >>>> >>> > > instances we decided the best course of action was to bypass
>> the
>> >>>> hosts
>> >>>> >>> > file
>> >>>> >>> > > entirely. In the end we modified
>> get_computer_private_ip_address in
>> >>>> >>> > > DataStructure.pm to do a DNS lookup rather than looking in the
>> >>>> hosts
>> >>>> >>> > file.
>> >>>> >>> > >
>> >>>> >>> > > The question for the community is are changes to core VCL code
>> >>>> >>> > acceptable?
>> >>>> >>> > > Or should we find a solution that keeps everything contained
>> to the
>> >>>> >>> > > provisioning module? If changes to core code are acceptable
>> we'd
>> >>>> also
>> >>>> >>> > have
>> >>>> >>> > > to decide on a method of detecting when to do a DNS lookup.
>> Should
>> >>>> it
>> >>>> >>> > > depend on the provisioning module in use? A configuration
>> option?
>> >>>> >>> >
>> >>>> >>> >
>> >>>> >>> > I see no problems. Any barriers or difficulty you encounter
>> with the
>> >>>> >>> core
>> >>>> >>> > code should be addressed by improving the core code.
>> >>>> >>> >
>> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>> >>>> improve
>> >>>> >>> > regardless. People often encounter problems with this if they
>> >>>> forget to
>> >>>> >>> > add entries to /etc/hosts for all their computers, including the
>> >>>> >>> management
>> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
>> node at
>> >>>> all
>> >>>> >>> and
>> >>>> >>> > have the value in the computer table be authoritative. This
>> should
>> >>>> >>> > facilitate cases where the provisioning module needs to do
>> something
>> >>>> >>> > different regarding private IPs such as if they are dynamically
>> >>>> >>> allocated.
>> >>>> >>> > The provisioning module would retrieve the IP when the image
>> gets
>> >>>> >>> loaded
>> >>>> >>> > by querying DNS or some other method and then update the
>> database.
>> >>>> The
>> >>>> >>> OS
>> >>>> >>> > module would then use this value to configure the computer.
>> >>>> >>> >
>> >>>> >>> > One comment regarding adding tables... great! Add all the
>> tables you
>> >>>> >>> think
>> >>>> >>> > are beneficial. I have seen some try to work around the current
>> >>>> >>> database
>> >>>> >>> > schema rather than adding to it. There's no reason for this.
>> If
>> >>>> there
>> >>>> >>> are
>> >>>> >>> > configuration options which apply only to OpenStack, add
>> something
>> >>>> like
>> >>>> >>> an
>> >>>> >>> > openstackconfig table. If the vmprofile table doesn't align,
>> add
>> >>>> >>> something
>> >>>> >>> > like an openstackprofile table. If there are general options
>> such as
>> >>>> >>> how
>> >>>> >>> > to handle DNS or private IP resolution, we could add a more
>> general
>> >>>> >>> table
>> >>>> >>> > or possibly extend the managementnode or computer table.
>> >>>> >>> >
>> >>>> >>> > Thanks,
>> >>>> >>> > Andy
>> >>>> >>> >
>> >>>> >>>
>> >>>> >>
>> >>>> >>
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Twitter: @serverascode
>> >>>> Blog: serverascode.com
>> >>>>
>> >>
>> >>
>> >>
>> >> --
>> >> Twitter: @serverascode
>> >> Blog: serverascode.com
>> >
>> >
>> >
>> > --
>> > Aaron Peeler
>> > Program Manager
>> > Virtual Computing Lab
>> > NC State University
>> >
>> > All electronic mail messages in connection with State business which
>> > are sent to or received by this account are subject to the NC Public
>> > Records Law and may be disclosed to third parties.
>>
>>
>>
>> --
>> Twitter: @serverascode
>> Blog: serverascode.com
>>
--
Aaron Peeler
Program Manager
Virtual Computing Lab
NC State University
All electronic mail messages in connection with State business which
are sent to or received by this account are subject to the NC Public
Records Law and may be disclosed to third parties.
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
I think so too.
Young-Hyun
On Tue, Jun 3, 2014 at 3:58 PM, Curtis <se...@gmail.com> wrote:
> On Tue, Jun 3, 2014 at 1:52 PM, Aaron Peeler <aa...@ncsu.edu>
> wrote:
> > Would using the private IP instead of hostnames resolve it? It would
> > take a bit of work, but could be done.
>
> Yup that would work...as far as I can tell. :)
>
> Thanks,
> Curtis.
>
> >
> > Aaron
> >
> >
> >
> > On Tue, Jun 3, 2014 at 3:22 PM, Curtis <se...@gmail.com> wrote:
> >> On Tue, Jun 3, 2014 at 11:53 AM, YOUNG OH <oh...@gmail.com>
> wrote:
> >>> Hi Curtis,
> >>>
> >>> Thank you for updating the status and correction about the OpenStack
> Perl
> >>> SDKs.
> >>>
> >>> If DNS lookup is not reliable to find the private ip of an instance
> for a
> >>> multi-host openstack environment, then do you have any suggestion to
> deal
> >>> with this issue?
> >>>
> >>> At this point, I think at least we have an agreement that we do NOT
> want to
> >>> use /etc/hosts anymore, right?
> >>> If so, we can first try to use the database to get/update the private
> ip
> >>> address with DNS lookup for a single-host openstack environment. After
> >>> that, we can try to find a solution to manage the DNS lookup or other
> >>> methods of finding the private ip of an instance in multi-host
> openstack
> >>> environment. If you have any other suggestions, please let me know.
> >>>
> >>
> >> I'm not too sure what to do. I'm hoping the Apache VCL core devs chime
> in.
> >>
> >> As far as I can tell, Apache VCL needs DNS resolution to work, so
> >> simply adding the IP into the database isn't going to be enough.
> >>
> >> For the current Apache VCL + OpenStack multihost cloud installation
> >> I'm working on I'm just going to add a python script that queries
> >> OpenStack and generates /etc/hosts every 20 or 30 seconds or something
> >> like that.
> >>
> >> Thanks,
> >> Curtis.
> >>
> >>> Thanks,
> >>> Young-Hyun
> >>>
> >>>
> >>>
> >>> On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com> wrote:
> >>>
> >>>> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <oh...@gmail.com>
> wrote:
> >>>> > Hi All,
> >>>> >
> >>>> > I would like to bring your attention again to discuss what OpenStack
> >>>> module
> >>>> > should include. I would like to discus two issues first.
> >>>> >
> >>>> > First, we know that using /etc/hosts to get the private ip of an
> instance
> >>>> > can be problematic. Specifically, Cameron (at Cybera) and I had
> found
> >>>> that
> >>>> > there might duplicated or blank entries and rarely but OpenStack
> APIs
> >>>> > cannot get the private ip (not populated) of an instance properly.
> For
> >>>> the
> >>>> > later case, Cameron added DNS Lookup function to get the correct
> private
> >>>> IP
> >>>> > (Cameron, correct me if I am wrong). This problem leads us to avoid
> using
> >>>> > /etc/hosts file to get the private ip but I think we need to first
> >>>> discuss
> >>>> > what the best way is to handle the private ip:
> >>>> >
> >>>> > (a). Use the privateIPaddress field in computer table.
> >>>> > Andy suggests that we can change the get_computer_private_ip to get
> >>>> private
> >>>> > ip from the database instead of using /etc/hosts (Andy, correct me
> if I
> >>>> am
> >>>> > wrong). I agree with his idea because this can avoid duplicated or
> blank
> >>>> > entry problem of using /etc/hosts.
> >>>> >
> >>>> > (b). OpenStack (DNS lookup for finding unpopulated private ip)
> >>>> > In our openstack module, DNS lookup or other methods (if any) can
> give
> >>>> the
> >>>> > correct the private ip of the instance in order to deal with the
> problem
> >>>> > for the private ip not being populated in the hosts file. Cameron
> >>>> modified
> >>>> > the get_computer_private_ip in DataStructure.pm to do a DNS lookup
> >>>> instead
> >>>> > of using the hosts file. But I would like to suggest that if
> possible, it
> >>>> > can be better to add the DNS lookup function to openstack module
> rather
> >>>> > than changing the DataStructure.pm. That is, we can update the
> >>>> > privateIPaddress field in computer table using DNS lookup instead of
> >>>> > injecting the private ip to /etc/hosts in openstack module.
> >>>>
> >>>> We've just found out recently that the helpful DNS resolution that
> >>>> openstack provides does not work well in a mutlihost openstack
> >>>> environment, so can't be relied on. In multihost mode each compute
> >>>> host only knows about the vms running on it locally.
> >>>>
> >>>> >
> >>>> > I think, if possible, one of the best methods for dealing with the
> >>>> private
> >>>> > ip is that we can use the database to get the private ip of an
> instance
> >>>> and
> >>>> > using DNS lookup in openstack module to update the information. Any
> >>>> > suggestions and corrections about my opinion would be very helpful
> to
> >>>> solve
> >>>> > this problem.
> >>>> >
> >>>> > Second, currently we have two versions (not exactly but for
> convenience);
> >>>> > one uses OpenStack command line interfaces (CLIs) and one uses
> OpenStack
> >>>> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for the
> >>>> > OpenStcak CLIs and required to install through CPAN. I think both
> >>>> versions
> >>>> > have pros and cons. So, I would like to ask your opinions whether
> it is
> >>>> > better to include two different openstack versions to the next VCL
> >>>> release,
> >>>> > to find a way to merge two versions into one openstack module, OR to
> >>>> create
> >>>> > a higher level of openstack module so that it can choose one version
> >>>> based
> >>>> > on user's environment. Any suggestions would be also very helpful to
> >>>> decide
> >>>> > how we can manage openstack module. Thank you.
> >>>>
> >>>> FYI -- The perl openstack sdk is not a wrapper for the command line
> >>>> utils. It uses the openstack api, not the command line tools.
> >>>>
> >>>> Thanks,
> >>>> Curtis.
> >>>>
> >>>> >
> >>>> > Best regards,
> >>>> > Young-Hyun
> >>>> >
> >>>> >
> >>>> >
> >>>> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <oh...@gmail.com>
> >>>> wrote:
> >>>> >
> >>>> >> Hi All,
> >>>> >>
> >>>> >> I have tested my openstack module (
> >>>> >> https://issues.apache.org/jira/browse/VCL-590) on the OpenStack
> >>>> Icehouse
> >>>> >> (The ninth release of OpenStack, April 17, 2014) and I could
> >>>> provisioning a
> >>>> >> Linux image through it.
> >>>> >>
> >>>> >> The environment details are as follows:
> >>>> >>
> >>>> >> 1. Host Blade
> >>>> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
> >>>> >> :- Memory: 49G
> >>>> >> :- Disk: 134G
> >>>> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
> >>>> >> 2. OpenStack Icehouse Components
> >>>> >> :- Compute
> >>>> >> :- Network (Nova-Network, not OpenStack Neutron)
> >>>> >> :- Glance
> >>>> >> 3. Provisioning Linux image
> >>>> >> :- CentOS 6.3 x64
> >>>> >> 4. VCL 2.3
> >>>> >>
> >>>> >> In this test, I've just tested the provisioning an image but I
> would
> >>>> like
> >>>> >> to post the detail information to jira once I finish other test. In
> >>>> >> addition, I will try to add a function of selecting OpenStack
> flavors
> >>>> based
> >>>> >> on the size of an image. The current openstack module sets flavors
> for
> >>>> each
> >>>> >> image because the previous OpenStack releases (Essex as I know)
> didn't
> >>>> >> support the size information of images but now it supports. I will
> also
> >>>> >> post to jira issue when I add the function to my module. Thank you.
> >>>> >>
> >>>> >> Best regards,
> >>>> >> Young-Hyun
> >>>> >>
> >>>> >>
> >>>> >>
> >>>> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <
> cameron.mann@cybera.ca>
> >>>> >> wrote:
> >>>> >>
> >>>> >>> >
> >>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
> >>>> features
> >>>> >>> of
> >>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
> >>>> >>> minimum if
> >>>> >>> > possible. If there are new features in Perl which would be
> >>>> beneficial,
> >>>> >>> I'd
> >>>> >>> > rather make the newer version of Perl a requirement and use the
> >>>> built in
> >>>> >>> > features. Otherwise, we're locked into using an external
> module,
> >>>> >>> usually
> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
> some of
> >>>> the
> >>>> >>> > current modules such as InsideOut, rather then writing the code
> which
> >>>> >>> could
> >>>> >>> > accomplish the same objective.
> >>>> >>> > Did you need to catch exceptions because one of the OpenStack
> modules
> >>>> >>> > you're using may throw a die exception? When this happens, the
> >>>> entire
> >>>> >>> vcld
> >>>> >>> > process for the reservation exits abruptly which causes problems
> >>>> such as
> >>>> >>> > the request state remaining in pending indefinitely. This
> happens
> >>>> even
> >>>> >>> if
> >>>> >>> > you wrap the call in an eval block. I have worked around this
> >>>> problem
> >>>> >>> > before by locally overriding the die handler. Take a look at
> >>>> >>> > vSphere_SDK.pm and find lines such as:
> >>>> >>> > # Override the die handler
> >>>> >>> > local $SIG{__DIE__} = sub{};
> >>>> >>> > The vSphere SDK is one example which may call die (via Carp).
> If
> >>>> this
> >>>> >>> > happens with die overridden, the eval block returns normally.
> If an
> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
> >>>> >>>
> >>>> >>>
> >>>> >>> The OpenStack SDK throws exceptions when requests that
> >>>> >>> delete/modify/create
> >>>> >>> resources fail, no die exceptions though. There wasn't any
> specific
> >>>> >>> feature
> >>>> >>> that made me choose Try::Tiny, it was more my unfamiliarity with
> >>>> exception
> >>>> >>> handling in Perl which seemed to have a number of gotchas prior to
> >>>> 5.14 so
> >>>> >>> I figured it'd be better to let someone else's code worry about
> that.
> >>>> >>>
> >>>> >>>
> >>>> >>>
> >>>>
> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
> >>>> >>>
> >>>> >>> I see no problems. Any barriers or difficulty you encounter with
> the
> >>>> core
> >>>> >>> > code should be addressed by improving the core code.
> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
> >>>> improve
> >>>> >>> > regardless. People often encounter problems with this if they
> >>>> forget to
> >>>> >>> > add entries to /etc/hosts for all their computers, including the
> >>>> >>> management
> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
> node at
> >>>> all
> >>>> >>> and
> >>>> >>> > have the value in the computer table be authoritative. This
> should
> >>>> >>> > facilitate cases where the provisioning module needs to do
> something
> >>>> >>> > different regarding private IPs such as if they are dynamically
> >>>> >>> allocated.
> >>>> >>> > The provisioning module would retrieve the IP when the image
> gets
> >>>> >>> loaded
> >>>> >>> > by querying DNS or some other method and then update the
> database.
> >>>> The
> >>>> >>> OS
> >>>> >>> > module would then use this value to configure the computer.
> >>>> >>>
> >>>> >>>
> >>>> >>> Sounds good. I agree that avoiding the hosts file would be best,
> >>>> >>> especially
> >>>> >>> in a case like this where it needs to be continuously modified.
> Here's
> >>>> our
> >>>> >>> changed get_computer_private_ip_address, lines 45-55 are the new
> code:
> >>>> >>>
> >>>> >>> https://gist.github.com/cmann/9896513
> >>>> >>>
> >>>> >>> Finally we're still working on putting together more comprehensive
> >>>> >>> installation documentation for anyone who wants to try it out.
> We're
> >>>> use
> >>>> >>> automation for a number of the tasks and I haven't had a chance
> to run
> >>>> >>> through it from scratch yet. For anyone feeling adventurous these
> are
> >>>> the
> >>>> >>> most basic instructions:
> >>>> >>>
> >>>> >>> 1. Apply the NAT patch
> >>>> >>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and
> 2.3.1,
> >>>> >>> make sure to read the Google doc)
> >>>> >>> 2. Follow the instructions in the readme in the Github repo for
> the
> >>>> >>> OpenStack module.
> >>>> >>>
> >>>> >>> Cameron
> >>>> >>>
> >>>> >>>
> >>>> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu>
> >>>> wrote:
> >>>> >>>
> >>>> >>> > >
> >>>> >>> > >
> >>>> >>> > > 2. We use the Try::Tiny module to handle exceptions since the
> >>>> version
> >>>> >>> of
> >>>> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch
> mechanisms
> >>>> >>> > available
> >>>> >>> > > in newer releases, however this would add an additional
> dependency
> >>>> to
> >>>> >>> > VCL.
> >>>> >>> > > Depending on the version of Perl VCL 2.4 is planning to use
> what
> >>>> are
> >>>> >>> > > people's thoughts on using Try::Tiny versus switching to
> Perl's
> >>>> >>> internal
> >>>> >>> > > mechanisms?
> >>>> >>> > >
> >>>> >>> >
> >>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
> >>>> features
> >>>> >>> of
> >>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
> >>>> >>> minimum if
> >>>> >>> > possible. If there are new features in Perl which would be
> >>>> beneficial,
> >>>> >>> I'd
> >>>> >>> > rather make the newer version of Perl a requirement and use the
> >>>> built in
> >>>> >>> > features. Otherwise, we're locked into using an external
> module,
> >>>> >>> usually
> >>>> >>> > from CPAN, which has no quality assurance. I regret adding
> some of
> >>>> the
> >>>> >>> > current modules such as InsideOut, rather then writing the code
> which
> >>>> >>> could
> >>>> >>> > accomplish the same objective.
> >>>> >>> >
> >>>> >>> > Did you need to catch exceptions because one of the OpenStack
> modules
> >>>> >>> > you're using may throw a die exception? When this happens, the
> >>>> entire
> >>>> >>> vcld
> >>>> >>> > process for the reservation exits abruptly which causes problems
> >>>> such as
> >>>> >>> > the request state remaining in pending indefinitely. This
> happens
> >>>> even
> >>>> >>> if
> >>>> >>> > you wrap the call in an eval block. I have worked around this
> >>>> problem
> >>>> >>> > before by locally overriding the die handler. Take a look at
> >>>> >>> > vSphere_SDK.pm and find lines such as:
> >>>> >>> >
> >>>> >>> > # Override the die handler
> >>>> >>> > local $SIG{__DIE__} = sub{};
> >>>> >>> >
> >>>> >>> > The vSphere SDK is one example which may call die (via Carp).
> If
> >>>> this
> >>>> >>> > happens with die overridden, the eval block returns normally.
> If an
> >>>> >>> > exception occurred, $EVAL_ERROR should be set.
> >>>> >>> >
> >>>> >>> >
> >>>> >>> > >
> >>>> >>> > > 3. I've saved the best for last, but first some background.
> The
> >>>> >>> biggest
> >>>> >>> > > change we've made is that we no longer rely on the /etc/hosts
> file
> >>>> at
> >>>> >>> all
> >>>> >>> > > (though we haven't removed the code that keeps it up to
> date). We
> >>>> had
> >>>> >>> a
> >>>> >>> > > number of issues with duplicate entries ending up in the
> hosts file
> >>>> >>> and
> >>>> >>> > > weren't able to pin down the exact cause. This led us to
> adding a
> >>>> >>> table
> >>>> >>> > to
> >>>> >>> > > the database to track VCL computer to OpenStack instance
> mappings.
> >>>> The
> >>>> >>> > next
> >>>> >>> > > issue we ran into was the private IP address not being
> populated in
> >>>> >>> the
> >>>> >>> > > hosts file. This happened very rarely and we're still unsure
> of the
> >>>> >>> cause
> >>>> >>> > > especially since there's an explicit check that the address is
> >>>> >>> populated
> >>>> >>> > > with a value before we write the hosts file. I'd assume that
> the
> >>>> Nova
> >>>> >>> API
> >>>> >>> > > occasionally returns a response where the addresses component
> is
> >>>> >>> > structured
> >>>> >>> > > differently than we expect, though I was never able to
> directly
> >>>> >>> observe
> >>>> >>> > > this behavior. Since OpenStack automatically creates DNS
> entries
> >>>> for
> >>>> >>> new
> >>>> >>> > > instances we decided the best course of action was to bypass
> the
> >>>> hosts
> >>>> >>> > file
> >>>> >>> > > entirely. In the end we modified
> get_computer_private_ip_address in
> >>>> >>> > > DataStructure.pm to do a DNS lookup rather than looking in the
> >>>> hosts
> >>>> >>> > file.
> >>>> >>> > >
> >>>> >>> > > The question for the community is are changes to core VCL code
> >>>> >>> > acceptable?
> >>>> >>> > > Or should we find a solution that keeps everything contained
> to the
> >>>> >>> > > provisioning module? If changes to core code are acceptable
> we'd
> >>>> also
> >>>> >>> > have
> >>>> >>> > > to decide on a method of detecting when to do a DNS lookup.
> Should
> >>>> it
> >>>> >>> > > depend on the provisioning module in use? A configuration
> option?
> >>>> >>> >
> >>>> >>> >
> >>>> >>> > I see no problems. Any barriers or difficulty you encounter
> with the
> >>>> >>> core
> >>>> >>> > code should be addressed by improving the core code.
> >>>> >>> >
> >>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
> >>>> improve
> >>>> >>> > regardless. People often encounter problems with this if they
> >>>> forget to
> >>>> >>> > add entries to /etc/hosts for all their computers, including the
> >>>> >>> management
> >>>> >>> > node(s). I'd like to not read /etc/hosts on the management
> node at
> >>>> all
> >>>> >>> and
> >>>> >>> > have the value in the computer table be authoritative. This
> should
> >>>> >>> > facilitate cases where the provisioning module needs to do
> something
> >>>> >>> > different regarding private IPs such as if they are dynamically
> >>>> >>> allocated.
> >>>> >>> > The provisioning module would retrieve the IP when the image
> gets
> >>>> >>> loaded
> >>>> >>> > by querying DNS or some other method and then update the
> database.
> >>>> The
> >>>> >>> OS
> >>>> >>> > module would then use this value to configure the computer.
> >>>> >>> >
> >>>> >>> > One comment regarding adding tables... great! Add all the
> tables you
> >>>> >>> think
> >>>> >>> > are beneficial. I have seen some try to work around the current
> >>>> >>> database
> >>>> >>> > schema rather than adding to it. There's no reason for this.
> If
> >>>> there
> >>>> >>> are
> >>>> >>> > configuration options which apply only to OpenStack, add
> something
> >>>> like
> >>>> >>> an
> >>>> >>> > openstackconfig table. If the vmprofile table doesn't align,
> add
> >>>> >>> something
> >>>> >>> > like an openstackprofile table. If there are general options
> such as
> >>>> >>> how
> >>>> >>> > to handle DNS or private IP resolution, we could add a more
> general
> >>>> >>> table
> >>>> >>> > or possibly extend the managementnode or computer table.
> >>>> >>> >
> >>>> >>> > Thanks,
> >>>> >>> > Andy
> >>>> >>> >
> >>>> >>>
> >>>> >>
> >>>> >>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Twitter: @serverascode
> >>>> Blog: serverascode.com
> >>>>
> >>
> >>
> >>
> >> --
> >> Twitter: @serverascode
> >> Blog: serverascode.com
> >
> >
> >
> > --
> > Aaron Peeler
> > Program Manager
> > Virtual Computing Lab
> > NC State University
> >
> > All electronic mail messages in connection with State business which
> > are sent to or received by this account are subject to the NC Public
> > Records Law and may be disclosed to third parties.
>
>
>
> --
> Twitter: @serverascode
> Blog: serverascode.com
>
Re: OpenStack Module
Posted by Curtis <se...@gmail.com>.
On Tue, Jun 3, 2014 at 1:52 PM, Aaron Peeler <aa...@ncsu.edu> wrote:
> Would using the private IP instead of hostnames resolve it? It would
> take a bit of work, but could be done.
Yup that would work...as far as I can tell. :)
Thanks,
Curtis.
>
> Aaron
>
>
>
> On Tue, Jun 3, 2014 at 3:22 PM, Curtis <se...@gmail.com> wrote:
>> On Tue, Jun 3, 2014 at 11:53 AM, YOUNG OH <oh...@gmail.com> wrote:
>>> Hi Curtis,
>>>
>>> Thank you for updating the status and correction about the OpenStack Perl
>>> SDKs.
>>>
>>> If DNS lookup is not reliable to find the private ip of an instance for a
>>> multi-host openstack environment, then do you have any suggestion to deal
>>> with this issue?
>>>
>>> At this point, I think at least we have an agreement that we do NOT want to
>>> use /etc/hosts anymore, right?
>>> If so, we can first try to use the database to get/update the private ip
>>> address with DNS lookup for a single-host openstack environment. After
>>> that, we can try to find a solution to manage the DNS lookup or other
>>> methods of finding the private ip of an instance in multi-host openstack
>>> environment. If you have any other suggestions, please let me know.
>>>
>>
>> I'm not too sure what to do. I'm hoping the Apache VCL core devs chime in.
>>
>> As far as I can tell, Apache VCL needs DNS resolution to work, so
>> simply adding the IP into the database isn't going to be enough.
>>
>> For the current Apache VCL + OpenStack multihost cloud installation
>> I'm working on I'm just going to add a python script that queries
>> OpenStack and generates /etc/hosts every 20 or 30 seconds or something
>> like that.
>>
>> Thanks,
>> Curtis.
>>
>>> Thanks,
>>> Young-Hyun
>>>
>>>
>>>
>>> On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com> wrote:
>>>
>>>> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <oh...@gmail.com> wrote:
>>>> > Hi All,
>>>> >
>>>> > I would like to bring your attention again to discuss what OpenStack
>>>> module
>>>> > should include. I would like to discus two issues first.
>>>> >
>>>> > First, we know that using /etc/hosts to get the private ip of an instance
>>>> > can be problematic. Specifically, Cameron (at Cybera) and I had found
>>>> that
>>>> > there might duplicated or blank entries and rarely but OpenStack APIs
>>>> > cannot get the private ip (not populated) of an instance properly. For
>>>> the
>>>> > later case, Cameron added DNS Lookup function to get the correct private
>>>> IP
>>>> > (Cameron, correct me if I am wrong). This problem leads us to avoid using
>>>> > /etc/hosts file to get the private ip but I think we need to first
>>>> discuss
>>>> > what the best way is to handle the private ip:
>>>> >
>>>> > (a). Use the privateIPaddress field in computer table.
>>>> > Andy suggests that we can change the get_computer_private_ip to get
>>>> private
>>>> > ip from the database instead of using /etc/hosts (Andy, correct me if I
>>>> am
>>>> > wrong). I agree with his idea because this can avoid duplicated or blank
>>>> > entry problem of using /etc/hosts.
>>>> >
>>>> > (b). OpenStack (DNS lookup for finding unpopulated private ip)
>>>> > In our openstack module, DNS lookup or other methods (if any) can give
>>>> the
>>>> > correct the private ip of the instance in order to deal with the problem
>>>> > for the private ip not being populated in the hosts file. Cameron
>>>> modified
>>>> > the get_computer_private_ip in DataStructure.pm to do a DNS lookup
>>>> instead
>>>> > of using the hosts file. But I would like to suggest that if possible, it
>>>> > can be better to add the DNS lookup function to openstack module rather
>>>> > than changing the DataStructure.pm. That is, we can update the
>>>> > privateIPaddress field in computer table using DNS lookup instead of
>>>> > injecting the private ip to /etc/hosts in openstack module.
>>>>
>>>> We've just found out recently that the helpful DNS resolution that
>>>> openstack provides does not work well in a mutlihost openstack
>>>> environment, so can't be relied on. In multihost mode each compute
>>>> host only knows about the vms running on it locally.
>>>>
>>>> >
>>>> > I think, if possible, one of the best methods for dealing with the
>>>> private
>>>> > ip is that we can use the database to get the private ip of an instance
>>>> and
>>>> > using DNS lookup in openstack module to update the information. Any
>>>> > suggestions and corrections about my opinion would be very helpful to
>>>> solve
>>>> > this problem.
>>>> >
>>>> > Second, currently we have two versions (not exactly but for convenience);
>>>> > one uses OpenStack command line interfaces (CLIs) and one uses OpenStack
>>>> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for the
>>>> > OpenStcak CLIs and required to install through CPAN. I think both
>>>> versions
>>>> > have pros and cons. So, I would like to ask your opinions whether it is
>>>> > better to include two different openstack versions to the next VCL
>>>> release,
>>>> > to find a way to merge two versions into one openstack module, OR to
>>>> create
>>>> > a higher level of openstack module so that it can choose one version
>>>> based
>>>> > on user's environment. Any suggestions would be also very helpful to
>>>> decide
>>>> > how we can manage openstack module. Thank you.
>>>>
>>>> FYI -- The perl openstack sdk is not a wrapper for the command line
>>>> utils. It uses the openstack api, not the command line tools.
>>>>
>>>> Thanks,
>>>> Curtis.
>>>>
>>>> >
>>>> > Best regards,
>>>> > Young-Hyun
>>>> >
>>>> >
>>>> >
>>>> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <oh...@gmail.com>
>>>> wrote:
>>>> >
>>>> >> Hi All,
>>>> >>
>>>> >> I have tested my openstack module (
>>>> >> https://issues.apache.org/jira/browse/VCL-590) on the OpenStack
>>>> Icehouse
>>>> >> (The ninth release of OpenStack, April 17, 2014) and I could
>>>> provisioning a
>>>> >> Linux image through it.
>>>> >>
>>>> >> The environment details are as follows:
>>>> >>
>>>> >> 1. Host Blade
>>>> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
>>>> >> :- Memory: 49G
>>>> >> :- Disk: 134G
>>>> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
>>>> >> 2. OpenStack Icehouse Components
>>>> >> :- Compute
>>>> >> :- Network (Nova-Network, not OpenStack Neutron)
>>>> >> :- Glance
>>>> >> 3. Provisioning Linux image
>>>> >> :- CentOS 6.3 x64
>>>> >> 4. VCL 2.3
>>>> >>
>>>> >> In this test, I've just tested the provisioning an image but I would
>>>> like
>>>> >> to post the detail information to jira once I finish other test. In
>>>> >> addition, I will try to add a function of selecting OpenStack flavors
>>>> based
>>>> >> on the size of an image. The current openstack module sets flavors for
>>>> each
>>>> >> image because the previous OpenStack releases (Essex as I know) didn't
>>>> >> support the size information of images but now it supports. I will also
>>>> >> post to jira issue when I add the function to my module. Thank you.
>>>> >>
>>>> >> Best regards,
>>>> >> Young-Hyun
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <ca...@cybera.ca>
>>>> >> wrote:
>>>> >>
>>>> >>> >
>>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>>>> features
>>>> >>> of
>>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>>>> >>> minimum if
>>>> >>> > possible. If there are new features in Perl which would be
>>>> beneficial,
>>>> >>> I'd
>>>> >>> > rather make the newer version of Perl a requirement and use the
>>>> built in
>>>> >>> > features. Otherwise, we're locked into using an external module,
>>>> >>> usually
>>>> >>> > from CPAN, which has no quality assurance. I regret adding some of
>>>> the
>>>> >>> > current modules such as InsideOut, rather then writing the code which
>>>> >>> could
>>>> >>> > accomplish the same objective.
>>>> >>> > Did you need to catch exceptions because one of the OpenStack modules
>>>> >>> > you're using may throw a die exception? When this happens, the
>>>> entire
>>>> >>> vcld
>>>> >>> > process for the reservation exits abruptly which causes problems
>>>> such as
>>>> >>> > the request state remaining in pending indefinitely. This happens
>>>> even
>>>> >>> if
>>>> >>> > you wrap the call in an eval block. I have worked around this
>>>> problem
>>>> >>> > before by locally overriding the die handler. Take a look at
>>>> >>> > vSphere_SDK.pm and find lines such as:
>>>> >>> > # Override the die handler
>>>> >>> > local $SIG{__DIE__} = sub{};
>>>> >>> > The vSphere SDK is one example which may call die (via Carp). If
>>>> this
>>>> >>> > happens with die overridden, the eval block returns normally. If an
>>>> >>> > exception occurred, $EVAL_ERROR should be set.
>>>> >>>
>>>> >>>
>>>> >>> The OpenStack SDK throws exceptions when requests that
>>>> >>> delete/modify/create
>>>> >>> resources fail, no die exceptions though. There wasn't any specific
>>>> >>> feature
>>>> >>> that made me choose Try::Tiny, it was more my unfamiliarity with
>>>> exception
>>>> >>> handling in Perl which seemed to have a number of gotchas prior to
>>>> 5.14 so
>>>> >>> I figured it'd be better to let someone else's code worry about that.
>>>> >>>
>>>> >>>
>>>> >>>
>>>> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
>>>> >>>
>>>> >>> I see no problems. Any barriers or difficulty you encounter with the
>>>> core
>>>> >>> > code should be addressed by improving the core code.
>>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>>>> improve
>>>> >>> > regardless. People often encounter problems with this if they
>>>> forget to
>>>> >>> > add entries to /etc/hosts for all their computers, including the
>>>> >>> management
>>>> >>> > node(s). I'd like to not read /etc/hosts on the management node at
>>>> all
>>>> >>> and
>>>> >>> > have the value in the computer table be authoritative. This should
>>>> >>> > facilitate cases where the provisioning module needs to do something
>>>> >>> > different regarding private IPs such as if they are dynamically
>>>> >>> allocated.
>>>> >>> > The provisioning module would retrieve the IP when the image gets
>>>> >>> loaded
>>>> >>> > by querying DNS or some other method and then update the database.
>>>> The
>>>> >>> OS
>>>> >>> > module would then use this value to configure the computer.
>>>> >>>
>>>> >>>
>>>> >>> Sounds good. I agree that avoiding the hosts file would be best,
>>>> >>> especially
>>>> >>> in a case like this where it needs to be continuously modified. Here's
>>>> our
>>>> >>> changed get_computer_private_ip_address, lines 45-55 are the new code:
>>>> >>>
>>>> >>> https://gist.github.com/cmann/9896513
>>>> >>>
>>>> >>> Finally we're still working on putting together more comprehensive
>>>> >>> installation documentation for anyone who wants to try it out. We're
>>>> use
>>>> >>> automation for a number of the tasks and I haven't had a chance to run
>>>> >>> through it from scratch yet. For anyone feeling adventurous these are
>>>> the
>>>> >>> most basic instructions:
>>>> >>>
>>>> >>> 1. Apply the NAT patch
>>>> >>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and 2.3.1,
>>>> >>> make sure to read the Google doc)
>>>> >>> 2. Follow the instructions in the readme in the Github repo for the
>>>> >>> OpenStack module.
>>>> >>>
>>>> >>> Cameron
>>>> >>>
>>>> >>>
>>>> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu>
>>>> wrote:
>>>> >>>
>>>> >>> > >
>>>> >>> > >
>>>> >>> > > 2. We use the Try::Tiny module to handle exceptions since the
>>>> version
>>>> >>> of
>>>> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch mechanisms
>>>> >>> > available
>>>> >>> > > in newer releases, however this would add an additional dependency
>>>> to
>>>> >>> > VCL.
>>>> >>> > > Depending on the version of Perl VCL 2.4 is planning to use what
>>>> are
>>>> >>> > > people's thoughts on using Try::Tiny versus switching to Perl's
>>>> >>> internal
>>>> >>> > > mechanisms?
>>>> >>> > >
>>>> >>> >
>>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>>>> features
>>>> >>> of
>>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>>>> >>> minimum if
>>>> >>> > possible. If there are new features in Perl which would be
>>>> beneficial,
>>>> >>> I'd
>>>> >>> > rather make the newer version of Perl a requirement and use the
>>>> built in
>>>> >>> > features. Otherwise, we're locked into using an external module,
>>>> >>> usually
>>>> >>> > from CPAN, which has no quality assurance. I regret adding some of
>>>> the
>>>> >>> > current modules such as InsideOut, rather then writing the code which
>>>> >>> could
>>>> >>> > accomplish the same objective.
>>>> >>> >
>>>> >>> > Did you need to catch exceptions because one of the OpenStack modules
>>>> >>> > you're using may throw a die exception? When this happens, the
>>>> entire
>>>> >>> vcld
>>>> >>> > process for the reservation exits abruptly which causes problems
>>>> such as
>>>> >>> > the request state remaining in pending indefinitely. This happens
>>>> even
>>>> >>> if
>>>> >>> > you wrap the call in an eval block. I have worked around this
>>>> problem
>>>> >>> > before by locally overriding the die handler. Take a look at
>>>> >>> > vSphere_SDK.pm and find lines such as:
>>>> >>> >
>>>> >>> > # Override the die handler
>>>> >>> > local $SIG{__DIE__} = sub{};
>>>> >>> >
>>>> >>> > The vSphere SDK is one example which may call die (via Carp). If
>>>> this
>>>> >>> > happens with die overridden, the eval block returns normally. If an
>>>> >>> > exception occurred, $EVAL_ERROR should be set.
>>>> >>> >
>>>> >>> >
>>>> >>> > >
>>>> >>> > > 3. I've saved the best for last, but first some background. The
>>>> >>> biggest
>>>> >>> > > change we've made is that we no longer rely on the /etc/hosts file
>>>> at
>>>> >>> all
>>>> >>> > > (though we haven't removed the code that keeps it up to date). We
>>>> had
>>>> >>> a
>>>> >>> > > number of issues with duplicate entries ending up in the hosts file
>>>> >>> and
>>>> >>> > > weren't able to pin down the exact cause. This led us to adding a
>>>> >>> table
>>>> >>> > to
>>>> >>> > > the database to track VCL computer to OpenStack instance mappings.
>>>> The
>>>> >>> > next
>>>> >>> > > issue we ran into was the private IP address not being populated in
>>>> >>> the
>>>> >>> > > hosts file. This happened very rarely and we're still unsure of the
>>>> >>> cause
>>>> >>> > > especially since there's an explicit check that the address is
>>>> >>> populated
>>>> >>> > > with a value before we write the hosts file. I'd assume that the
>>>> Nova
>>>> >>> API
>>>> >>> > > occasionally returns a response where the addresses component is
>>>> >>> > structured
>>>> >>> > > differently than we expect, though I was never able to directly
>>>> >>> observe
>>>> >>> > > this behavior. Since OpenStack automatically creates DNS entries
>>>> for
>>>> >>> new
>>>> >>> > > instances we decided the best course of action was to bypass the
>>>> hosts
>>>> >>> > file
>>>> >>> > > entirely. In the end we modified get_computer_private_ip_address in
>>>> >>> > > DataStructure.pm to do a DNS lookup rather than looking in the
>>>> hosts
>>>> >>> > file.
>>>> >>> > >
>>>> >>> > > The question for the community is are changes to core VCL code
>>>> >>> > acceptable?
>>>> >>> > > Or should we find a solution that keeps everything contained to the
>>>> >>> > > provisioning module? If changes to core code are acceptable we'd
>>>> also
>>>> >>> > have
>>>> >>> > > to decide on a method of detecting when to do a DNS lookup. Should
>>>> it
>>>> >>> > > depend on the provisioning module in use? A configuration option?
>>>> >>> >
>>>> >>> >
>>>> >>> > I see no problems. Any barriers or difficulty you encounter with the
>>>> >>> core
>>>> >>> > code should be addressed by improving the core code.
>>>> >>> >
>>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>>>> improve
>>>> >>> > regardless. People often encounter problems with this if they
>>>> forget to
>>>> >>> > add entries to /etc/hosts for all their computers, including the
>>>> >>> management
>>>> >>> > node(s). I'd like to not read /etc/hosts on the management node at
>>>> all
>>>> >>> and
>>>> >>> > have the value in the computer table be authoritative. This should
>>>> >>> > facilitate cases where the provisioning module needs to do something
>>>> >>> > different regarding private IPs such as if they are dynamically
>>>> >>> allocated.
>>>> >>> > The provisioning module would retrieve the IP when the image gets
>>>> >>> loaded
>>>> >>> > by querying DNS or some other method and then update the database.
>>>> The
>>>> >>> OS
>>>> >>> > module would then use this value to configure the computer.
>>>> >>> >
>>>> >>> > One comment regarding adding tables... great! Add all the tables you
>>>> >>> think
>>>> >>> > are beneficial. I have seen some try to work around the current
>>>> >>> database
>>>> >>> > schema rather than adding to it. There's no reason for this. If
>>>> there
>>>> >>> are
>>>> >>> > configuration options which apply only to OpenStack, add something
>>>> like
>>>> >>> an
>>>> >>> > openstackconfig table. If the vmprofile table doesn't align, add
>>>> >>> something
>>>> >>> > like an openstackprofile table. If there are general options such as
>>>> >>> how
>>>> >>> > to handle DNS or private IP resolution, we could add a more general
>>>> >>> table
>>>> >>> > or possibly extend the managementnode or computer table.
>>>> >>> >
>>>> >>> > Thanks,
>>>> >>> > Andy
>>>> >>> >
>>>> >>>
>>>> >>
>>>> >>
>>>>
>>>>
>>>>
>>>> --
>>>> Twitter: @serverascode
>>>> Blog: serverascode.com
>>>>
>>
>>
>>
>> --
>> Twitter: @serverascode
>> Blog: serverascode.com
>
>
>
> --
> Aaron Peeler
> Program Manager
> Virtual Computing Lab
> NC State University
>
> All electronic mail messages in connection with State business which
> are sent to or received by this account are subject to the NC Public
> Records Law and may be disclosed to third parties.
--
Twitter: @serverascode
Blog: serverascode.com
Re: OpenStack Module
Posted by Aaron Peeler <aa...@ncsu.edu>.
Would using the private IP instead of hostnames resolve it? It would
take a bit of work, but could be done.
Aaron
On Tue, Jun 3, 2014 at 3:22 PM, Curtis <se...@gmail.com> wrote:
> On Tue, Jun 3, 2014 at 11:53 AM, YOUNG OH <oh...@gmail.com> wrote:
>> Hi Curtis,
>>
>> Thank you for updating the status and correction about the OpenStack Perl
>> SDKs.
>>
>> If DNS lookup is not reliable to find the private ip of an instance for a
>> multi-host openstack environment, then do you have any suggestion to deal
>> with this issue?
>>
>> At this point, I think at least we have an agreement that we do NOT want to
>> use /etc/hosts anymore, right?
>> If so, we can first try to use the database to get/update the private ip
>> address with DNS lookup for a single-host openstack environment. After
>> that, we can try to find a solution to manage the DNS lookup or other
>> methods of finding the private ip of an instance in multi-host openstack
>> environment. If you have any other suggestions, please let me know.
>>
>
> I'm not too sure what to do. I'm hoping the Apache VCL core devs chime in.
>
> As far as I can tell, Apache VCL needs DNS resolution to work, so
> simply adding the IP into the database isn't going to be enough.
>
> For the current Apache VCL + OpenStack multihost cloud installation
> I'm working on I'm just going to add a python script that queries
> OpenStack and generates /etc/hosts every 20 or 30 seconds or something
> like that.
>
> Thanks,
> Curtis.
>
>> Thanks,
>> Young-Hyun
>>
>>
>>
>> On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com> wrote:
>>
>>> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <oh...@gmail.com> wrote:
>>> > Hi All,
>>> >
>>> > I would like to bring your attention again to discuss what OpenStack
>>> module
>>> > should include. I would like to discus two issues first.
>>> >
>>> > First, we know that using /etc/hosts to get the private ip of an instance
>>> > can be problematic. Specifically, Cameron (at Cybera) and I had found
>>> that
>>> > there might duplicated or blank entries and rarely but OpenStack APIs
>>> > cannot get the private ip (not populated) of an instance properly. For
>>> the
>>> > later case, Cameron added DNS Lookup function to get the correct private
>>> IP
>>> > (Cameron, correct me if I am wrong). This problem leads us to avoid using
>>> > /etc/hosts file to get the private ip but I think we need to first
>>> discuss
>>> > what the best way is to handle the private ip:
>>> >
>>> > (a). Use the privateIPaddress field in computer table.
>>> > Andy suggests that we can change the get_computer_private_ip to get
>>> private
>>> > ip from the database instead of using /etc/hosts (Andy, correct me if I
>>> am
>>> > wrong). I agree with his idea because this can avoid duplicated or blank
>>> > entry problem of using /etc/hosts.
>>> >
>>> > (b). OpenStack (DNS lookup for finding unpopulated private ip)
>>> > In our openstack module, DNS lookup or other methods (if any) can give
>>> the
>>> > correct the private ip of the instance in order to deal with the problem
>>> > for the private ip not being populated in the hosts file. Cameron
>>> modified
>>> > the get_computer_private_ip in DataStructure.pm to do a DNS lookup
>>> instead
>>> > of using the hosts file. But I would like to suggest that if possible, it
>>> > can be better to add the DNS lookup function to openstack module rather
>>> > than changing the DataStructure.pm. That is, we can update the
>>> > privateIPaddress field in computer table using DNS lookup instead of
>>> > injecting the private ip to /etc/hosts in openstack module.
>>>
>>> We've just found out recently that the helpful DNS resolution that
>>> openstack provides does not work well in a mutlihost openstack
>>> environment, so can't be relied on. In multihost mode each compute
>>> host only knows about the vms running on it locally.
>>>
>>> >
>>> > I think, if possible, one of the best methods for dealing with the
>>> private
>>> > ip is that we can use the database to get the private ip of an instance
>>> and
>>> > using DNS lookup in openstack module to update the information. Any
>>> > suggestions and corrections about my opinion would be very helpful to
>>> solve
>>> > this problem.
>>> >
>>> > Second, currently we have two versions (not exactly but for convenience);
>>> > one uses OpenStack command line interfaces (CLIs) and one uses OpenStack
>>> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for the
>>> > OpenStcak CLIs and required to install through CPAN. I think both
>>> versions
>>> > have pros and cons. So, I would like to ask your opinions whether it is
>>> > better to include two different openstack versions to the next VCL
>>> release,
>>> > to find a way to merge two versions into one openstack module, OR to
>>> create
>>> > a higher level of openstack module so that it can choose one version
>>> based
>>> > on user's environment. Any suggestions would be also very helpful to
>>> decide
>>> > how we can manage openstack module. Thank you.
>>>
>>> FYI -- The perl openstack sdk is not a wrapper for the command line
>>> utils. It uses the openstack api, not the command line tools.
>>>
>>> Thanks,
>>> Curtis.
>>>
>>> >
>>> > Best regards,
>>> > Young-Hyun
>>> >
>>> >
>>> >
>>> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <oh...@gmail.com>
>>> wrote:
>>> >
>>> >> Hi All,
>>> >>
>>> >> I have tested my openstack module (
>>> >> https://issues.apache.org/jira/browse/VCL-590) on the OpenStack
>>> Icehouse
>>> >> (The ninth release of OpenStack, April 17, 2014) and I could
>>> provisioning a
>>> >> Linux image through it.
>>> >>
>>> >> The environment details are as follows:
>>> >>
>>> >> 1. Host Blade
>>> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
>>> >> :- Memory: 49G
>>> >> :- Disk: 134G
>>> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
>>> >> 2. OpenStack Icehouse Components
>>> >> :- Compute
>>> >> :- Network (Nova-Network, not OpenStack Neutron)
>>> >> :- Glance
>>> >> 3. Provisioning Linux image
>>> >> :- CentOS 6.3 x64
>>> >> 4. VCL 2.3
>>> >>
>>> >> In this test, I've just tested the provisioning an image but I would
>>> like
>>> >> to post the detail information to jira once I finish other test. In
>>> >> addition, I will try to add a function of selecting OpenStack flavors
>>> based
>>> >> on the size of an image. The current openstack module sets flavors for
>>> each
>>> >> image because the previous OpenStack releases (Essex as I know) didn't
>>> >> support the size information of images but now it supports. I will also
>>> >> post to jira issue when I add the function to my module. Thank you.
>>> >>
>>> >> Best regards,
>>> >> Young-Hyun
>>> >>
>>> >>
>>> >>
>>> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <ca...@cybera.ca>
>>> >> wrote:
>>> >>
>>> >>> >
>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>>> features
>>> >>> of
>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>>> >>> minimum if
>>> >>> > possible. If there are new features in Perl which would be
>>> beneficial,
>>> >>> I'd
>>> >>> > rather make the newer version of Perl a requirement and use the
>>> built in
>>> >>> > features. Otherwise, we're locked into using an external module,
>>> >>> usually
>>> >>> > from CPAN, which has no quality assurance. I regret adding some of
>>> the
>>> >>> > current modules such as InsideOut, rather then writing the code which
>>> >>> could
>>> >>> > accomplish the same objective.
>>> >>> > Did you need to catch exceptions because one of the OpenStack modules
>>> >>> > you're using may throw a die exception? When this happens, the
>>> entire
>>> >>> vcld
>>> >>> > process for the reservation exits abruptly which causes problems
>>> such as
>>> >>> > the request state remaining in pending indefinitely. This happens
>>> even
>>> >>> if
>>> >>> > you wrap the call in an eval block. I have worked around this
>>> problem
>>> >>> > before by locally overriding the die handler. Take a look at
>>> >>> > vSphere_SDK.pm and find lines such as:
>>> >>> > # Override the die handler
>>> >>> > local $SIG{__DIE__} = sub{};
>>> >>> > The vSphere SDK is one example which may call die (via Carp). If
>>> this
>>> >>> > happens with die overridden, the eval block returns normally. If an
>>> >>> > exception occurred, $EVAL_ERROR should be set.
>>> >>>
>>> >>>
>>> >>> The OpenStack SDK throws exceptions when requests that
>>> >>> delete/modify/create
>>> >>> resources fail, no die exceptions though. There wasn't any specific
>>> >>> feature
>>> >>> that made me choose Try::Tiny, it was more my unfamiliarity with
>>> exception
>>> >>> handling in Perl which seemed to have a number of gotchas prior to
>>> 5.14 so
>>> >>> I figured it'd be better to let someone else's code worry about that.
>>> >>>
>>> >>>
>>> >>>
>>> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
>>> >>>
>>> >>> I see no problems. Any barriers or difficulty you encounter with the
>>> core
>>> >>> > code should be addressed by improving the core code.
>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>>> improve
>>> >>> > regardless. People often encounter problems with this if they
>>> forget to
>>> >>> > add entries to /etc/hosts for all their computers, including the
>>> >>> management
>>> >>> > node(s). I'd like to not read /etc/hosts on the management node at
>>> all
>>> >>> and
>>> >>> > have the value in the computer table be authoritative. This should
>>> >>> > facilitate cases where the provisioning module needs to do something
>>> >>> > different regarding private IPs such as if they are dynamically
>>> >>> allocated.
>>> >>> > The provisioning module would retrieve the IP when the image gets
>>> >>> loaded
>>> >>> > by querying DNS or some other method and then update the database.
>>> The
>>> >>> OS
>>> >>> > module would then use this value to configure the computer.
>>> >>>
>>> >>>
>>> >>> Sounds good. I agree that avoiding the hosts file would be best,
>>> >>> especially
>>> >>> in a case like this where it needs to be continuously modified. Here's
>>> our
>>> >>> changed get_computer_private_ip_address, lines 45-55 are the new code:
>>> >>>
>>> >>> https://gist.github.com/cmann/9896513
>>> >>>
>>> >>> Finally we're still working on putting together more comprehensive
>>> >>> installation documentation for anyone who wants to try it out. We're
>>> use
>>> >>> automation for a number of the tasks and I haven't had a chance to run
>>> >>> through it from scratch yet. For anyone feeling adventurous these are
>>> the
>>> >>> most basic instructions:
>>> >>>
>>> >>> 1. Apply the NAT patch
>>> >>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and 2.3.1,
>>> >>> make sure to read the Google doc)
>>> >>> 2. Follow the instructions in the readme in the Github repo for the
>>> >>> OpenStack module.
>>> >>>
>>> >>> Cameron
>>> >>>
>>> >>>
>>> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu>
>>> wrote:
>>> >>>
>>> >>> > >
>>> >>> > >
>>> >>> > > 2. We use the Try::Tiny module to handle exceptions since the
>>> version
>>> >>> of
>>> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch mechanisms
>>> >>> > available
>>> >>> > > in newer releases, however this would add an additional dependency
>>> to
>>> >>> > VCL.
>>> >>> > > Depending on the version of Perl VCL 2.4 is planning to use what
>>> are
>>> >>> > > people's thoughts on using Try::Tiny versus switching to Perl's
>>> >>> internal
>>> >>> > > mechanisms?
>>> >>> > >
>>> >>> >
>>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>>> features
>>> >>> of
>>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>>> >>> minimum if
>>> >>> > possible. If there are new features in Perl which would be
>>> beneficial,
>>> >>> I'd
>>> >>> > rather make the newer version of Perl a requirement and use the
>>> built in
>>> >>> > features. Otherwise, we're locked into using an external module,
>>> >>> usually
>>> >>> > from CPAN, which has no quality assurance. I regret adding some of
>>> the
>>> >>> > current modules such as InsideOut, rather then writing the code which
>>> >>> could
>>> >>> > accomplish the same objective.
>>> >>> >
>>> >>> > Did you need to catch exceptions because one of the OpenStack modules
>>> >>> > you're using may throw a die exception? When this happens, the
>>> entire
>>> >>> vcld
>>> >>> > process for the reservation exits abruptly which causes problems
>>> such as
>>> >>> > the request state remaining in pending indefinitely. This happens
>>> even
>>> >>> if
>>> >>> > you wrap the call in an eval block. I have worked around this
>>> problem
>>> >>> > before by locally overriding the die handler. Take a look at
>>> >>> > vSphere_SDK.pm and find lines such as:
>>> >>> >
>>> >>> > # Override the die handler
>>> >>> > local $SIG{__DIE__} = sub{};
>>> >>> >
>>> >>> > The vSphere SDK is one example which may call die (via Carp). If
>>> this
>>> >>> > happens with die overridden, the eval block returns normally. If an
>>> >>> > exception occurred, $EVAL_ERROR should be set.
>>> >>> >
>>> >>> >
>>> >>> > >
>>> >>> > > 3. I've saved the best for last, but first some background. The
>>> >>> biggest
>>> >>> > > change we've made is that we no longer rely on the /etc/hosts file
>>> at
>>> >>> all
>>> >>> > > (though we haven't removed the code that keeps it up to date). We
>>> had
>>> >>> a
>>> >>> > > number of issues with duplicate entries ending up in the hosts file
>>> >>> and
>>> >>> > > weren't able to pin down the exact cause. This led us to adding a
>>> >>> table
>>> >>> > to
>>> >>> > > the database to track VCL computer to OpenStack instance mappings.
>>> The
>>> >>> > next
>>> >>> > > issue we ran into was the private IP address not being populated in
>>> >>> the
>>> >>> > > hosts file. This happened very rarely and we're still unsure of the
>>> >>> cause
>>> >>> > > especially since there's an explicit check that the address is
>>> >>> populated
>>> >>> > > with a value before we write the hosts file. I'd assume that the
>>> Nova
>>> >>> API
>>> >>> > > occasionally returns a response where the addresses component is
>>> >>> > structured
>>> >>> > > differently than we expect, though I was never able to directly
>>> >>> observe
>>> >>> > > this behavior. Since OpenStack automatically creates DNS entries
>>> for
>>> >>> new
>>> >>> > > instances we decided the best course of action was to bypass the
>>> hosts
>>> >>> > file
>>> >>> > > entirely. In the end we modified get_computer_private_ip_address in
>>> >>> > > DataStructure.pm to do a DNS lookup rather than looking in the
>>> hosts
>>> >>> > file.
>>> >>> > >
>>> >>> > > The question for the community is are changes to core VCL code
>>> >>> > acceptable?
>>> >>> > > Or should we find a solution that keeps everything contained to the
>>> >>> > > provisioning module? If changes to core code are acceptable we'd
>>> also
>>> >>> > have
>>> >>> > > to decide on a method of detecting when to do a DNS lookup. Should
>>> it
>>> >>> > > depend on the provisioning module in use? A configuration option?
>>> >>> >
>>> >>> >
>>> >>> > I see no problems. Any barriers or difficulty you encounter with the
>>> >>> core
>>> >>> > code should be addressed by improving the core code.
>>> >>> >
>>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>>> improve
>>> >>> > regardless. People often encounter problems with this if they
>>> forget to
>>> >>> > add entries to /etc/hosts for all their computers, including the
>>> >>> management
>>> >>> > node(s). I'd like to not read /etc/hosts on the management node at
>>> all
>>> >>> and
>>> >>> > have the value in the computer table be authoritative. This should
>>> >>> > facilitate cases where the provisioning module needs to do something
>>> >>> > different regarding private IPs such as if they are dynamically
>>> >>> allocated.
>>> >>> > The provisioning module would retrieve the IP when the image gets
>>> >>> loaded
>>> >>> > by querying DNS or some other method and then update the database.
>>> The
>>> >>> OS
>>> >>> > module would then use this value to configure the computer.
>>> >>> >
>>> >>> > One comment regarding adding tables... great! Add all the tables you
>>> >>> think
>>> >>> > are beneficial. I have seen some try to work around the current
>>> >>> database
>>> >>> > schema rather than adding to it. There's no reason for this. If
>>> there
>>> >>> are
>>> >>> > configuration options which apply only to OpenStack, add something
>>> like
>>> >>> an
>>> >>> > openstackconfig table. If the vmprofile table doesn't align, add
>>> >>> something
>>> >>> > like an openstackprofile table. If there are general options such as
>>> >>> how
>>> >>> > to handle DNS or private IP resolution, we could add a more general
>>> >>> table
>>> >>> > or possibly extend the managementnode or computer table.
>>> >>> >
>>> >>> > Thanks,
>>> >>> > Andy
>>> >>> >
>>> >>>
>>> >>
>>> >>
>>>
>>>
>>>
>>> --
>>> Twitter: @serverascode
>>> Blog: serverascode.com
>>>
>
>
>
> --
> Twitter: @serverascode
> Blog: serverascode.com
--
Aaron Peeler
Program Manager
Virtual Computing Lab
NC State University
All electronic mail messages in connection with State business which
are sent to or received by this account are subject to the NC Public
Records Law and may be disclosed to third parties.
Re: OpenStack Module
Posted by Curtis <se...@gmail.com>.
On Tue, Jun 3, 2014 at 11:53 AM, YOUNG OH <oh...@gmail.com> wrote:
> Hi Curtis,
>
> Thank you for updating the status and correction about the OpenStack Perl
> SDKs.
>
> If DNS lookup is not reliable to find the private ip of an instance for a
> multi-host openstack environment, then do you have any suggestion to deal
> with this issue?
>
> At this point, I think at least we have an agreement that we do NOT want to
> use /etc/hosts anymore, right?
> If so, we can first try to use the database to get/update the private ip
> address with DNS lookup for a single-host openstack environment. After
> that, we can try to find a solution to manage the DNS lookup or other
> methods of finding the private ip of an instance in multi-host openstack
> environment. If you have any other suggestions, please let me know.
>
I'm not too sure what to do. I'm hoping the Apache VCL core devs chime in.
As far as I can tell, Apache VCL needs DNS resolution to work, so
simply adding the IP into the database isn't going to be enough.
For the current Apache VCL + OpenStack multihost cloud installation
I'm working on I'm just going to add a python script that queries
OpenStack and generates /etc/hosts every 20 or 30 seconds or something
like that.
Thanks,
Curtis.
> Thanks,
> Young-Hyun
>
>
>
> On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com> wrote:
>
>> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <oh...@gmail.com> wrote:
>> > Hi All,
>> >
>> > I would like to bring your attention again to discuss what OpenStack
>> module
>> > should include. I would like to discus two issues first.
>> >
>> > First, we know that using /etc/hosts to get the private ip of an instance
>> > can be problematic. Specifically, Cameron (at Cybera) and I had found
>> that
>> > there might duplicated or blank entries and rarely but OpenStack APIs
>> > cannot get the private ip (not populated) of an instance properly. For
>> the
>> > later case, Cameron added DNS Lookup function to get the correct private
>> IP
>> > (Cameron, correct me if I am wrong). This problem leads us to avoid using
>> > /etc/hosts file to get the private ip but I think we need to first
>> discuss
>> > what the best way is to handle the private ip:
>> >
>> > (a). Use the privateIPaddress field in computer table.
>> > Andy suggests that we can change the get_computer_private_ip to get
>> private
>> > ip from the database instead of using /etc/hosts (Andy, correct me if I
>> am
>> > wrong). I agree with his idea because this can avoid duplicated or blank
>> > entry problem of using /etc/hosts.
>> >
>> > (b). OpenStack (DNS lookup for finding unpopulated private ip)
>> > In our openstack module, DNS lookup or other methods (if any) can give
>> the
>> > correct the private ip of the instance in order to deal with the problem
>> > for the private ip not being populated in the hosts file. Cameron
>> modified
>> > the get_computer_private_ip in DataStructure.pm to do a DNS lookup
>> instead
>> > of using the hosts file. But I would like to suggest that if possible, it
>> > can be better to add the DNS lookup function to openstack module rather
>> > than changing the DataStructure.pm. That is, we can update the
>> > privateIPaddress field in computer table using DNS lookup instead of
>> > injecting the private ip to /etc/hosts in openstack module.
>>
>> We've just found out recently that the helpful DNS resolution that
>> openstack provides does not work well in a mutlihost openstack
>> environment, so can't be relied on. In multihost mode each compute
>> host only knows about the vms running on it locally.
>>
>> >
>> > I think, if possible, one of the best methods for dealing with the
>> private
>> > ip is that we can use the database to get the private ip of an instance
>> and
>> > using DNS lookup in openstack module to update the information. Any
>> > suggestions and corrections about my opinion would be very helpful to
>> solve
>> > this problem.
>> >
>> > Second, currently we have two versions (not exactly but for convenience);
>> > one uses OpenStack command line interfaces (CLIs) and one uses OpenStack
>> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for the
>> > OpenStcak CLIs and required to install through CPAN. I think both
>> versions
>> > have pros and cons. So, I would like to ask your opinions whether it is
>> > better to include two different openstack versions to the next VCL
>> release,
>> > to find a way to merge two versions into one openstack module, OR to
>> create
>> > a higher level of openstack module so that it can choose one version
>> based
>> > on user's environment. Any suggestions would be also very helpful to
>> decide
>> > how we can manage openstack module. Thank you.
>>
>> FYI -- The perl openstack sdk is not a wrapper for the command line
>> utils. It uses the openstack api, not the command line tools.
>>
>> Thanks,
>> Curtis.
>>
>> >
>> > Best regards,
>> > Young-Hyun
>> >
>> >
>> >
>> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <oh...@gmail.com>
>> wrote:
>> >
>> >> Hi All,
>> >>
>> >> I have tested my openstack module (
>> >> https://issues.apache.org/jira/browse/VCL-590) on the OpenStack
>> Icehouse
>> >> (The ninth release of OpenStack, April 17, 2014) and I could
>> provisioning a
>> >> Linux image through it.
>> >>
>> >> The environment details are as follows:
>> >>
>> >> 1. Host Blade
>> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
>> >> :- Memory: 49G
>> >> :- Disk: 134G
>> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
>> >> 2. OpenStack Icehouse Components
>> >> :- Compute
>> >> :- Network (Nova-Network, not OpenStack Neutron)
>> >> :- Glance
>> >> 3. Provisioning Linux image
>> >> :- CentOS 6.3 x64
>> >> 4. VCL 2.3
>> >>
>> >> In this test, I've just tested the provisioning an image but I would
>> like
>> >> to post the detail information to jira once I finish other test. In
>> >> addition, I will try to add a function of selecting OpenStack flavors
>> based
>> >> on the size of an image. The current openstack module sets flavors for
>> each
>> >> image because the previous OpenStack releases (Essex as I know) didn't
>> >> support the size information of images but now it supports. I will also
>> >> post to jira issue when I add the function to my module. Thank you.
>> >>
>> >> Best regards,
>> >> Young-Hyun
>> >>
>> >>
>> >>
>> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <ca...@cybera.ca>
>> >> wrote:
>> >>
>> >>> >
>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>> features
>> >>> of
>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>> >>> minimum if
>> >>> > possible. If there are new features in Perl which would be
>> beneficial,
>> >>> I'd
>> >>> > rather make the newer version of Perl a requirement and use the
>> built in
>> >>> > features. Otherwise, we're locked into using an external module,
>> >>> usually
>> >>> > from CPAN, which has no quality assurance. I regret adding some of
>> the
>> >>> > current modules such as InsideOut, rather then writing the code which
>> >>> could
>> >>> > accomplish the same objective.
>> >>> > Did you need to catch exceptions because one of the OpenStack modules
>> >>> > you're using may throw a die exception? When this happens, the
>> entire
>> >>> vcld
>> >>> > process for the reservation exits abruptly which causes problems
>> such as
>> >>> > the request state remaining in pending indefinitely. This happens
>> even
>> >>> if
>> >>> > you wrap the call in an eval block. I have worked around this
>> problem
>> >>> > before by locally overriding the die handler. Take a look at
>> >>> > vSphere_SDK.pm and find lines such as:
>> >>> > # Override the die handler
>> >>> > local $SIG{__DIE__} = sub{};
>> >>> > The vSphere SDK is one example which may call die (via Carp). If
>> this
>> >>> > happens with die overridden, the eval block returns normally. If an
>> >>> > exception occurred, $EVAL_ERROR should be set.
>> >>>
>> >>>
>> >>> The OpenStack SDK throws exceptions when requests that
>> >>> delete/modify/create
>> >>> resources fail, no die exceptions though. There wasn't any specific
>> >>> feature
>> >>> that made me choose Try::Tiny, it was more my unfamiliarity with
>> exception
>> >>> handling in Perl which seemed to have a number of gotchas prior to
>> 5.14 so
>> >>> I figured it'd be better to let someone else's code worry about that.
>> >>>
>> >>>
>> >>>
>> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
>> >>>
>> >>> I see no problems. Any barriers or difficulty you encounter with the
>> core
>> >>> > code should be addressed by improving the core code.
>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>> improve
>> >>> > regardless. People often encounter problems with this if they
>> forget to
>> >>> > add entries to /etc/hosts for all their computers, including the
>> >>> management
>> >>> > node(s). I'd like to not read /etc/hosts on the management node at
>> all
>> >>> and
>> >>> > have the value in the computer table be authoritative. This should
>> >>> > facilitate cases where the provisioning module needs to do something
>> >>> > different regarding private IPs such as if they are dynamically
>> >>> allocated.
>> >>> > The provisioning module would retrieve the IP when the image gets
>> >>> loaded
>> >>> > by querying DNS or some other method and then update the database.
>> The
>> >>> OS
>> >>> > module would then use this value to configure the computer.
>> >>>
>> >>>
>> >>> Sounds good. I agree that avoiding the hosts file would be best,
>> >>> especially
>> >>> in a case like this where it needs to be continuously modified. Here's
>> our
>> >>> changed get_computer_private_ip_address, lines 45-55 are the new code:
>> >>>
>> >>> https://gist.github.com/cmann/9896513
>> >>>
>> >>> Finally we're still working on putting together more comprehensive
>> >>> installation documentation for anyone who wants to try it out. We're
>> use
>> >>> automation for a number of the tasks and I haven't had a chance to run
>> >>> through it from scratch yet. For anyone feeling adventurous these are
>> the
>> >>> most basic instructions:
>> >>>
>> >>> 1. Apply the NAT patch
>> >>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and 2.3.1,
>> >>> make sure to read the Google doc)
>> >>> 2. Follow the instructions in the readme in the Github repo for the
>> >>> OpenStack module.
>> >>>
>> >>> Cameron
>> >>>
>> >>>
>> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu>
>> wrote:
>> >>>
>> >>> > >
>> >>> > >
>> >>> > > 2. We use the Try::Tiny module to handle exceptions since the
>> version
>> >>> of
>> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch mechanisms
>> >>> > available
>> >>> > > in newer releases, however this would add an additional dependency
>> to
>> >>> > VCL.
>> >>> > > Depending on the version of Perl VCL 2.4 is planning to use what
>> are
>> >>> > > people's thoughts on using Try::Tiny versus switching to Perl's
>> >>> internal
>> >>> > > mechanisms?
>> >>> > >
>> >>> >
>> >>> > I haven't looked at Try::Tiny or any newer exception handling
>> features
>> >>> of
>> >>> > Perl, but I'd prefer to keep the number of external modules to a
>> >>> minimum if
>> >>> > possible. If there are new features in Perl which would be
>> beneficial,
>> >>> I'd
>> >>> > rather make the newer version of Perl a requirement and use the
>> built in
>> >>> > features. Otherwise, we're locked into using an external module,
>> >>> usually
>> >>> > from CPAN, which has no quality assurance. I regret adding some of
>> the
>> >>> > current modules such as InsideOut, rather then writing the code which
>> >>> could
>> >>> > accomplish the same objective.
>> >>> >
>> >>> > Did you need to catch exceptions because one of the OpenStack modules
>> >>> > you're using may throw a die exception? When this happens, the
>> entire
>> >>> vcld
>> >>> > process for the reservation exits abruptly which causes problems
>> such as
>> >>> > the request state remaining in pending indefinitely. This happens
>> even
>> >>> if
>> >>> > you wrap the call in an eval block. I have worked around this
>> problem
>> >>> > before by locally overriding the die handler. Take a look at
>> >>> > vSphere_SDK.pm and find lines such as:
>> >>> >
>> >>> > # Override the die handler
>> >>> > local $SIG{__DIE__} = sub{};
>> >>> >
>> >>> > The vSphere SDK is one example which may call die (via Carp). If
>> this
>> >>> > happens with die overridden, the eval block returns normally. If an
>> >>> > exception occurred, $EVAL_ERROR should be set.
>> >>> >
>> >>> >
>> >>> > >
>> >>> > > 3. I've saved the best for last, but first some background. The
>> >>> biggest
>> >>> > > change we've made is that we no longer rely on the /etc/hosts file
>> at
>> >>> all
>> >>> > > (though we haven't removed the code that keeps it up to date). We
>> had
>> >>> a
>> >>> > > number of issues with duplicate entries ending up in the hosts file
>> >>> and
>> >>> > > weren't able to pin down the exact cause. This led us to adding a
>> >>> table
>> >>> > to
>> >>> > > the database to track VCL computer to OpenStack instance mappings.
>> The
>> >>> > next
>> >>> > > issue we ran into was the private IP address not being populated in
>> >>> the
>> >>> > > hosts file. This happened very rarely and we're still unsure of the
>> >>> cause
>> >>> > > especially since there's an explicit check that the address is
>> >>> populated
>> >>> > > with a value before we write the hosts file. I'd assume that the
>> Nova
>> >>> API
>> >>> > > occasionally returns a response where the addresses component is
>> >>> > structured
>> >>> > > differently than we expect, though I was never able to directly
>> >>> observe
>> >>> > > this behavior. Since OpenStack automatically creates DNS entries
>> for
>> >>> new
>> >>> > > instances we decided the best course of action was to bypass the
>> hosts
>> >>> > file
>> >>> > > entirely. In the end we modified get_computer_private_ip_address in
>> >>> > > DataStructure.pm to do a DNS lookup rather than looking in the
>> hosts
>> >>> > file.
>> >>> > >
>> >>> > > The question for the community is are changes to core VCL code
>> >>> > acceptable?
>> >>> > > Or should we find a solution that keeps everything contained to the
>> >>> > > provisioning module? If changes to core code are acceptable we'd
>> also
>> >>> > have
>> >>> > > to decide on a method of detecting when to do a DNS lookup. Should
>> it
>> >>> > > depend on the provisioning module in use? A configuration option?
>> >>> >
>> >>> >
>> >>> > I see no problems. Any barriers or difficulty you encounter with the
>> >>> core
>> >>> > code should be addressed by improving the core code.
>> >>> >
>> >>> > Reworking the dependency on /etc/hosts is something I'd like to
>> improve
>> >>> > regardless. People often encounter problems with this if they
>> forget to
>> >>> > add entries to /etc/hosts for all their computers, including the
>> >>> management
>> >>> > node(s). I'd like to not read /etc/hosts on the management node at
>> all
>> >>> and
>> >>> > have the value in the computer table be authoritative. This should
>> >>> > facilitate cases where the provisioning module needs to do something
>> >>> > different regarding private IPs such as if they are dynamically
>> >>> allocated.
>> >>> > The provisioning module would retrieve the IP when the image gets
>> >>> loaded
>> >>> > by querying DNS or some other method and then update the database.
>> The
>> >>> OS
>> >>> > module would then use this value to configure the computer.
>> >>> >
>> >>> > One comment regarding adding tables... great! Add all the tables you
>> >>> think
>> >>> > are beneficial. I have seen some try to work around the current
>> >>> database
>> >>> > schema rather than adding to it. There's no reason for this. If
>> there
>> >>> are
>> >>> > configuration options which apply only to OpenStack, add something
>> like
>> >>> an
>> >>> > openstackconfig table. If the vmprofile table doesn't align, add
>> >>> something
>> >>> > like an openstackprofile table. If there are general options such as
>> >>> how
>> >>> > to handle DNS or private IP resolution, we could add a more general
>> >>> table
>> >>> > or possibly extend the managementnode or computer table.
>> >>> >
>> >>> > Thanks,
>> >>> > Andy
>> >>> >
>> >>>
>> >>
>> >>
>>
>>
>>
>> --
>> Twitter: @serverascode
>> Blog: serverascode.com
>>
--
Twitter: @serverascode
Blog: serverascode.com
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Hi Curtis,
Thank you for updating the status and correction about the OpenStack Perl
SDKs.
If DNS lookup is not reliable to find the private ip of an instance for a
multi-host openstack environment, then do you have any suggestion to deal
with this issue?
At this point, I think at least we have an agreement that we do NOT want to
use /etc/hosts anymore, right?
If so, we can first try to use the database to get/update the private ip
address with DNS lookup for a single-host openstack environment. After
that, we can try to find a solution to manage the DNS lookup or other
methods of finding the private ip of an instance in multi-host openstack
environment. If you have any other suggestions, please let me know.
Thanks,
Young-Hyun
On Mon, Jun 2, 2014 at 3:56 PM, Curtis <se...@gmail.com> wrote:
> On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <oh...@gmail.com> wrote:
> > Hi All,
> >
> > I would like to bring your attention again to discuss what OpenStack
> module
> > should include. I would like to discus two issues first.
> >
> > First, we know that using /etc/hosts to get the private ip of an instance
> > can be problematic. Specifically, Cameron (at Cybera) and I had found
> that
> > there might duplicated or blank entries and rarely but OpenStack APIs
> > cannot get the private ip (not populated) of an instance properly. For
> the
> > later case, Cameron added DNS Lookup function to get the correct private
> IP
> > (Cameron, correct me if I am wrong). This problem leads us to avoid using
> > /etc/hosts file to get the private ip but I think we need to first
> discuss
> > what the best way is to handle the private ip:
> >
> > (a). Use the privateIPaddress field in computer table.
> > Andy suggests that we can change the get_computer_private_ip to get
> private
> > ip from the database instead of using /etc/hosts (Andy, correct me if I
> am
> > wrong). I agree with his idea because this can avoid duplicated or blank
> > entry problem of using /etc/hosts.
> >
> > (b). OpenStack (DNS lookup for finding unpopulated private ip)
> > In our openstack module, DNS lookup or other methods (if any) can give
> the
> > correct the private ip of the instance in order to deal with the problem
> > for the private ip not being populated in the hosts file. Cameron
> modified
> > the get_computer_private_ip in DataStructure.pm to do a DNS lookup
> instead
> > of using the hosts file. But I would like to suggest that if possible, it
> > can be better to add the DNS lookup function to openstack module rather
> > than changing the DataStructure.pm. That is, we can update the
> > privateIPaddress field in computer table using DNS lookup instead of
> > injecting the private ip to /etc/hosts in openstack module.
>
> We've just found out recently that the helpful DNS resolution that
> openstack provides does not work well in a mutlihost openstack
> environment, so can't be relied on. In multihost mode each compute
> host only knows about the vms running on it locally.
>
> >
> > I think, if possible, one of the best methods for dealing with the
> private
> > ip is that we can use the database to get the private ip of an instance
> and
> > using DNS lookup in openstack module to update the information. Any
> > suggestions and corrections about my opinion would be very helpful to
> solve
> > this problem.
> >
> > Second, currently we have two versions (not exactly but for convenience);
> > one uses OpenStack command line interfaces (CLIs) and one uses OpenStack
> > Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for the
> > OpenStcak CLIs and required to install through CPAN. I think both
> versions
> > have pros and cons. So, I would like to ask your opinions whether it is
> > better to include two different openstack versions to the next VCL
> release,
> > to find a way to merge two versions into one openstack module, OR to
> create
> > a higher level of openstack module so that it can choose one version
> based
> > on user's environment. Any suggestions would be also very helpful to
> decide
> > how we can manage openstack module. Thank you.
>
> FYI -- The perl openstack sdk is not a wrapper for the command line
> utils. It uses the openstack api, not the command line tools.
>
> Thanks,
> Curtis.
>
> >
> > Best regards,
> > Young-Hyun
> >
> >
> >
> > On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <oh...@gmail.com>
> wrote:
> >
> >> Hi All,
> >>
> >> I have tested my openstack module (
> >> https://issues.apache.org/jira/browse/VCL-590) on the OpenStack
> Icehouse
> >> (The ninth release of OpenStack, April 17, 2014) and I could
> provisioning a
> >> Linux image through it.
> >>
> >> The environment details are as follows:
> >>
> >> 1. Host Blade
> >> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
> >> :- Memory: 49G
> >> :- Disk: 134G
> >> :- OS: RHEL 6.4 x64 with KVM hypervisor
> >> 2. OpenStack Icehouse Components
> >> :- Compute
> >> :- Network (Nova-Network, not OpenStack Neutron)
> >> :- Glance
> >> 3. Provisioning Linux image
> >> :- CentOS 6.3 x64
> >> 4. VCL 2.3
> >>
> >> In this test, I've just tested the provisioning an image but I would
> like
> >> to post the detail information to jira once I finish other test. In
> >> addition, I will try to add a function of selecting OpenStack flavors
> based
> >> on the size of an image. The current openstack module sets flavors for
> each
> >> image because the previous OpenStack releases (Essex as I know) didn't
> >> support the size information of images but now it supports. I will also
> >> post to jira issue when I add the function to my module. Thank you.
> >>
> >> Best regards,
> >> Young-Hyun
> >>
> >>
> >>
> >> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <ca...@cybera.ca>
> >> wrote:
> >>
> >>> >
> >>> > I haven't looked at Try::Tiny or any newer exception handling
> features
> >>> of
> >>> > Perl, but I'd prefer to keep the number of external modules to a
> >>> minimum if
> >>> > possible. If there are new features in Perl which would be
> beneficial,
> >>> I'd
> >>> > rather make the newer version of Perl a requirement and use the
> built in
> >>> > features. Otherwise, we're locked into using an external module,
> >>> usually
> >>> > from CPAN, which has no quality assurance. I regret adding some of
> the
> >>> > current modules such as InsideOut, rather then writing the code which
> >>> could
> >>> > accomplish the same objective.
> >>> > Did you need to catch exceptions because one of the OpenStack modules
> >>> > you're using may throw a die exception? When this happens, the
> entire
> >>> vcld
> >>> > process for the reservation exits abruptly which causes problems
> such as
> >>> > the request state remaining in pending indefinitely. This happens
> even
> >>> if
> >>> > you wrap the call in an eval block. I have worked around this
> problem
> >>> > before by locally overriding the die handler. Take a look at
> >>> > vSphere_SDK.pm and find lines such as:
> >>> > # Override the die handler
> >>> > local $SIG{__DIE__} = sub{};
> >>> > The vSphere SDK is one example which may call die (via Carp). If
> this
> >>> > happens with die overridden, the eval block returns normally. If an
> >>> > exception occurred, $EVAL_ERROR should be set.
> >>>
> >>>
> >>> The OpenStack SDK throws exceptions when requests that
> >>> delete/modify/create
> >>> resources fail, no die exceptions though. There wasn't any specific
> >>> feature
> >>> that made me choose Try::Tiny, it was more my unfamiliarity with
> exception
> >>> handling in Perl which seemed to have a number of gotchas prior to
> 5.14 so
> >>> I figured it'd be better to let someone else's code worry about that.
> >>>
> >>>
> >>>
> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
> >>>
> >>> I see no problems. Any barriers or difficulty you encounter with the
> core
> >>> > code should be addressed by improving the core code.
> >>> > Reworking the dependency on /etc/hosts is something I'd like to
> improve
> >>> > regardless. People often encounter problems with this if they
> forget to
> >>> > add entries to /etc/hosts for all their computers, including the
> >>> management
> >>> > node(s). I'd like to not read /etc/hosts on the management node at
> all
> >>> and
> >>> > have the value in the computer table be authoritative. This should
> >>> > facilitate cases where the provisioning module needs to do something
> >>> > different regarding private IPs such as if they are dynamically
> >>> allocated.
> >>> > The provisioning module would retrieve the IP when the image gets
> >>> loaded
> >>> > by querying DNS or some other method and then update the database.
> The
> >>> OS
> >>> > module would then use this value to configure the computer.
> >>>
> >>>
> >>> Sounds good. I agree that avoiding the hosts file would be best,
> >>> especially
> >>> in a case like this where it needs to be continuously modified. Here's
> our
> >>> changed get_computer_private_ip_address, lines 45-55 are the new code:
> >>>
> >>> https://gist.github.com/cmann/9896513
> >>>
> >>> Finally we're still working on putting together more comprehensive
> >>> installation documentation for anyone who wants to try it out. We're
> use
> >>> automation for a number of the tasks and I haven't had a chance to run
> >>> through it from scratch yet. For anyone feeling adventurous these are
> the
> >>> most basic instructions:
> >>>
> >>> 1. Apply the NAT patch
> >>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and 2.3.1,
> >>> make sure to read the Google doc)
> >>> 2. Follow the instructions in the readme in the Github repo for the
> >>> OpenStack module.
> >>>
> >>> Cameron
> >>>
> >>>
> >>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu>
> wrote:
> >>>
> >>> > >
> >>> > >
> >>> > > 2. We use the Try::Tiny module to handle exceptions since the
> version
> >>> of
> >>> > > Perl VCL 2.3 uses doesn't support the saner try/catch mechanisms
> >>> > available
> >>> > > in newer releases, however this would add an additional dependency
> to
> >>> > VCL.
> >>> > > Depending on the version of Perl VCL 2.4 is planning to use what
> are
> >>> > > people's thoughts on using Try::Tiny versus switching to Perl's
> >>> internal
> >>> > > mechanisms?
> >>> > >
> >>> >
> >>> > I haven't looked at Try::Tiny or any newer exception handling
> features
> >>> of
> >>> > Perl, but I'd prefer to keep the number of external modules to a
> >>> minimum if
> >>> > possible. If there are new features in Perl which would be
> beneficial,
> >>> I'd
> >>> > rather make the newer version of Perl a requirement and use the
> built in
> >>> > features. Otherwise, we're locked into using an external module,
> >>> usually
> >>> > from CPAN, which has no quality assurance. I regret adding some of
> the
> >>> > current modules such as InsideOut, rather then writing the code which
> >>> could
> >>> > accomplish the same objective.
> >>> >
> >>> > Did you need to catch exceptions because one of the OpenStack modules
> >>> > you're using may throw a die exception? When this happens, the
> entire
> >>> vcld
> >>> > process for the reservation exits abruptly which causes problems
> such as
> >>> > the request state remaining in pending indefinitely. This happens
> even
> >>> if
> >>> > you wrap the call in an eval block. I have worked around this
> problem
> >>> > before by locally overriding the die handler. Take a look at
> >>> > vSphere_SDK.pm and find lines such as:
> >>> >
> >>> > # Override the die handler
> >>> > local $SIG{__DIE__} = sub{};
> >>> >
> >>> > The vSphere SDK is one example which may call die (via Carp). If
> this
> >>> > happens with die overridden, the eval block returns normally. If an
> >>> > exception occurred, $EVAL_ERROR should be set.
> >>> >
> >>> >
> >>> > >
> >>> > > 3. I've saved the best for last, but first some background. The
> >>> biggest
> >>> > > change we've made is that we no longer rely on the /etc/hosts file
> at
> >>> all
> >>> > > (though we haven't removed the code that keeps it up to date). We
> had
> >>> a
> >>> > > number of issues with duplicate entries ending up in the hosts file
> >>> and
> >>> > > weren't able to pin down the exact cause. This led us to adding a
> >>> table
> >>> > to
> >>> > > the database to track VCL computer to OpenStack instance mappings.
> The
> >>> > next
> >>> > > issue we ran into was the private IP address not being populated in
> >>> the
> >>> > > hosts file. This happened very rarely and we're still unsure of the
> >>> cause
> >>> > > especially since there's an explicit check that the address is
> >>> populated
> >>> > > with a value before we write the hosts file. I'd assume that the
> Nova
> >>> API
> >>> > > occasionally returns a response where the addresses component is
> >>> > structured
> >>> > > differently than we expect, though I was never able to directly
> >>> observe
> >>> > > this behavior. Since OpenStack automatically creates DNS entries
> for
> >>> new
> >>> > > instances we decided the best course of action was to bypass the
> hosts
> >>> > file
> >>> > > entirely. In the end we modified get_computer_private_ip_address in
> >>> > > DataStructure.pm to do a DNS lookup rather than looking in the
> hosts
> >>> > file.
> >>> > >
> >>> > > The question for the community is are changes to core VCL code
> >>> > acceptable?
> >>> > > Or should we find a solution that keeps everything contained to the
> >>> > > provisioning module? If changes to core code are acceptable we'd
> also
> >>> > have
> >>> > > to decide on a method of detecting when to do a DNS lookup. Should
> it
> >>> > > depend on the provisioning module in use? A configuration option?
> >>> >
> >>> >
> >>> > I see no problems. Any barriers or difficulty you encounter with the
> >>> core
> >>> > code should be addressed by improving the core code.
> >>> >
> >>> > Reworking the dependency on /etc/hosts is something I'd like to
> improve
> >>> > regardless. People often encounter problems with this if they
> forget to
> >>> > add entries to /etc/hosts for all their computers, including the
> >>> management
> >>> > node(s). I'd like to not read /etc/hosts on the management node at
> all
> >>> and
> >>> > have the value in the computer table be authoritative. This should
> >>> > facilitate cases where the provisioning module needs to do something
> >>> > different regarding private IPs such as if they are dynamically
> >>> allocated.
> >>> > The provisioning module would retrieve the IP when the image gets
> >>> loaded
> >>> > by querying DNS or some other method and then update the database.
> The
> >>> OS
> >>> > module would then use this value to configure the computer.
> >>> >
> >>> > One comment regarding adding tables... great! Add all the tables you
> >>> think
> >>> > are beneficial. I have seen some try to work around the current
> >>> database
> >>> > schema rather than adding to it. There's no reason for this. If
> there
> >>> are
> >>> > configuration options which apply only to OpenStack, add something
> like
> >>> an
> >>> > openstackconfig table. If the vmprofile table doesn't align, add
> >>> something
> >>> > like an openstackprofile table. If there are general options such as
> >>> how
> >>> > to handle DNS or private IP resolution, we could add a more general
> >>> table
> >>> > or possibly extend the managementnode or computer table.
> >>> >
> >>> > Thanks,
> >>> > Andy
> >>> >
> >>>
> >>
> >>
>
>
>
> --
> Twitter: @serverascode
> Blog: serverascode.com
>
Re: OpenStack Module
Posted by Curtis <se...@gmail.com>.
On Mon, Jun 2, 2014 at 12:45 PM, YOUNG OH <oh...@gmail.com> wrote:
> Hi All,
>
> I would like to bring your attention again to discuss what OpenStack module
> should include. I would like to discus two issues first.
>
> First, we know that using /etc/hosts to get the private ip of an instance
> can be problematic. Specifically, Cameron (at Cybera) and I had found that
> there might duplicated or blank entries and rarely but OpenStack APIs
> cannot get the private ip (not populated) of an instance properly. For the
> later case, Cameron added DNS Lookup function to get the correct private IP
> (Cameron, correct me if I am wrong). This problem leads us to avoid using
> /etc/hosts file to get the private ip but I think we need to first discuss
> what the best way is to handle the private ip:
>
> (a). Use the privateIPaddress field in computer table.
> Andy suggests that we can change the get_computer_private_ip to get private
> ip from the database instead of using /etc/hosts (Andy, correct me if I am
> wrong). I agree with his idea because this can avoid duplicated or blank
> entry problem of using /etc/hosts.
>
> (b). OpenStack (DNS lookup for finding unpopulated private ip)
> In our openstack module, DNS lookup or other methods (if any) can give the
> correct the private ip of the instance in order to deal with the problem
> for the private ip not being populated in the hosts file. Cameron modified
> the get_computer_private_ip in DataStructure.pm to do a DNS lookup instead
> of using the hosts file. But I would like to suggest that if possible, it
> can be better to add the DNS lookup function to openstack module rather
> than changing the DataStructure.pm. That is, we can update the
> privateIPaddress field in computer table using DNS lookup instead of
> injecting the private ip to /etc/hosts in openstack module.
We've just found out recently that the helpful DNS resolution that
openstack provides does not work well in a mutlihost openstack
environment, so can't be relied on. In multihost mode each compute
host only knows about the vms running on it locally.
>
> I think, if possible, one of the best methods for dealing with the private
> ip is that we can use the database to get the private ip of an instance and
> using DNS lookup in openstack module to update the information. Any
> suggestions and corrections about my opinion would be very helpful to solve
> this problem.
>
> Second, currently we have two versions (not exactly but for convenience);
> one uses OpenStack command line interfaces (CLIs) and one uses OpenStack
> Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for the
> OpenStcak CLIs and required to install through CPAN. I think both versions
> have pros and cons. So, I would like to ask your opinions whether it is
> better to include two different openstack versions to the next VCL release,
> to find a way to merge two versions into one openstack module, OR to create
> a higher level of openstack module so that it can choose one version based
> on user's environment. Any suggestions would be also very helpful to decide
> how we can manage openstack module. Thank you.
FYI -- The perl openstack sdk is not a wrapper for the command line
utils. It uses the openstack api, not the command line tools.
Thanks,
Curtis.
>
> Best regards,
> Young-Hyun
>
>
>
> On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <oh...@gmail.com> wrote:
>
>> Hi All,
>>
>> I have tested my openstack module (
>> https://issues.apache.org/jira/browse/VCL-590) on the OpenStack Icehouse
>> (The ninth release of OpenStack, April 17, 2014) and I could provisioning a
>> Linux image through it.
>>
>> The environment details are as follows:
>>
>> 1. Host Blade
>> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
>> :- Memory: 49G
>> :- Disk: 134G
>> :- OS: RHEL 6.4 x64 with KVM hypervisor
>> 2. OpenStack Icehouse Components
>> :- Compute
>> :- Network (Nova-Network, not OpenStack Neutron)
>> :- Glance
>> 3. Provisioning Linux image
>> :- CentOS 6.3 x64
>> 4. VCL 2.3
>>
>> In this test, I've just tested the provisioning an image but I would like
>> to post the detail information to jira once I finish other test. In
>> addition, I will try to add a function of selecting OpenStack flavors based
>> on the size of an image. The current openstack module sets flavors for each
>> image because the previous OpenStack releases (Essex as I know) didn't
>> support the size information of images but now it supports. I will also
>> post to jira issue when I add the function to my module. Thank you.
>>
>> Best regards,
>> Young-Hyun
>>
>>
>>
>> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <ca...@cybera.ca>
>> wrote:
>>
>>> >
>>> > I haven't looked at Try::Tiny or any newer exception handling features
>>> of
>>> > Perl, but I'd prefer to keep the number of external modules to a
>>> minimum if
>>> > possible. If there are new features in Perl which would be beneficial,
>>> I'd
>>> > rather make the newer version of Perl a requirement and use the built in
>>> > features. Otherwise, we're locked into using an external module,
>>> usually
>>> > from CPAN, which has no quality assurance. I regret adding some of the
>>> > current modules such as InsideOut, rather then writing the code which
>>> could
>>> > accomplish the same objective.
>>> > Did you need to catch exceptions because one of the OpenStack modules
>>> > you're using may throw a die exception? When this happens, the entire
>>> vcld
>>> > process for the reservation exits abruptly which causes problems such as
>>> > the request state remaining in pending indefinitely. This happens even
>>> if
>>> > you wrap the call in an eval block. I have worked around this problem
>>> > before by locally overriding the die handler. Take a look at
>>> > vSphere_SDK.pm and find lines such as:
>>> > # Override the die handler
>>> > local $SIG{__DIE__} = sub{};
>>> > The vSphere SDK is one example which may call die (via Carp). If this
>>> > happens with die overridden, the eval block returns normally. If an
>>> > exception occurred, $EVAL_ERROR should be set.
>>>
>>>
>>> The OpenStack SDK throws exceptions when requests that
>>> delete/modify/create
>>> resources fail, no die exceptions though. There wasn't any specific
>>> feature
>>> that made me choose Try::Tiny, it was more my unfamiliarity with exception
>>> handling in Perl which seemed to have a number of gotchas prior to 5.14 so
>>> I figured it'd be better to let someone else's code worry about that.
>>>
>>>
>>> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
>>>
>>> I see no problems. Any barriers or difficulty you encounter with the core
>>> > code should be addressed by improving the core code.
>>> > Reworking the dependency on /etc/hosts is something I'd like to improve
>>> > regardless. People often encounter problems with this if they forget to
>>> > add entries to /etc/hosts for all their computers, including the
>>> management
>>> > node(s). I'd like to not read /etc/hosts on the management node at all
>>> and
>>> > have the value in the computer table be authoritative. This should
>>> > facilitate cases where the provisioning module needs to do something
>>> > different regarding private IPs such as if they are dynamically
>>> allocated.
>>> > The provisioning module would retrieve the IP when the image gets
>>> loaded
>>> > by querying DNS or some other method and then update the database. The
>>> OS
>>> > module would then use this value to configure the computer.
>>>
>>>
>>> Sounds good. I agree that avoiding the hosts file would be best,
>>> especially
>>> in a case like this where it needs to be continuously modified. Here's our
>>> changed get_computer_private_ip_address, lines 45-55 are the new code:
>>>
>>> https://gist.github.com/cmann/9896513
>>>
>>> Finally we're still working on putting together more comprehensive
>>> installation documentation for anyone who wants to try it out. We're use
>>> automation for a number of the tasks and I haven't had a chance to run
>>> through it from scratch yet. For anyone feeling adventurous these are the
>>> most basic instructions:
>>>
>>> 1. Apply the NAT patch
>>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and 2.3.1,
>>> make sure to read the Google doc)
>>> 2. Follow the instructions in the readme in the Github repo for the
>>> OpenStack module.
>>>
>>> Cameron
>>>
>>>
>>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu> wrote:
>>>
>>> > >
>>> > >
>>> > > 2. We use the Try::Tiny module to handle exceptions since the version
>>> of
>>> > > Perl VCL 2.3 uses doesn't support the saner try/catch mechanisms
>>> > available
>>> > > in newer releases, however this would add an additional dependency to
>>> > VCL.
>>> > > Depending on the version of Perl VCL 2.4 is planning to use what are
>>> > > people's thoughts on using Try::Tiny versus switching to Perl's
>>> internal
>>> > > mechanisms?
>>> > >
>>> >
>>> > I haven't looked at Try::Tiny or any newer exception handling features
>>> of
>>> > Perl, but I'd prefer to keep the number of external modules to a
>>> minimum if
>>> > possible. If there are new features in Perl which would be beneficial,
>>> I'd
>>> > rather make the newer version of Perl a requirement and use the built in
>>> > features. Otherwise, we're locked into using an external module,
>>> usually
>>> > from CPAN, which has no quality assurance. I regret adding some of the
>>> > current modules such as InsideOut, rather then writing the code which
>>> could
>>> > accomplish the same objective.
>>> >
>>> > Did you need to catch exceptions because one of the OpenStack modules
>>> > you're using may throw a die exception? When this happens, the entire
>>> vcld
>>> > process for the reservation exits abruptly which causes problems such as
>>> > the request state remaining in pending indefinitely. This happens even
>>> if
>>> > you wrap the call in an eval block. I have worked around this problem
>>> > before by locally overriding the die handler. Take a look at
>>> > vSphere_SDK.pm and find lines such as:
>>> >
>>> > # Override the die handler
>>> > local $SIG{__DIE__} = sub{};
>>> >
>>> > The vSphere SDK is one example which may call die (via Carp). If this
>>> > happens with die overridden, the eval block returns normally. If an
>>> > exception occurred, $EVAL_ERROR should be set.
>>> >
>>> >
>>> > >
>>> > > 3. I've saved the best for last, but first some background. The
>>> biggest
>>> > > change we've made is that we no longer rely on the /etc/hosts file at
>>> all
>>> > > (though we haven't removed the code that keeps it up to date). We had
>>> a
>>> > > number of issues with duplicate entries ending up in the hosts file
>>> and
>>> > > weren't able to pin down the exact cause. This led us to adding a
>>> table
>>> > to
>>> > > the database to track VCL computer to OpenStack instance mappings. The
>>> > next
>>> > > issue we ran into was the private IP address not being populated in
>>> the
>>> > > hosts file. This happened very rarely and we're still unsure of the
>>> cause
>>> > > especially since there's an explicit check that the address is
>>> populated
>>> > > with a value before we write the hosts file. I'd assume that the Nova
>>> API
>>> > > occasionally returns a response where the addresses component is
>>> > structured
>>> > > differently than we expect, though I was never able to directly
>>> observe
>>> > > this behavior. Since OpenStack automatically creates DNS entries for
>>> new
>>> > > instances we decided the best course of action was to bypass the hosts
>>> > file
>>> > > entirely. In the end we modified get_computer_private_ip_address in
>>> > > DataStructure.pm to do a DNS lookup rather than looking in the hosts
>>> > file.
>>> > >
>>> > > The question for the community is are changes to core VCL code
>>> > acceptable?
>>> > > Or should we find a solution that keeps everything contained to the
>>> > > provisioning module? If changes to core code are acceptable we'd also
>>> > have
>>> > > to decide on a method of detecting when to do a DNS lookup. Should it
>>> > > depend on the provisioning module in use? A configuration option?
>>> >
>>> >
>>> > I see no problems. Any barriers or difficulty you encounter with the
>>> core
>>> > code should be addressed by improving the core code.
>>> >
>>> > Reworking the dependency on /etc/hosts is something I'd like to improve
>>> > regardless. People often encounter problems with this if they forget to
>>> > add entries to /etc/hosts for all their computers, including the
>>> management
>>> > node(s). I'd like to not read /etc/hosts on the management node at all
>>> and
>>> > have the value in the computer table be authoritative. This should
>>> > facilitate cases where the provisioning module needs to do something
>>> > different regarding private IPs such as if they are dynamically
>>> allocated.
>>> > The provisioning module would retrieve the IP when the image gets
>>> loaded
>>> > by querying DNS or some other method and then update the database. The
>>> OS
>>> > module would then use this value to configure the computer.
>>> >
>>> > One comment regarding adding tables... great! Add all the tables you
>>> think
>>> > are beneficial. I have seen some try to work around the current
>>> database
>>> > schema rather than adding to it. There's no reason for this. If there
>>> are
>>> > configuration options which apply only to OpenStack, add something like
>>> an
>>> > openstackconfig table. If the vmprofile table doesn't align, add
>>> something
>>> > like an openstackprofile table. If there are general options such as
>>> how
>>> > to handle DNS or private IP resolution, we could add a more general
>>> table
>>> > or possibly extend the managementnode or computer table.
>>> >
>>> > Thanks,
>>> > Andy
>>> >
>>>
>>
>>
--
Twitter: @serverascode
Blog: serverascode.com
Re: OpenStack Module
Posted by YOUNG OH <oh...@gmail.com>.
Hi All,
I would like to bring your attention again to discuss what OpenStack module
should include. I would like to discus two issues first.
First, we know that using /etc/hosts to get the private ip of an instance
can be problematic. Specifically, Cameron (at Cybera) and I had found that
there might duplicated or blank entries and rarely but OpenStack APIs
cannot get the private ip (not populated) of an instance properly. For the
later case, Cameron added DNS Lookup function to get the correct private IP
(Cameron, correct me if I am wrong). This problem leads us to avoid using
/etc/hosts file to get the private ip but I think we need to first discuss
what the best way is to handle the private ip:
(a). Use the privateIPaddress field in computer table.
Andy suggests that we can change the get_computer_private_ip to get private
ip from the database instead of using /etc/hosts (Andy, correct me if I am
wrong). I agree with his idea because this can avoid duplicated or blank
entry problem of using /etc/hosts.
(b). OpenStack (DNS lookup for finding unpopulated private ip)
In our openstack module, DNS lookup or other methods (if any) can give the
correct the private ip of the instance in order to deal with the problem
for the private ip not being populated in the hosts file. Cameron modified
the get_computer_private_ip in DataStructure.pm to do a DNS lookup instead
of using the hosts file. But I would like to suggest that if possible, it
can be better to add the DNS lookup function to openstack module rather
than changing the DataStructure.pm. That is, we can update the
privateIPaddress field in computer table using DNS lookup instead of
injecting the private ip to /etc/hosts in openstack module.
I think, if possible, one of the best methods for dealing with the private
ip is that we can use the database to get the private ip of an instance and
using DNS lookup in openstack module to update the information. Any
suggestions and corrections about my opinion would be very helpful to solve
this problem.
Second, currently we have two versions (not exactly but for convenience);
one uses OpenStack command line interfaces (CLIs) and one uses OpenStack
Perl SDKs. As I understand, the Perl SDKs are wrapper APIs for the
OpenStcak CLIs and required to install through CPAN. I think both versions
have pros and cons. So, I would like to ask your opinions whether it is
better to include two different openstack versions to the next VCL release,
to find a way to merge two versions into one openstack module, OR to create
a higher level of openstack module so that it can choose one version based
on user's environment. Any suggestions would be also very helpful to decide
how we can manage openstack module. Thank you.
Best regards,
Young-Hyun
On Mon, Jun 2, 2014 at 2:22 PM, YOUNG OH <oh...@gmail.com> wrote:
> Hi All,
>
> I have tested my openstack module (
> https://issues.apache.org/jira/browse/VCL-590) on the OpenStack Icehouse
> (The ninth release of OpenStack, April 17, 2014) and I could provisioning a
> Linux image through it.
>
> The environment details are as follows:
>
> 1. Host Blade
> :- CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
> :- Memory: 49G
> :- Disk: 134G
> :- OS: RHEL 6.4 x64 with KVM hypervisor
> 2. OpenStack Icehouse Components
> :- Compute
> :- Network (Nova-Network, not OpenStack Neutron)
> :- Glance
> 3. Provisioning Linux image
> :- CentOS 6.3 x64
> 4. VCL 2.3
>
> In this test, I've just tested the provisioning an image but I would like
> to post the detail information to jira once I finish other test. In
> addition, I will try to add a function of selecting OpenStack flavors based
> on the size of an image. The current openstack module sets flavors for each
> image because the previous OpenStack releases (Essex as I know) didn't
> support the size information of images but now it supports. I will also
> post to jira issue when I add the function to my module. Thank you.
>
> Best regards,
> Young-Hyun
>
>
>
> On Mon, Mar 31, 2014 at 12:55 PM, Cameron Mann <ca...@cybera.ca>
> wrote:
>
>> >
>> > I haven't looked at Try::Tiny or any newer exception handling features
>> of
>> > Perl, but I'd prefer to keep the number of external modules to a
>> minimum if
>> > possible. If there are new features in Perl which would be beneficial,
>> I'd
>> > rather make the newer version of Perl a requirement and use the built in
>> > features. Otherwise, we're locked into using an external module,
>> usually
>> > from CPAN, which has no quality assurance. I regret adding some of the
>> > current modules such as InsideOut, rather then writing the code which
>> could
>> > accomplish the same objective.
>> > Did you need to catch exceptions because one of the OpenStack modules
>> > you're using may throw a die exception? When this happens, the entire
>> vcld
>> > process for the reservation exits abruptly which causes problems such as
>> > the request state remaining in pending indefinitely. This happens even
>> if
>> > you wrap the call in an eval block. I have worked around this problem
>> > before by locally overriding the die handler. Take a look at
>> > vSphere_SDK.pm and find lines such as:
>> > # Override the die handler
>> > local $SIG{__DIE__} = sub{};
>> > The vSphere SDK is one example which may call die (via Carp). If this
>> > happens with die overridden, the eval block returns normally. If an
>> > exception occurred, $EVAL_ERROR should be set.
>>
>>
>> The OpenStack SDK throws exceptions when requests that
>> delete/modify/create
>> resources fail, no die exceptions though. There wasn't any specific
>> feature
>> that made me choose Try::Tiny, it was more my unfamiliarity with exception
>> handling in Perl which seemed to have a number of gotchas prior to 5.14 so
>> I figured it'd be better to let someone else's code worry about that.
>>
>>
>> http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/
>>
>> I see no problems. Any barriers or difficulty you encounter with the core
>> > code should be addressed by improving the core code.
>> > Reworking the dependency on /etc/hosts is something I'd like to improve
>> > regardless. People often encounter problems with this if they forget to
>> > add entries to /etc/hosts for all their computers, including the
>> management
>> > node(s). I'd like to not read /etc/hosts on the management node at all
>> and
>> > have the value in the computer table be authoritative. This should
>> > facilitate cases where the provisioning module needs to do something
>> > different regarding private IPs such as if they are dynamically
>> allocated.
>> > The provisioning module would retrieve the IP when the image gets
>> loaded
>> > by querying DNS or some other method and then update the database. The
>> OS
>> > module would then use this value to configure the computer.
>>
>>
>> Sounds good. I agree that avoiding the hosts file would be best,
>> especially
>> in a case like this where it needs to be continuously modified. Here's our
>> changed get_computer_private_ip_address, lines 45-55 are the new code:
>>
>> https://gist.github.com/cmann/9896513
>>
>> Finally we're still working on putting together more comprehensive
>> installation documentation for anyone who wants to try it out. We're use
>> automation for a number of the tasks and I haven't had a chance to run
>> through it from scratch yet. For anyone feeling adventurous these are the
>> most basic instructions:
>>
>> 1. Apply the NAT patch
>> (https://issues.apache.org/jira/browse/VCL-174tested on 2.3 and 2.3.1,
>> make sure to read the Google doc)
>> 2. Follow the instructions in the readme in the Github repo for the
>> OpenStack module.
>>
>> Cameron
>>
>>
>> On Fri, Mar 28, 2014 at 7:54 AM, Andy Kurth <an...@ncsu.edu> wrote:
>>
>> > >
>> > >
>> > > 2. We use the Try::Tiny module to handle exceptions since the version
>> of
>> > > Perl VCL 2.3 uses doesn't support the saner try/catch mechanisms
>> > available
>> > > in newer releases, however this would add an additional dependency to
>> > VCL.
>> > > Depending on the version of Perl VCL 2.4 is planning to use what are
>> > > people's thoughts on using Try::Tiny versus switching to Perl's
>> internal
>> > > mechanisms?
>> > >
>> >
>> > I haven't looked at Try::Tiny or any newer exception handling features
>> of
>> > Perl, but I'd prefer to keep the number of external modules to a
>> minimum if
>> > possible. If there are new features in Perl which would be beneficial,
>> I'd
>> > rather make the newer version of Perl a requirement and use the built in
>> > features. Otherwise, we're locked into using an external module,
>> usually
>> > from CPAN, which has no quality assurance. I regret adding some of the
>> > current modules such as InsideOut, rather then writing the code which
>> could
>> > accomplish the same objective.
>> >
>> > Did you need to catch exceptions because one of the OpenStack modules
>> > you're using may throw a die exception? When this happens, the entire
>> vcld
>> > process for the reservation exits abruptly which causes problems such as
>> > the request state remaining in pending indefinitely. This happens even
>> if
>> > you wrap the call in an eval block. I have worked around this problem
>> > before by locally overriding the die handler. Take a look at
>> > vSphere_SDK.pm and find lines such as:
>> >
>> > # Override the die handler
>> > local $SIG{__DIE__} = sub{};
>> >
>> > The vSphere SDK is one example which may call die (via Carp). If this
>> > happens with die overridden, the eval block returns normally. If an
>> > exception occurred, $EVAL_ERROR should be set.
>> >
>> >
>> > >
>> > > 3. I've saved the best for last, but first some background. The
>> biggest
>> > > change we've made is that we no longer rely on the /etc/hosts file at
>> all
>> > > (though we haven't removed the code that keeps it up to date). We had
>> a
>> > > number of issues with duplicate entries ending up in the hosts file
>> and
>> > > weren't able to pin down the exact cause. This led us to adding a
>> table
>> > to
>> > > the database to track VCL computer to OpenStack instance mappings. The
>> > next
>> > > issue we ran into was the private IP address not being populated in
>> the
>> > > hosts file. This happened very rarely and we're still unsure of the
>> cause
>> > > especially since there's an explicit check that the address is
>> populated
>> > > with a value before we write the hosts file. I'd assume that the Nova
>> API
>> > > occasionally returns a response where the addresses component is
>> > structured
>> > > differently than we expect, though I was never able to directly
>> observe
>> > > this behavior. Since OpenStack automatically creates DNS entries for
>> new
>> > > instances we decided the best course of action was to bypass the hosts
>> > file
>> > > entirely. In the end we modified get_computer_private_ip_address in
>> > > DataStructure.pm to do a DNS lookup rather than looking in the hosts
>> > file.
>> > >
>> > > The question for the community is are changes to core VCL code
>> > acceptable?
>> > > Or should we find a solution that keeps everything contained to the
>> > > provisioning module? If changes to core code are acceptable we'd also
>> > have
>> > > to decide on a method of detecting when to do a DNS lookup. Should it
>> > > depend on the provisioning module in use? A configuration option?
>> >
>> >
>> > I see no problems. Any barriers or difficulty you encounter with the
>> core
>> > code should be addressed by improving the core code.
>> >
>> > Reworking the dependency on /etc/hosts is something I'd like to improve
>> > regardless. People often encounter problems with this if they forget to
>> > add entries to /etc/hosts for all their computers, including the
>> management
>> > node(s). I'd like to not read /etc/hosts on the management node at all
>> and
>> > have the value in the computer table be authoritative. This should
>> > facilitate cases where the provisioning module needs to do something
>> > different regarding private IPs such as if they are dynamically
>> allocated.
>> > The provisioning module would retrieve the IP when the image gets
>> loaded
>> > by querying DNS or some other method and then update the database. The
>> OS
>> > module would then use this value to configure the computer.
>> >
>> > One comment regarding adding tables... great! Add all the tables you
>> think
>> > are beneficial. I have seen some try to work around the current
>> database
>> > schema rather than adding to it. There's no reason for this. If there
>> are
>> > configuration options which apply only to OpenStack, add something like
>> an
>> > openstackconfig table. If the vmprofile table doesn't align, add
>> something
>> > like an openstackprofile table. If there are general options such as
>> how
>> > to handle DNS or private IP resolution, we could add a more general
>> table
>> > or possibly extend the managementnode or computer table.
>> >
>> > Thanks,
>> > Andy
>> >
>>
>
>