Skip to content

Instantly share code, notes, and snippets.

View enricruiz's full-sized avatar
💭
💩

Enric Ruiz enricruiz

💭
💩
  • Abiquo
  • Barcelona
View GitHub Profile
#
# Config file for collectd(1).
# Please read collectd.conf(5) for a list of options.
# http://collectd.org/
#
##############################################################################
# Global #
#----------------------------------------------------------------------------#
# Global settings for the daemon. #
@enricruiz
enricruiz / abiquo.rb
Last active August 29, 2015 14:06
Use abiquo plugins with JRuby
require 'java'
Dir["lib/*.jar"].each { |jar| require jar }
import com.abiquo.hypervisor.plugin.PluginManager
import com.abiquo.hypervisor.model.ConnectionData
import com.abiquo.hypervisor.plugin.exception.HypervisorPluginException
# Initialize plugin system
PluginManager.create_instance()
plugin_manager = PluginManager.get_instance()
eruiz:~/projects/abiquo/vsm ((no branch))$ git st
# Not currently on any branch.
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: pom.xml
# modified: src/main/java/com/abiquo/vsm/VSMManager.java
# deleted: src/main/java/com/abiquo/vsm/migration/Keymaker.java
# deleted: src/main/java/com/abiquo/vsm/migration/Migrator.java
STOPPED = 0
PROVISIONED = 1
NOT_MANAGED = 2
MANAGED = 3
HALTED = 4
UNLICENSED = 5
HA_IN_PROGRESS = 6
DISABLED_FOR_HA = 7
HALTED_FOR_SAVE = 8
Link to Owner
------- -----
state VM VM
deploy VM VM
undeploy VM VM
reconfigure VM VM
conversion CV CV
persistent T T
instance T VM
instance-persistent T VM
Deployed => ABQ_e59a63c7-53d8-43c8-96b3-1bccf1468c94
/**
* Abiquo community edition
* cloud management application for hybrid clouds
* Copyright (C) 2008-2010 - Abiquo Holdings S.L.
*
* This application is free software; you can redistribute it and/or
* modify it under the terms of the GNU LESSER GENERAL PUBLIC
* LICENSE as published by the Free Software Foundation under
* version 3 of the License
*
@enricruiz
enricruiz / api.md
Created December 15, 2011 15:54
VSM API cheatsheet ( < v2.2)

VSM Rest API ( < v2.2)

Take care to build the hypervisor address as follows (last '/' is mandatory):

http://#{ip}:#{port}/

Hypervisor types are:

  • VMX_04
@enricruiz
enricruiz / README.md
Created December 13, 2011 10:48
Restore VSM state from MySQL

Restore VSM from MySQL

Usage

git clone git://gist.github.com/1471651.git vsmrestore
cd vsmrestore
ruby restorevsm.rb --help
@enricruiz
enricruiz / vsmdefects.rb
Created November 15, 2011 20:14
List defects on vsm redis db
require "redis"
redis = Redis.new(:host => "localhost", :port => 6379)
# Search duplicated vm's in pm's cache
keys = redis.keys("VirtualMachinesCache:cache:*")
keys.each do |key|
pms = redis.smembers(key)
vm_id = key.split(":")[2]