Xen API Ruby Bindings? - ruby

Does anyone know if there is a full XenServer API implementation in ruby floating around out there? I found this: http://github.com/rubiojr/pangea/tree/master but its read only and not fully built out.

Libvirt is an abstraction layer that can work with different kinds of VMs, like xen, kvm, virtualbox, ...
http://libvirt.org/
It has ruby bindings
http://libvirt.org/ruby/
I also found using libvirt itself to be an enormous gain.

You can find unofficial ruby bindings for XenAPI here.
N.B: It only supports http/network based sessions only. Support for unix sockets is not included, which shouldn't be an issue as ruby isn't part of the XenServer distribution.

Related

Does puppetlabs/ntp work for windows 10/server?

I am working with puppet and foreman as puppet UI. Trying to sync NTP module with windows agent. It does not work. But it works with Linux centos7 and ubuntu agent.
Does anyone guide me, please?
The puppetlabs/ntp module's page on the Forge does not list any version of Windows among the supported operating systems. The Puppet PE supported modules page also appears to indicate that puppetlabs/ntp does not support Windows. As far as I can tell, if you want to use Puppet to manage Windows time synchronization configuration then you need to use a different module or roll your own.
And rolling your own might be your best alternative. I find only one likely module on the forge, but it is quite old, does not claim to support recent versions of Puppet, and has a low quality score. It might nevertheless serve your purpose just fine, but if not, then I'm inclined to guess that you won't get much help from the developer.
You could try https://forge.puppet.com/modules/tse/winntp that is the module used in the labs in the official Puppet training courses.

how to write cross-version/platform Linux kernel modules?

I'm new to programming Linux kernel modules, and many getting started guides on the topic include little information about how to build a kernel module which will run on many versions and CPU platforms of Linux. Most of the guides I've seen simply state things like, "Linux doesn't ensure any ABI/API compatibility between versions." However, other OSes do provide these guarantees for major versions, and the guides are mostly targeting 2.7 (which is a bit old now).
I was wondering if there is any kind of ABI/API compatibility now, or if there are any standard ways to deal with versioning other than isolating the kernel-dependent bits of my code into files with a ton of preprocessor directives. (Also, are there any standard preprocessor symbols I should be using in the second case?)
There isn't a stable ABI for the kernel and most likely never will be because it'd make Linux suck. The reasons for not having one are all pretty much documented in that link.
The best way to deal with this is to get your driver merged upstream where it'll be maintained by other kernel developers.
As to being cross-platform, that pretty much comes free with the Linux kernel as long as you only use the standard, platform-independent functions provided in the API.
Linux, the ying and the yang. Tangrs answer is good; it answers your question. However, there is the linux compat projects. See the backports wiki. Basically, there are libraries that provide shim functionality for newer Linux ABI's which you can use to link your code. The KERNEL_VERSION macro that Eugene notes is inspected in a compat.h, and appropriate compat-2.6.38.h, etc are included where each version has either macros and/or library functions to provide a forward API.
This lets the Linux Wifi group write code for the bleeding edge kernel, while still making it possible to compile on older kernel versions.
I guess this answers the question,
if there are any standard ways to deal with versioning?
The compat library is not a panacea, but at least it is there and under development.
Open source - There are many mutations. They all have a different plan.

Need a mongo driver that supports replica sets and eventmachine for ruby

I am trying to find a ruby based mongo driver to use in my project. It has to support replicasets and eventmachine. I'm aware of em-mongo, but it does not support replicasets. It looks like there is not a good option at the moment, but I wanted to see if anyone was aware of one before I explore mongo alternatives...
I'm a maintainer for the 10gen Ruby driver. Hang tight, we'll have support for this in the near future.
I don't believe there is anything out there (from 10gen or otherwise) that does this currently but we're actively working on a version of our driver that supports asynchronous reads and writes.
All of the official 10gen drivers are aiming to support this by mid to end of the year and the ruby driver team is already working on it. Hopefully we'll have something for you much earlier than that (likely in our 2.0 release).
You can try my fork of em-mongo with Replica Set support.
Also I am working on gem Monga which should support some modern features of MongoDB. But it is totally not production ready right now.

SNMP V3 Get and Set in Ruby

I am looking for a solution which will allow me to call get and set SNMP commands for SNMPv3 in Ruby. From what I have found, there only appears to be the snmplib, which only supports versions 1 and 2c. Does anyone know of an alternative gem or library that I can use?
If you're using JRuby, you could use SNMP4J:
http://www.snmp4j.org/
If you're using MRI and have the net-snmp library installed, this might work (haven't tried it):
https://github.com/mixtli/net-snmp

Differences between Ruby VMs

What are the advantages/disadvantages of the major Ruby VMs (things like features, compatibility, performance, and quirks?) I know there are also some bonus features like being able to use Java interfaces through JRuby, too. Those would also be helpful to note. Does any VM have a clear advantage at this point, and in what contexts?
I've used both Matz's Ruby and JRuby, and they solve different tasks. If you are developing a straight Ruby or Rails app, then that will probably suffice, but if there are some powerful Java libraries that would help a lot, then JRuby might be worthwhile.
I haven't done anything overly complicated, but JRuby seemed to match up pretty well, at least as far as implementing the core language features (I haven't run into any differences yet, but they may exist).
One little anecdote I wish to share... I was writing a script to interact with a DB2 database. The DB2 support in Ruby is abysmal... you have to install the whole DB2 express version just to be able to compile the Ruby drivers, which didn't even work for me. I got fed up and switched to JRuby, using JDBC and a few small DB2 JDBC jars. It resolved my problem perfectly. The point? Well, if gaining access to some Java libraries will simplify the problem at hand, by all means go for it!
I hope this was helpful! Sorry I don't have any experience with other VMs....
One more caveat I have read about, but I don't know the details too well... JRuby I think supports threading via Java threads, instead of the "green" threads supported in Matz's implementation... so if you want multithreading on multicore systems, JRuby will probably serve you better... unless you want to do the threading in C.
Here's a bit of info I scrounged up on the main VMs: Ruby MRI, Ruby 1.9 (YARV), JRuby, XRuby, Rubinius, and IronRuby
There was a performance benchmark last year that compared the major VMs, but with how quickly VM development has been it probably is not as relevant today. Ruby 1.9 was generally the fastest, and still has the edge over JRuby for now, I believe.
Four VMs are currently capable of running Ruby on Rails: Ruby MRI, Ruby 1.9, JRuby, and Rubinius.
XRuby runs on the JVM, as does JRuby, and compiles the Ruby source files to a Java .class.
IronRuby runs on .NET, making use of their DLR, and allows you to integrate Ruby with the .NET libraries and infrastructure. It cannot yet run Ruby on Rails.
There is also a VM called HotRuby that lets you run Ruby source code in the browser or in Flash.

Resources