mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 20:02:38 +09:00
Merge branch 'vmware_refactor' into feature-1020
This commit is contained in:
commit
a1dbd7f115
72 files changed
+1896
-234
No files matched your search
@@ -210,7 +210,7 @@ public:
|
||||
HostAllocate():
|
||||
RequestManagerAllocate("HostAllocate",
|
||||
"Allocates a new host",
|
||||
"A:sssss",
|
||||
"A:ssssss",
|
||||
false)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
|
||||
@@ -967,6 +967,7 @@ OCCI_ETC_TEMPLATE_FILES="src/cloud/occi/etc/templates/common.erb \
|
||||
src/cloud/occi/etc/templates/custom.erb \
|
||||
src/cloud/occi/etc/templates/small.erb \
|
||||
src/cloud/occi/etc/templates/medium.erb \
|
||||
src/cloud/occi/etc/templates/network.erb \
|
||||
src/cloud/occi/etc/templates/large.erb"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
These XML Schemas define the XMLs returned by OpenNebula's XML-RPC API.
|
||||
|
||||
The included XML samples are not actual responses from OpenNebula, as it does
|
||||
not include the headers (namespace, schema location).
|
||||
|
||||
|
||||
To learn more, please read the API reference documentation at
|
||||
http://opennebula.org/documentation:documentation:api
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:element name="GROUP">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="USERS">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:include schemaLocation="group.xsd"/>
|
||||
<xs:element name="GROUP_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
||||
<xs:element ref="GROUP" maxOccurs="unbounded" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://opennebula.org/XMLSchema" elementFormDefault="qualified" targetNamespace="http://opennebula.org/XMLSchema">
|
||||
<xs:element name="HOST">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="STATE" type="xs:integer"/>
|
||||
<xs:element name="IM_MAD" type="xs:string"/>
|
||||
<xs:element name="VM_MAD" type="xs:string"/>
|
||||
<xs:element name="VN_MAD" type="xs:string"/>
|
||||
<xs:element name="TM_MAD" type="xs:string"/>
|
||||
<xs:element name="LAST_MON_TIME" type="xs:integer"/>
|
||||
<xs:element name="HOST_SHARE">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DISK_USAGE" type="xs:integer"/>
|
||||
<xs:element name="MEM_USAGE" type="xs:integer"/>
|
||||
<xs:element name="CPU_USAGE" type="xs:integer"/>
|
||||
<xs:element name="MAX_DISK" type="xs:integer"/>
|
||||
<xs:element name="MAX_MEM" type="xs:integer"/>
|
||||
<xs:element name="MAX_CPU" type="xs:integer"/>
|
||||
<xs:element name="FREE_DISK" type="xs:integer"/>
|
||||
<xs:element name="FREE_MEM" type="xs:integer"/>
|
||||
<xs:element name="FREE_CPU" type="xs:integer"/>
|
||||
<xs:element name="USED_DISK" type="xs:integer"/>
|
||||
<xs:element name="USED_MEM" type="xs:integer"/>
|
||||
<xs:element name="USED_CPU" type="xs:integer"/>
|
||||
<xs:element name="RUNNING_VMS" type="xs:integer"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:include schemaLocation="host.xsd"/>
|
||||
<xs:element name="HOST_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
||||
<xs:element ref="HOST" maxOccurs="unbounded" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://opennebula.org/XMLSchema" elementFormDefault="qualified" targetNamespace="http://opennebula.org/XMLSchema">
|
||||
<xs:element name="IMAGE">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="UID" type="xs:integer"/>
|
||||
<xs:element name="GID" type="xs:integer"/>
|
||||
<xs:element name="UNAME" type="xs:string"/>
|
||||
<xs:element name="GNAME" type="xs:string"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="TYPE" type="xs:integer"/>
|
||||
<xs:element name="PUBLIC" type="xs:integer"/>
|
||||
<xs:element name="PERSISTENT" type="xs:integer"/>
|
||||
<xs:element name="REGTIME" type="xs:integer"/>
|
||||
<xs:element name="SOURCE" type="xs:string"/>
|
||||
<xs:element name="PATH" type="xs:string"/>
|
||||
<xs:element name="FSTYPE" type="xs:string"/>
|
||||
<xs:element name="SIZE" type="xs:integer"/>
|
||||
<xs:element name="STATE" type="xs:integer"/>
|
||||
<xs:element name="RUNNING_VMS" type="xs:integer"/>
|
||||
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:include schemaLocation="image.xsd"/>
|
||||
<xs:element name="IMAGE_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
||||
<xs:element ref="IMAGE" maxOccurs="unbounded" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,12 @@
|
||||
<GROUP xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../group.xsd">
|
||||
<ID>1</ID>
|
||||
<NAME>users</NAME>
|
||||
<USERS>
|
||||
<ID>2</ID>
|
||||
<ID>3</ID>
|
||||
<ID>4</ID>
|
||||
<ID>5</ID>
|
||||
</USERS>
|
||||
</GROUP>
|
||||
@@ -0,0 +1,7 @@
|
||||
<GROUP xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../group.xsd">
|
||||
<ID>100</ID>
|
||||
<NAME>new</NAME>
|
||||
<USERS/>
|
||||
</GROUP>
|
||||
@@ -0,0 +1,37 @@
|
||||
<GROUP_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../group.xsd">
|
||||
<GROUP>
|
||||
<ID>0</ID>
|
||||
<NAME>oneadmin</NAME>
|
||||
<USERS>
|
||||
<ID>0</ID>
|
||||
<ID>1</ID>
|
||||
</USERS>
|
||||
</GROUP>
|
||||
<GROUP>
|
||||
<ID>1</ID>
|
||||
<NAME>users</NAME>
|
||||
<USERS>
|
||||
<ID>2</ID>
|
||||
<ID>3</ID>
|
||||
<ID>4</ID>
|
||||
<ID>5</ID>
|
||||
</USERS>
|
||||
</GROUP>
|
||||
<GROUP>
|
||||
<ID>100</ID>
|
||||
<NAME>new</NAME>
|
||||
<USERS/>
|
||||
</GROUP>
|
||||
<GROUP>
|
||||
<ID>101</ID>
|
||||
<NAME>test</NAME>
|
||||
<USERS/>
|
||||
</GROUP>
|
||||
<GROUP>
|
||||
<ID>102</ID>
|
||||
<NAME>abc</NAME>
|
||||
<USERS/>
|
||||
</GROUP>
|
||||
</GROUP_POOL>
|
||||
@@ -0,0 +1,27 @@
|
||||
<HOST xmlns="http://opennebula.org/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../image.xsd">
|
||||
<ID>0</ID>
|
||||
<NAME>localhost</NAME>
|
||||
<STATE>3</STATE>
|
||||
<IM_MAD>im_dummy</IM_MAD>
|
||||
<VM_MAD>vmm_dummy</VM_MAD>
|
||||
<VN_MAD>fw</VN_MAD>
|
||||
<TM_MAD>tm_shared</TM_MAD>
|
||||
<LAST_MON_TIME>0</LAST_MON_TIME>
|
||||
<HOST_SHARE>
|
||||
<DISK_USAGE>0</DISK_USAGE>
|
||||
<MEM_USAGE>0</MEM_USAGE>
|
||||
<CPU_USAGE>0</CPU_USAGE>
|
||||
<MAX_DISK>0</MAX_DISK>
|
||||
<MAX_MEM>0</MAX_MEM>
|
||||
<MAX_CPU>0</MAX_CPU>
|
||||
<FREE_DISK>0</FREE_DISK>
|
||||
<FREE_MEM>0</FREE_MEM>
|
||||
<FREE_CPU>0</FREE_CPU>
|
||||
<USED_DISK>0</USED_DISK>
|
||||
<USED_MEM>0</USED_MEM>
|
||||
<USED_CPU>0</USED_CPU>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
</HOST_SHARE>
|
||||
<TEMPLATE/>
|
||||
</HOST>
|
||||
@@ -0,0 +1,27 @@
|
||||
<HOST xmlns="http://opennebula.org/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../image.xsd">
|
||||
<ID>0</ID>
|
||||
<NAME>localhost</NAME>
|
||||
<STATE>3</STATE>
|
||||
<IM_MAD>im_dummy</IM_MAD>
|
||||
<VM_MAD>vmm_dummy</VM_MAD>
|
||||
<VN_MAD>fw</VN_MAD>
|
||||
<TM_MAD>tm_shared</TM_MAD>
|
||||
<LAST_MON_TIME>0</LAST_MON_TIME>
|
||||
<HOST_SHARE>
|
||||
<DISK_USAGE>0</DISK_USAGE>
|
||||
<MEM_USAGE>0</MEM_USAGE>
|
||||
<CPU_USAGE>0</CPU_USAGE>
|
||||
<MAX_DISK>0</MAX_DISK>
|
||||
<MAX_MEM>0</MAX_MEM>
|
||||
<MAX_CPU>0</MAX_CPU>
|
||||
<FREE_DISK>0</FREE_DISK>
|
||||
<FREE_MEM>0</FREE_MEM>
|
||||
<FREE_CPU>0</FREE_CPU>
|
||||
<USED_DISK>0</USED_DISK>
|
||||
<USED_MEM>0</USED_MEM>
|
||||
<USED_CPU>0</USED_CPU>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
</HOST_SHARE>
|
||||
<TEMPLATE/>
|
||||
</HOST>
|
||||
@@ -0,0 +1,38 @@
|
||||
<HOST xmlns="http://opennebula.org/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../image.xsd">
|
||||
<ID>0</ID>
|
||||
<NAME>localhost</NAME>
|
||||
<STATE>2</STATE>
|
||||
<IM_MAD>im_dummy</IM_MAD>
|
||||
<VM_MAD>vmm_dummy</VM_MAD>
|
||||
<VN_MAD>fw</VN_MAD>
|
||||
<TM_MAD>tm_shared</TM_MAD>
|
||||
<LAST_MON_TIME>1324039779</LAST_MON_TIME>
|
||||
<HOST_SHARE>
|
||||
<DISK_USAGE>0</DISK_USAGE>
|
||||
<MEM_USAGE>0</MEM_USAGE>
|
||||
<CPU_USAGE>0</CPU_USAGE>
|
||||
<MAX_DISK>0</MAX_DISK>
|
||||
<MAX_MEM>16777216</MAX_MEM>
|
||||
<MAX_CPU>800</MAX_CPU>
|
||||
<FREE_DISK>0</FREE_DISK>
|
||||
<FREE_MEM>16777216</FREE_MEM>
|
||||
<FREE_CPU>800</FREE_CPU>
|
||||
<USED_DISK>0</USED_DISK>
|
||||
<USED_MEM>0</USED_MEM>
|
||||
<USED_CPU>0</USED_CPU>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
</HOST_SHARE>
|
||||
<TEMPLATE>
|
||||
<CPUSPEED><![CDATA[2.2GHz]]></CPUSPEED>
|
||||
<FREECPU><![CDATA[800]]></FREECPU>
|
||||
<FREEMEMORY><![CDATA[16777216]]></FREEMEMORY>
|
||||
<HOSTNAME><![CDATA[localhost]]></HOSTNAME>
|
||||
<HYPERVISOR><![CDATA[dummy]]></HYPERVISOR>
|
||||
<TEST><![CDATA[TEST]]></TEST>
|
||||
<TOTALCPU><![CDATA[800]]></TOTALCPU>
|
||||
<TOTALMEMORY><![CDATA[16777216]]></TOTALMEMORY>
|
||||
<USEDCPU><![CDATA[0]]></USEDCPU>
|
||||
<USEDMEMORY><![CDATA[0]]></USEDMEMORY>
|
||||
</TEMPLATE>
|
||||
</HOST>
|
||||
@@ -0,0 +1,41 @@
|
||||
<HOST_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../host_pool.xsd">
|
||||
<HOST>
|
||||
<ID>0</ID>
|
||||
<NAME>localhost</NAME>
|
||||
<STATE>2</STATE>
|
||||
<IM_MAD>im_dummy</IM_MAD>
|
||||
<VM_MAD>vmm_dummy</VM_MAD>
|
||||
<VN_MAD>fw</VN_MAD>
|
||||
<TM_MAD>tm_shared</TM_MAD>
|
||||
<LAST_MON_TIME>1324048185</LAST_MON_TIME>
|
||||
<HOST_SHARE>
|
||||
<DISK_USAGE>0</DISK_USAGE>
|
||||
<MEM_USAGE>0</MEM_USAGE>
|
||||
<CPU_USAGE>0</CPU_USAGE>
|
||||
<MAX_DISK>0</MAX_DISK>
|
||||
<MAX_MEM>16777216</MAX_MEM>
|
||||
<MAX_CPU>800</MAX_CPU>
|
||||
<FREE_DISK>0</FREE_DISK>
|
||||
<FREE_MEM>16777216</FREE_MEM>
|
||||
<FREE_CPU>800</FREE_CPU>
|
||||
<USED_DISK>0</USED_DISK>
|
||||
<USED_MEM>0</USED_MEM>
|
||||
<USED_CPU>0</USED_CPU>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
</HOST_SHARE>
|
||||
<TEMPLATE>
|
||||
<CPUSPEED><![CDATA[2.2GHz]]></CPUSPEED>
|
||||
<FREECPU><![CDATA[800]]></FREECPU>
|
||||
<FREEMEMORY><![CDATA[16777216]]></FREEMEMORY>
|
||||
<HOSTNAME><![CDATA[localhost]]></HOSTNAME>
|
||||
<HYPERVISOR><![CDATA[dummy]]></HYPERVISOR>
|
||||
<TEST><![CDATA[TEST]]></TEST>
|
||||
<TOTALCPU><![CDATA[800]]></TOTALCPU>
|
||||
<TOTALMEMORY><![CDATA[16777216]]></TOTALMEMORY>
|
||||
<USEDCPU><![CDATA[0]]></USEDCPU>
|
||||
<USEDMEMORY><![CDATA[0]]></USEDMEMORY>
|
||||
</TEMPLATE>
|
||||
</HOST>
|
||||
</HOST_POOL>
|
||||
@@ -0,0 +1,67 @@
|
||||
<HOST_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../host_pool.xsd">
|
||||
<HOST>
|
||||
<ID>0</ID>
|
||||
<NAME>localhost</NAME>
|
||||
<STATE>2</STATE>
|
||||
<IM_MAD>im_dummy</IM_MAD>
|
||||
<VM_MAD>vmm_dummy</VM_MAD>
|
||||
<VN_MAD>fw</VN_MAD>
|
||||
<TM_MAD>tm_shared</TM_MAD>
|
||||
<LAST_MON_TIME>1324048436</LAST_MON_TIME>
|
||||
<HOST_SHARE>
|
||||
<DISK_USAGE>0</DISK_USAGE>
|
||||
<MEM_USAGE>0</MEM_USAGE>
|
||||
<CPU_USAGE>0</CPU_USAGE>
|
||||
<MAX_DISK>0</MAX_DISK>
|
||||
<MAX_MEM>16777216</MAX_MEM>
|
||||
<MAX_CPU>800</MAX_CPU>
|
||||
<FREE_DISK>0</FREE_DISK>
|
||||
<FREE_MEM>16777216</FREE_MEM>
|
||||
<FREE_CPU>800</FREE_CPU>
|
||||
<USED_DISK>0</USED_DISK>
|
||||
<USED_MEM>0</USED_MEM>
|
||||
<USED_CPU>0</USED_CPU>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
</HOST_SHARE>
|
||||
<TEMPLATE>
|
||||
<CPUSPEED><![CDATA[2.2GHz]]></CPUSPEED>
|
||||
<FREECPU><![CDATA[800]]></FREECPU>
|
||||
<FREEMEMORY><![CDATA[16777216]]></FREEMEMORY>
|
||||
<HOSTNAME><![CDATA[localhost]]></HOSTNAME>
|
||||
<HYPERVISOR><![CDATA[dummy]]></HYPERVISOR>
|
||||
<TEST><![CDATA[TEST]]></TEST>
|
||||
<TOTALCPU><![CDATA[800]]></TOTALCPU>
|
||||
<TOTALMEMORY><![CDATA[16777216]]></TOTALMEMORY>
|
||||
<USEDCPU><![CDATA[0]]></USEDCPU>
|
||||
<USEDMEMORY><![CDATA[0]]></USEDMEMORY>
|
||||
</TEMPLATE>
|
||||
</HOST>
|
||||
<HOST>
|
||||
<ID>1</ID>
|
||||
<NAME>vm</NAME>
|
||||
<STATE>0</STATE>
|
||||
<IM_MAD>im_dummy</IM_MAD>
|
||||
<VM_MAD>vmm_dummy</VM_MAD>
|
||||
<VN_MAD>fw</VN_MAD>
|
||||
<TM_MAD>tm_shared</TM_MAD>
|
||||
<LAST_MON_TIME>0</LAST_MON_TIME>
|
||||
<HOST_SHARE>
|
||||
<DISK_USAGE>0</DISK_USAGE>
|
||||
<MEM_USAGE>0</MEM_USAGE>
|
||||
<CPU_USAGE>0</CPU_USAGE>
|
||||
<MAX_DISK>0</MAX_DISK>
|
||||
<MAX_MEM>0</MAX_MEM>
|
||||
<MAX_CPU>0</MAX_CPU>
|
||||
<FREE_DISK>0</FREE_DISK>
|
||||
<FREE_MEM>0</FREE_MEM>
|
||||
<FREE_CPU>0</FREE_CPU>
|
||||
<USED_DISK>0</USED_DISK>
|
||||
<USED_MEM>0</USED_MEM>
|
||||
<USED_CPU>0</USED_CPU>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
</HOST_SHARE>
|
||||
<TEMPLATE/>
|
||||
</HOST>
|
||||
</HOST_POOL>
|
||||
@@ -0,0 +1,3 @@
|
||||
<HOST_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../host_pool.xsd"/>
|
||||
@@ -0,0 +1,23 @@
|
||||
<IMAGE xmlns="http://opennebula.org/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../image.xsd">
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>Ubuntu Desktop</NAME>
|
||||
<TYPE>0</TYPE>
|
||||
<PUBLIC>1</PUBLIC>
|
||||
<PERSISTENT>0</PERSISTENT>
|
||||
<REGTIME>1324047583</REGTIME>
|
||||
<SOURCE>/var/lib/one/images/590815350477644ac13f7800f6a6789c</SOURCE>
|
||||
<PATH>/boot/initrd.img-2.6.32-34-generic</PATH>
|
||||
<FSTYPE/>
|
||||
<SIZE>8</SIZE>
|
||||
<STATE>1</STATE>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
<TEMPLATE>
|
||||
<DESCRIPTION><![CDATA[Ubuntu 10.04 desktop for students.]]></DESCRIPTION>
|
||||
<DEV_PREFIX><![CDATA[hd]]></DEV_PREFIX>
|
||||
</TEMPLATE>
|
||||
</IMAGE>
|
||||
@@ -0,0 +1,22 @@
|
||||
<IMAGE xmlns="http://opennebula.org/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../image.xsd">
|
||||
<ID>1</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>Experiment results</NAME>
|
||||
<TYPE>2</TYPE>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<PERSISTENT>0</PERSISTENT>
|
||||
<REGTIME>1324048803</REGTIME>
|
||||
<SOURCE>/var/lib/one/images/5a785bd223a970ec3536733514f2c3db</SOURCE>
|
||||
<PATH/>
|
||||
<FSTYPE>ext3</FSTYPE>
|
||||
<SIZE>30</SIZE>
|
||||
<STATE>1</STATE>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
<TEMPLATE>
|
||||
<DEV_PREFIX><![CDATA[hd]]></DEV_PREFIX>
|
||||
</TEMPLATE>
|
||||
</IMAGE>
|
||||
@@ -0,0 +1,3 @@
|
||||
<IMAGE_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../image_pool.xsd"/>
|
||||
@@ -0,0 +1,47 @@
|
||||
<IMAGE_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../image_pool.xsd">
|
||||
<IMAGE>
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>Ubuntu Desktop</NAME>
|
||||
<TYPE>0</TYPE>
|
||||
<PUBLIC>1</PUBLIC>
|
||||
<PERSISTENT>0</PERSISTENT>
|
||||
<REGTIME>1324047583</REGTIME>
|
||||
<SOURCE>/var/lib/one/images/590815350477644ac13f7800f6a6789c</SOURCE>
|
||||
<PATH>/boot/initrd.img-2.6.32-34-generic</PATH>
|
||||
<FSTYPE/>
|
||||
<SIZE>8</SIZE>
|
||||
<STATE>1</STATE>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
<TEMPLATE>
|
||||
<DESCRIPTION><![CDATA[Ubuntu 10.04 desktop for students.]]></DESCRIPTION>
|
||||
<DEV_PREFIX><![CDATA[hd]]></DEV_PREFIX>
|
||||
</TEMPLATE>
|
||||
</IMAGE>
|
||||
<IMAGE>
|
||||
<ID>1</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>Experiment results</NAME>
|
||||
<TYPE>2</TYPE>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<PERSISTENT>0</PERSISTENT>
|
||||
<REGTIME>1324048803</REGTIME>
|
||||
<SOURCE>/var/lib/one/images/5a785bd223a970ec3536733514f2c3db</SOURCE>
|
||||
<PATH/>
|
||||
<FSTYPE>ext3</FSTYPE>
|
||||
<SIZE>30</SIZE>
|
||||
<STATE>1</STATE>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
<TEMPLATE>
|
||||
<DEV_PREFIX><![CDATA[hd]]></DEV_PREFIX>
|
||||
</TEMPLATE>
|
||||
</IMAGE>
|
||||
</IMAGE_POOL>
|
||||
@@ -0,0 +1,25 @@
|
||||
<IMAGE_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../image_pool.xsd">
|
||||
<IMAGE>
|
||||
<ID>1</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>Experiment results</NAME>
|
||||
<TYPE>2</TYPE>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<PERSISTENT>0</PERSISTENT>
|
||||
<REGTIME>1324048803</REGTIME>
|
||||
<SOURCE>/var/lib/one/images/5a785bd223a970ec3536733514f2c3db</SOURCE>
|
||||
<PATH/>
|
||||
<FSTYPE>ext3</FSTYPE>
|
||||
<SIZE>30</SIZE>
|
||||
<STATE>1</STATE>
|
||||
<RUNNING_VMS>0</RUNNING_VMS>
|
||||
<TEMPLATE>
|
||||
<DEV_PREFIX><![CDATA[hd]]></DEV_PREFIX>
|
||||
</TEMPLATE>
|
||||
</IMAGE>
|
||||
</IMAGE_POOL>
|
||||
@@ -0,0 +1,16 @@
|
||||
<VMTEMPLATE xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../template.xsd">
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>vm-example</NAME>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<REGTIME>1324050180</REGTIME>
|
||||
<TEMPLATE>
|
||||
<NAME><![CDATA[vm-example]]></NAME>
|
||||
<TEMPLATE_ID><![CDATA[0]]></TEMPLATE_ID>
|
||||
</TEMPLATE>
|
||||
</VMTEMPLATE>
|
||||
@@ -0,0 +1,16 @@
|
||||
<VMTEMPLATE xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../template.xsd">
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>vm-example</NAME>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<REGTIME>1324050180</REGTIME>
|
||||
<TEMPLATE>
|
||||
<NEW_ATT><![CDATA[NEW]]></NEW_ATT>
|
||||
<NEW_NUM><![CDATA[123]]></NEW_NUM>
|
||||
</TEMPLATE>
|
||||
</VMTEMPLATE>
|
||||
@@ -0,0 +1,13 @@
|
||||
<VMTEMPLATE xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../template.xsd">
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>vm-example</NAME>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<REGTIME>1324050180</REGTIME>
|
||||
<TEMPLATE/>
|
||||
</VMTEMPLATE>
|
||||
@@ -0,0 +1,35 @@
|
||||
<VMTEMPLATE_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../template_pool.xsd">
|
||||
<VMTEMPLATE>
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>vm-example</NAME>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<REGTIME>1324050180</REGTIME>
|
||||
<TEMPLATE>
|
||||
<NEW_ATT><![CDATA[NEW]]></NEW_ATT>
|
||||
<NEW_NUM><![CDATA[123]]></NEW_NUM>
|
||||
</TEMPLATE>
|
||||
</VMTEMPLATE>
|
||||
<VMTEMPLATE>
|
||||
<ID>1</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>ONE</NAME>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<REGTIME>1324050461</REGTIME>
|
||||
<TEMPLATE>
|
||||
<DISK>
|
||||
<IMAGE_ID><![CDATA[0]]></IMAGE_ID>
|
||||
</DISK>
|
||||
<NAME><![CDATA[ONE]]></NAME>
|
||||
<TEMPLATE_ID><![CDATA[1]]></TEMPLATE_ID>
|
||||
</TEMPLATE>
|
||||
</VMTEMPLATE>
|
||||
</VMTEMPLATE_POOL>
|
||||
@@ -0,0 +1,3 @@
|
||||
<VMTEMPLATE_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../template_pool.xsd"/>
|
||||
@@ -0,0 +1,12 @@
|
||||
<USER xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../user.xsd">
|
||||
<ID>1</ID>
|
||||
<GID>0</GID>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>serveradmin</NAME>
|
||||
<PASSWORD>f72281eda1b97393f46041288b0baea528483b51</PASSWORD>
|
||||
<AUTH_DRIVER>server_cipher</AUTH_DRIVER>
|
||||
<ENABLED>1</ENABLED>
|
||||
<TEMPLATE/>
|
||||
</USER>
|
||||
@@ -0,0 +1,12 @@
|
||||
<USER xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../user.xsd">
|
||||
<ID>2</ID>
|
||||
<GID>1</GID>
|
||||
<GNAME>users</GNAME>
|
||||
<NAME>abc</NAME>
|
||||
<PASSWORD>a9993e364706816aba3e25717850c26c9cd0d89d</PASSWORD>
|
||||
<AUTH_DRIVER>core</AUTH_DRIVER>
|
||||
<ENABLED>1</ENABLED>
|
||||
<TEMPLATE/>
|
||||
</USER>
|
||||
@@ -0,0 +1,21 @@
|
||||
<USER xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../user.xsd">
|
||||
<ID>3</ID>
|
||||
<GID>1</GID>
|
||||
<GNAME>users</GNAME>
|
||||
<NAME>1234</NAME>
|
||||
<PASSWORD>7110eda4d09e062aa5e4a390b0a572ac0d2c0220</PASSWORD>
|
||||
<AUTH_DRIVER>core</AUTH_DRIVER>
|
||||
<ENABLED>1</ENABLED>
|
||||
<TEMPLATE>
|
||||
<ATT><![CDATA[OTHER VALUE]]></ATT>
|
||||
<COMPLEX>
|
||||
<ATT1><![CDATA[VAL1]]></ATT1>
|
||||
<ATT2><![CDATA[VAL2]]></ATT2>
|
||||
<NUM3><![CDATA[3]]></NUM3>
|
||||
</COMPLEX>
|
||||
<EXTRA><![CDATA[VALUE]]></EXTRA>
|
||||
<NUM><![CDATA[123]]></NUM>
|
||||
</TEMPLATE>
|
||||
</USER>
|
||||
@@ -0,0 +1,53 @@
|
||||
<USER_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../user_pool.xsd">
|
||||
<USER>
|
||||
<ID>0</ID>
|
||||
<GID>0</GID>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>oneadmin</NAME>
|
||||
<PASSWORD>f72281eda1b97393f46041288b0baea528483b51</PASSWORD>
|
||||
<AUTH_DRIVER>core</AUTH_DRIVER>
|
||||
<ENABLED>1</ENABLED>
|
||||
<TEMPLATE/>
|
||||
</USER>
|
||||
<USER>
|
||||
<ID>1</ID>
|
||||
<GID>0</GID>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>serveradmin</NAME>
|
||||
<PASSWORD>f72281eda1b97393f46041288b0baea528483b51</PASSWORD>
|
||||
<AUTH_DRIVER>server_cipher</AUTH_DRIVER>
|
||||
<ENABLED>1</ENABLED>
|
||||
<TEMPLATE/>
|
||||
</USER>
|
||||
<USER>
|
||||
<ID>2</ID>
|
||||
<GID>1</GID>
|
||||
<GNAME>users</GNAME>
|
||||
<NAME>abc</NAME>
|
||||
<PASSWORD>a9993e364706816aba3e25717850c26c9cd0d89d</PASSWORD>
|
||||
<AUTH_DRIVER>core</AUTH_DRIVER>
|
||||
<ENABLED>1</ENABLED>
|
||||
<TEMPLATE/>
|
||||
</USER>
|
||||
<USER>
|
||||
<ID>3</ID>
|
||||
<GID>1</GID>
|
||||
<GNAME>users</GNAME>
|
||||
<NAME>1234</NAME>
|
||||
<PASSWORD>7110eda4d09e062aa5e4a390b0a572ac0d2c0220</PASSWORD>
|
||||
<AUTH_DRIVER>core</AUTH_DRIVER>
|
||||
<ENABLED>1</ENABLED>
|
||||
<TEMPLATE>
|
||||
<ATT><![CDATA[OTHER VALUE]]></ATT>
|
||||
<COMPLEX>
|
||||
<ATT1><![CDATA[VAL1]]></ATT1>
|
||||
<ATT2><![CDATA[VAL2]]></ATT2>
|
||||
<NUM3><![CDATA[3]]></NUM3>
|
||||
</COMPLEX>
|
||||
<EXTRA><![CDATA[VALUE]]></EXTRA>
|
||||
<NUM><![CDATA[123]]></NUM>
|
||||
</TEMPLATE>
|
||||
</USER>
|
||||
</USER_POOL>
|
||||
@@ -0,0 +1,26 @@
|
||||
<VM xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vm.xsd">
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>one-0</NAME>
|
||||
<LAST_POLL>0</LAST_POLL>
|
||||
<STATE>1</STATE>
|
||||
<LCM_STATE>0</LCM_STATE>
|
||||
<STIME>1324050700</STIME>
|
||||
<ETIME>0</ETIME>
|
||||
<DEPLOY_ID/>
|
||||
<MEMORY>0</MEMORY>
|
||||
<CPU>0</CPU>
|
||||
<NET_TX>0</NET_TX>
|
||||
<NET_RX>0</NET_RX>
|
||||
<TEMPLATE>
|
||||
<NAME><![CDATA[one-0]]></NAME>
|
||||
<TEMPLATE_ID><![CDATA[2]]></TEMPLATE_ID>
|
||||
<VMID><![CDATA[0]]></VMID>
|
||||
</TEMPLATE>
|
||||
<HISTORY_RECORDS/>
|
||||
</VM>
|
||||
@@ -0,0 +1,81 @@
|
||||
<VM xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vm.xsd">
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>one-0</NAME>
|
||||
<LAST_POLL>1324050881</LAST_POLL>
|
||||
<STATE>3</STATE>
|
||||
<LCM_STATE>3</LCM_STATE>
|
||||
<STIME>1324050700</STIME>
|
||||
<ETIME>0</ETIME>
|
||||
<DEPLOY_ID>vm:one-0:dummy</DEPLOY_ID>
|
||||
<MEMORY>0</MEMORY>
|
||||
<CPU>0</CPU>
|
||||
<NET_TX>0</NET_TX>
|
||||
<NET_RX>0</NET_RX>
|
||||
<TEMPLATE>
|
||||
<NAME><![CDATA[one-0]]></NAME>
|
||||
<TEMPLATE_ID><![CDATA[2]]></TEMPLATE_ID>
|
||||
<VMID><![CDATA[0]]></VMID>
|
||||
</TEMPLATE>
|
||||
<HISTORY_RECORDS>
|
||||
<HISTORY>
|
||||
<SEQ>0</SEQ>
|
||||
<HOSTNAME>vm</HOSTNAME>
|
||||
<VM_DIR>/var/lib/one/</VM_DIR>
|
||||
<HID>1</HID>
|
||||
<STIME>1324050881</STIME>
|
||||
<ETIME>1324050891</ETIME>
|
||||
<VMMMAD>vmm_dummy</VMMMAD>
|
||||
<VNMMAD>fw</VNMMAD>
|
||||
<TMMAD>tm_shared</TMMAD>
|
||||
<PSTIME>1324050881</PSTIME>
|
||||
<PETIME>1324050881</PETIME>
|
||||
<RSTIME>1324050881</RSTIME>
|
||||
<RETIME>1324050891</RETIME>
|
||||
<ESTIME>0</ESTIME>
|
||||
<EETIME>0</EETIME>
|
||||
<REASON>3</REASON>
|
||||
</HISTORY>
|
||||
<HISTORY>
|
||||
<SEQ>1</SEQ>
|
||||
<HOSTNAME>localhost</HOSTNAME>
|
||||
<VM_DIR>/var/lib/one/</VM_DIR>
|
||||
<HID>0</HID>
|
||||
<STIME>1324050891</STIME>
|
||||
<ETIME>1324050899</ETIME>
|
||||
<VMMMAD>vmm_dummy</VMMMAD>
|
||||
<VNMMAD>fw</VNMMAD>
|
||||
<TMMAD>tm_shared</TMMAD>
|
||||
<PSTIME>1324050891</PSTIME>
|
||||
<PETIME>1324050892</PETIME>
|
||||
<RSTIME>1324050892</RSTIME>
|
||||
<RETIME>1324050899</RETIME>
|
||||
<ESTIME>0</ESTIME>
|
||||
<EETIME>0</EETIME>
|
||||
<REASON>3</REASON>
|
||||
</HISTORY>
|
||||
<HISTORY>
|
||||
<SEQ>2</SEQ>
|
||||
<HOSTNAME>localhost</HOSTNAME>
|
||||
<VM_DIR>/var/lib/one/</VM_DIR>
|
||||
<HID>0</HID>
|
||||
<STIME>1324050899</STIME>
|
||||
<ETIME>0</ETIME>
|
||||
<VMMMAD>vmm_dummy</VMMMAD>
|
||||
<VNMMAD>fw</VNMMAD>
|
||||
<TMMAD>tm_shared</TMMAD>
|
||||
<PSTIME>0</PSTIME>
|
||||
<PETIME>0</PETIME>
|
||||
<RSTIME>1324050899</RSTIME>
|
||||
<RETIME>0</RETIME>
|
||||
<ESTIME>0</ESTIME>
|
||||
<EETIME>0</EETIME>
|
||||
<REASON>0</REASON>
|
||||
</HISTORY>
|
||||
</HISTORY_RECORDS>
|
||||
</VM>
|
||||
@@ -0,0 +1,81 @@
|
||||
<VM xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vm.xsd">
|
||||
<ID>3</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>one-3</NAME>
|
||||
<LAST_POLL>1324052447</LAST_POLL>
|
||||
<STATE>6</STATE>
|
||||
<LCM_STATE>0</LCM_STATE>
|
||||
<STIME>1324052427</STIME>
|
||||
<ETIME>1324052465</ETIME>
|
||||
<DEPLOY_ID>localhost:one-3:dummy</DEPLOY_ID>
|
||||
<MEMORY>0</MEMORY>
|
||||
<CPU>0</CPU>
|
||||
<NET_TX>0</NET_TX>
|
||||
<NET_RX>0</NET_RX>
|
||||
<TEMPLATE>
|
||||
<NAME><![CDATA[one-3]]></NAME>
|
||||
<TEMPLATE_ID><![CDATA[2]]></TEMPLATE_ID>
|
||||
<VMID><![CDATA[3]]></VMID>
|
||||
</TEMPLATE>
|
||||
<HISTORY_RECORDS>
|
||||
<HISTORY>
|
||||
<SEQ>0</SEQ>
|
||||
<HOSTNAME>localhost</HOSTNAME>
|
||||
<VM_DIR>/var/lib/one/</VM_DIR>
|
||||
<HID>0</HID>
|
||||
<STIME>1324052447</STIME>
|
||||
<ETIME>1324052452</ETIME>
|
||||
<VMMMAD>vmm_dummy</VMMMAD>
|
||||
<VNMMAD>fw</VNMMAD>
|
||||
<TMMAD>tm_shared</TMMAD>
|
||||
<PSTIME>1324052447</PSTIME>
|
||||
<PETIME>1324052447</PETIME>
|
||||
<RSTIME>1324052447</RSTIME>
|
||||
<RETIME>1324052452</RETIME>
|
||||
<ESTIME>0</ESTIME>
|
||||
<EETIME>0</EETIME>
|
||||
<REASON>3</REASON>
|
||||
</HISTORY>
|
||||
<HISTORY>
|
||||
<SEQ>1</SEQ>
|
||||
<HOSTNAME>vm</HOSTNAME>
|
||||
<VM_DIR>/var/lib/one/</VM_DIR>
|
||||
<HID>1</HID>
|
||||
<STIME>1324052452</STIME>
|
||||
<ETIME>1324052456</ETIME>
|
||||
<VMMMAD>vmm_dummy</VMMMAD>
|
||||
<VNMMAD>fw</VNMMAD>
|
||||
<TMMAD>tm_shared</TMMAD>
|
||||
<PSTIME>1324052452</PSTIME>
|
||||
<PETIME>1324052452</PETIME>
|
||||
<RSTIME>1324052452</RSTIME>
|
||||
<RETIME>1324052456</RETIME>
|
||||
<ESTIME>0</ESTIME>
|
||||
<EETIME>0</EETIME>
|
||||
<REASON>3</REASON>
|
||||
</HISTORY>
|
||||
<HISTORY>
|
||||
<SEQ>2</SEQ>
|
||||
<HOSTNAME>localhost</HOSTNAME>
|
||||
<VM_DIR>/var/lib/one/</VM_DIR>
|
||||
<HID>0</HID>
|
||||
<STIME>1324052456</STIME>
|
||||
<ETIME>1324052465</ETIME>
|
||||
<VMMMAD>vmm_dummy</VMMMAD>
|
||||
<VNMMAD>fw</VNMMAD>
|
||||
<TMMAD>tm_shared</TMMAD>
|
||||
<PSTIME>1324052456</PSTIME>
|
||||
<PETIME>1324052456</PETIME>
|
||||
<RSTIME>1324052456</RSTIME>
|
||||
<RETIME>1324052465</RETIME>
|
||||
<ESTIME>1324052465</ESTIME>
|
||||
<EETIME>1324052465</EETIME>
|
||||
<REASON>4</REASON>
|
||||
</HISTORY>
|
||||
</HISTORY_RECORDS>
|
||||
</VM>
|
||||
@@ -0,0 +1,161 @@
|
||||
<VM_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vm_pool.xsd">
|
||||
<VM>
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>one-0</NAME>
|
||||
<LAST_POLL>1324052091</LAST_POLL>
|
||||
<STATE>3</STATE>
|
||||
<LCM_STATE>3</LCM_STATE>
|
||||
<STIME>1324050700</STIME>
|
||||
<ETIME>0</ETIME>
|
||||
<DEPLOY_ID>vm:one-0:dummy</DEPLOY_ID>
|
||||
<MEMORY>0</MEMORY>
|
||||
<CPU>0</CPU>
|
||||
<NET_TX>12345</NET_TX>
|
||||
<NET_RX>0</NET_RX>
|
||||
<TEMPLATE>
|
||||
<NAME><![CDATA[one-0]]></NAME>
|
||||
<TEMPLATE_ID><![CDATA[2]]></TEMPLATE_ID>
|
||||
<VMID><![CDATA[0]]></VMID>
|
||||
</TEMPLATE>
|
||||
<HISTORY_RECORDS>
|
||||
<HISTORY>
|
||||
<SEQ>2</SEQ>
|
||||
<HOSTNAME>localhost</HOSTNAME>
|
||||
<VM_DIR>/var/lib/one/</VM_DIR>
|
||||
<HID>0</HID>
|
||||
<STIME>1324050899</STIME>
|
||||
<ETIME>0</ETIME>
|
||||
<VMMMAD>vmm_dummy</VMMMAD>
|
||||
<VNMMAD>fw</VNMMAD>
|
||||
<TMMAD>tm_shared</TMMAD>
|
||||
<PSTIME>0</PSTIME>
|
||||
<PETIME>0</PETIME>
|
||||
<RSTIME>1324050899</RSTIME>
|
||||
<RETIME>0</RETIME>
|
||||
<ESTIME>0</ESTIME>
|
||||
<EETIME>0</EETIME>
|
||||
<REASON>0</REASON>
|
||||
</HISTORY>
|
||||
</HISTORY_RECORDS>
|
||||
</VM>
|
||||
<VM>
|
||||
<ID>1</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>one-1</NAME>
|
||||
<LAST_POLL>0</LAST_POLL>
|
||||
<STATE>1</STATE>
|
||||
<LCM_STATE>0</LCM_STATE>
|
||||
<STIME>1324052403</STIME>
|
||||
<ETIME>0</ETIME>
|
||||
<DEPLOY_ID/>
|
||||
<MEMORY>0</MEMORY>
|
||||
<CPU>0</CPU>
|
||||
<NET_TX>0</NET_TX>
|
||||
<NET_RX>0</NET_RX>
|
||||
<TEMPLATE>
|
||||
<NAME><![CDATA[one-1]]></NAME>
|
||||
<TEMPLATE_ID><![CDATA[2]]></TEMPLATE_ID>
|
||||
<VMID><![CDATA[1]]></VMID>
|
||||
</TEMPLATE>
|
||||
<HISTORY_RECORDS/>
|
||||
</VM>
|
||||
<VM>
|
||||
<ID>2</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>one-2</NAME>
|
||||
<LAST_POLL>1324052436</LAST_POLL>
|
||||
<STATE>3</STATE>
|
||||
<LCM_STATE>3</LCM_STATE>
|
||||
<STIME>1324052411</STIME>
|
||||
<ETIME>0</ETIME>
|
||||
<DEPLOY_ID>vm:one-2:dummy</DEPLOY_ID>
|
||||
<MEMORY>0</MEMORY>
|
||||
<CPU>0</CPU>
|
||||
<NET_TX>0</NET_TX>
|
||||
<NET_RX>0</NET_RX>
|
||||
<TEMPLATE>
|
||||
<NAME><![CDATA[one-2]]></NAME>
|
||||
<TEMPLATE_ID><![CDATA[2]]></TEMPLATE_ID>
|
||||
<VMID><![CDATA[2]]></VMID>
|
||||
</TEMPLATE>
|
||||
<HISTORY_RECORDS>
|
||||
<HISTORY>
|
||||
<SEQ>0</SEQ>
|
||||
<HOSTNAME>vm</HOSTNAME>
|
||||
<VM_DIR>/var/lib/one/</VM_DIR>
|
||||
<HID>1</HID>
|
||||
<STIME>1324052436</STIME>
|
||||
<ETIME>0</ETIME>
|
||||
<VMMMAD>vmm_dummy</VMMMAD>
|
||||
<VNMMAD>fw</VNMMAD>
|
||||
<TMMAD>tm_shared</TMMAD>
|
||||
<PSTIME>1324052436</PSTIME>
|
||||
<PETIME>1324052436</PETIME>
|
||||
<RSTIME>1324052436</RSTIME>
|
||||
<RETIME>0</RETIME>
|
||||
<ESTIME>0</ESTIME>
|
||||
<EETIME>0</EETIME>
|
||||
<REASON>0</REASON>
|
||||
</HISTORY>
|
||||
</HISTORY_RECORDS>
|
||||
</VM>
|
||||
<VM>
|
||||
<ID>4</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>one-4</NAME>
|
||||
<LAST_POLL>1324052488</LAST_POLL>
|
||||
<STATE>7</STATE>
|
||||
<LCM_STATE>0</LCM_STATE>
|
||||
<STIME>1324052484</STIME>
|
||||
<ETIME>1324052510</ETIME>
|
||||
<DEPLOY_ID>localhost:one-4:dummy</DEPLOY_ID>
|
||||
<MEMORY>0</MEMORY>
|
||||
<CPU>0</CPU>
|
||||
<NET_TX>0</NET_TX>
|
||||
<NET_RX>0</NET_RX>
|
||||
<TEMPLATE>
|
||||
<ERROR>
|
||||
<MESSAGE><![CDATA[Error excuting image transfer script: Could not move /var/lib/one//4/images to /var/lib/one/4]]></MESSAGE>
|
||||
<TIMESTAMP><![CDATA[Fri Dec 16 08:21:50 2011]]></TIMESTAMP>
|
||||
</ERROR>
|
||||
<NAME><![CDATA[one-4]]></NAME>
|
||||
<TEMPLATE_ID><![CDATA[2]]></TEMPLATE_ID>
|
||||
<VMID><![CDATA[4]]></VMID>
|
||||
</TEMPLATE>
|
||||
<HISTORY_RECORDS>
|
||||
<HISTORY>
|
||||
<SEQ>2</SEQ>
|
||||
<HOSTNAME>vm</HOSTNAME>
|
||||
<VM_DIR>/var/lib/one/</VM_DIR>
|
||||
<HID>1</HID>
|
||||
<STIME>1324052502</STIME>
|
||||
<ETIME>1324052510</ETIME>
|
||||
<VMMMAD>vmm_dummy</VMMMAD>
|
||||
<VNMMAD>fw</VNMMAD>
|
||||
<TMMAD>tm_shared</TMMAD>
|
||||
<PSTIME>1324052502</PSTIME>
|
||||
<PETIME>1324052502</PETIME>
|
||||
<RSTIME>1324052502</RSTIME>
|
||||
<RETIME>1324052510</RETIME>
|
||||
<ESTIME>1324052510</ESTIME>
|
||||
<EETIME>1324052510</EETIME>
|
||||
<REASON>1</REASON>
|
||||
</HISTORY>
|
||||
</HISTORY_RECORDS>
|
||||
</VM>
|
||||
</VM_POOL>
|
||||
@@ -0,0 +1,3 @@
|
||||
<VM_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vm_pool.xsd"/>
|
||||
@@ -0,0 +1,48 @@
|
||||
<VNET xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vnet.xsd">
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>Blue LAN</NAME>
|
||||
<TYPE>1</TYPE>
|
||||
<BRIDGE>vbr1</BRIDGE>
|
||||
<VLAN>0</VLAN>
|
||||
<PHYDEV/>
|
||||
<VLAN_ID/>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<TOTAL_LEASES>0</TOTAL_LEASES>
|
||||
<TEMPLATE>
|
||||
<DNS><![CDATA[130.10.0.1]]></DNS>
|
||||
<GATEWAY><![CDATA[130.10.0.1]]></GATEWAY>
|
||||
<LOAD_BALANCER><![CDATA[130.10.0.4]]></LOAD_BALANCER>
|
||||
</TEMPLATE>
|
||||
<LEASES>
|
||||
<LEASE>
|
||||
<IP>130.10.0.1</IP>
|
||||
<MAC>02:00:82:0a:00:01</MAC>
|
||||
<USED>0</USED>
|
||||
<VID>-1</VID>
|
||||
</LEASE>
|
||||
<LEASE>
|
||||
<IP>130.10.0.2</IP>
|
||||
<MAC>50:20:20:20:20:21</MAC>
|
||||
<USED>0</USED>
|
||||
<VID>-1</VID>
|
||||
</LEASE>
|
||||
<LEASE>
|
||||
<IP>130.10.0.3</IP>
|
||||
<MAC>02:00:82:0a:00:03</MAC>
|
||||
<USED>0</USED>
|
||||
<VID>-1</VID>
|
||||
</LEASE>
|
||||
<LEASE>
|
||||
<IP>130.10.0.4</IP>
|
||||
<MAC>02:00:82:0a:00:04</MAC>
|
||||
<USED>0</USED>
|
||||
<VID>-1</VID>
|
||||
</LEASE>
|
||||
</LEASES>
|
||||
</VNET>
|
||||
@@ -0,0 +1,26 @@
|
||||
<VNET xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vnet.xsd">
|
||||
<ID>1</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>R</NAME>
|
||||
<TYPE>0</TYPE>
|
||||
<BRIDGE>vbr0</BRIDGE>
|
||||
<VLAN>0</VLAN>
|
||||
<PHYDEV/>
|
||||
<VLAN_ID/>
|
||||
<RANGE>
|
||||
<IP_START>10.10.10.1</IP_START>
|
||||
<IP_END>10.10.10.254</IP_END>
|
||||
</RANGE>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<TOTAL_LEASES>0</TOTAL_LEASES>
|
||||
<TEMPLATE>
|
||||
<CUSTOM><![CDATA[CARLOS]]></CUSTOM>
|
||||
<NETWORK_MASK><![CDATA[255.255.255.0]]></NETWORK_MASK>
|
||||
</TEMPLATE>
|
||||
<LEASES/>
|
||||
</VNET>
|
||||
@@ -0,0 +1,23 @@
|
||||
<VNET xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vnet.xsd">
|
||||
<ID>3</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>Empty</NAME>
|
||||
<TYPE>1</TYPE>
|
||||
<BRIDGE>vbr1</BRIDGE>
|
||||
<VLAN>1</VLAN>
|
||||
<PHYDEV>eth0</PHYDEV>
|
||||
<VLAN_ID>34</VLAN_ID>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<TOTAL_LEASES>0</TOTAL_LEASES>
|
||||
<TEMPLATE>
|
||||
<DNS><![CDATA[130.10.0.1]]></DNS>
|
||||
<GATEWAY><![CDATA[130.10.0.1]]></GATEWAY>
|
||||
<LOAD_BALANCER><![CDATA[130.10.0.4]]></LOAD_BALANCER>
|
||||
</TEMPLATE>
|
||||
<LEASES/>
|
||||
</VNET>
|
||||
@@ -0,0 +1,3 @@
|
||||
<VNET_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vnet_pool.xsd"/>
|
||||
@@ -0,0 +1,63 @@
|
||||
<VNET_POOL xmlns="http://opennebula.org/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://opennebula.org/XMLSchema ../../vnet_pool.xsd">
|
||||
<VNET>
|
||||
<ID>0</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>Blue LAN</NAME>
|
||||
<TYPE>1</TYPE>
|
||||
<BRIDGE>vbr1</BRIDGE>
|
||||
<VLAN>0</VLAN>
|
||||
<PHYDEV/>
|
||||
<VLAN_ID/>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<TOTAL_LEASES>0</TOTAL_LEASES>
|
||||
<TEMPLATE/>
|
||||
</VNET>
|
||||
<VNET>
|
||||
<ID>1</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>R</NAME>
|
||||
<TYPE>0</TYPE>
|
||||
<BRIDGE>vbr0</BRIDGE>
|
||||
<VLAN>0</VLAN>
|
||||
<PHYDEV/>
|
||||
<VLAN_ID/>
|
||||
<RANGE>
|
||||
<IP_START>10.10.10.1</IP_START>
|
||||
<IP_END>10.10.10.254</IP_END>
|
||||
</RANGE>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<TOTAL_LEASES>0</TOTAL_LEASES>
|
||||
<TEMPLATE>
|
||||
<CUSTOM><![CDATA[CARLOS]]></CUSTOM>
|
||||
<NETWORK_MASK><![CDATA[255.255.255.0]]></NETWORK_MASK>
|
||||
</TEMPLATE>
|
||||
</VNET>
|
||||
<VNET>
|
||||
<ID>3</ID>
|
||||
<UID>0</UID>
|
||||
<GID>0</GID>
|
||||
<UNAME>oneadmin</UNAME>
|
||||
<GNAME>oneadmin</GNAME>
|
||||
<NAME>Empty</NAME>
|
||||
<TYPE>1</TYPE>
|
||||
<BRIDGE>vbr1</BRIDGE>
|
||||
<VLAN>1</VLAN>
|
||||
<PHYDEV>eth0</PHYDEV>
|
||||
<VLAN_ID>34</VLAN_ID>
|
||||
<PUBLIC>0</PUBLIC>
|
||||
<TOTAL_LEASES>0</TOTAL_LEASES>
|
||||
<TEMPLATE>
|
||||
<DNS><![CDATA[130.10.0.1]]></DNS>
|
||||
<GATEWAY><![CDATA[130.10.0.1]]></GATEWAY>
|
||||
<LOAD_BALANCER><![CDATA[130.10.0.4]]></LOAD_BALANCER>
|
||||
</TEMPLATE>
|
||||
</VNET>
|
||||
</VNET_POOL>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://opennebula.org/XMLSchema" elementFormDefault="qualified" targetNamespace="http://opennebula.org/XMLSchema">
|
||||
<xs:element name="VMTEMPLATE">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="UID" type="xs:integer"/>
|
||||
<xs:element name="GID" type="xs:integer"/>
|
||||
<xs:element name="UNAME" type="xs:string"/>
|
||||
<xs:element name="GNAME" type="xs:string"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="PUBLIC" type="xs:integer"/>
|
||||
<xs:element name="REGTIME" type="xs:integer"/>
|
||||
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:include schemaLocation="template.xsd"/>
|
||||
<xs:element name="VMTEMPLATE_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
||||
<xs:element ref="VMTEMPLATE" maxOccurs="unbounded" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
|
||||
for i in group_pool group host_pool host image_pool image template_pool template user_pool user vm_pool vm vnet_pool vnet
|
||||
do
|
||||
xmllint --noout --schema $i.xsd samples/$i/*
|
||||
done
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:element name="USER">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="GID" type="xs:integer"/>
|
||||
<xs:element name="GNAME" type="xs:string"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="PASSWORD" type="xs:string"/>
|
||||
<xs:element name="AUTH_DRIVER" type="xs:string"/>
|
||||
<xs:element name="ENABLED" type="xs:integer"/>
|
||||
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:include schemaLocation="user.xsd"/>
|
||||
<xs:element name="USER_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
||||
<xs:element ref="USER" maxOccurs="unbounded" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:element name="VM">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="UID" type="xs:integer"/>
|
||||
<xs:element name="GID" type="xs:integer"/>
|
||||
<xs:element name="UNAME" type="xs:string"/>
|
||||
<xs:element name="GNAME" type="xs:string"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="LAST_POLL" type="xs:integer"/>
|
||||
<xs:element name="STATE" type="xs:integer"/>
|
||||
<xs:element name="LCM_STATE" type="xs:integer"/>
|
||||
<xs:element name="STIME" type="xs:integer"/>
|
||||
<xs:element name="ETIME" type="xs:integer"/>
|
||||
<xs:element name="DEPLOY_ID" type="xs:string"/>
|
||||
<xs:element name="MEMORY" type="xs:integer"/>
|
||||
<xs:element name="CPU" type="xs:integer"/>
|
||||
<xs:element name="NET_TX" type="xs:integer"/>
|
||||
<xs:element name="NET_RX" type="xs:integer"/>
|
||||
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
||||
<xs:element name="HISTORY_RECORDS">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="HISTORY" maxOccurs="unbounded" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="SEQ" type="xs:integer"/>
|
||||
<xs:element name="HOSTNAME" type="xs:string"/>
|
||||
<xs:element name="VM_DIR" type="xs:string"/>
|
||||
<xs:element name="HID" type="xs:integer"/>
|
||||
<xs:element name="STIME" type="xs:integer"/>
|
||||
<xs:element name="ETIME" type="xs:integer"/>
|
||||
<xs:element name="VMMMAD" type="xs:string"/>
|
||||
<xs:element name="VNMMAD" type="xs:string"/>
|
||||
<xs:element name="TMMAD" type="xs:string"/>
|
||||
<xs:element name="PSTIME" type="xs:integer"/>
|
||||
<xs:element name="PETIME" type="xs:integer"/>
|
||||
<xs:element name="RSTIME" type="xs:integer"/>
|
||||
<xs:element name="RETIME" type="xs:integer"/>
|
||||
<xs:element name="ESTIME" type="xs:integer"/>
|
||||
<xs:element name="EETIME" type="xs:integer"/>
|
||||
<xs:element name="REASON" type="xs:integer"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:include schemaLocation="vm.xsd"/>
|
||||
<xs:element name="VM_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
||||
<xs:element ref="VM" maxOccurs="unbounded" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:element name="VNET">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="UID" type="xs:integer"/>
|
||||
<xs:element name="GID" type="xs:integer"/>
|
||||
<xs:element name="UNAME" type="xs:string"/>
|
||||
<xs:element name="GNAME" type="xs:string"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="TYPE" type="xs:integer"/>
|
||||
<xs:element name="BRIDGE" type="xs:string"/>
|
||||
<xs:element name="VLAN" type="xs:integer"/>
|
||||
<xs:element name="PHYDEV" type="xs:string"/>
|
||||
<xs:element name="VLAN_ID" type="xs:string"/>
|
||||
<xs:element name="RANGE" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IP_START" type="xs:string"/>
|
||||
<xs:element name="IP_END" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="PUBLIC" type="xs:integer"/>
|
||||
<xs:element name="TOTAL_LEASES" type="xs:integer"/>
|
||||
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
||||
<xs:element name="LEASES" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence minOccurs="0">
|
||||
<xs:element name="LEASE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IP" type="xs:string"/>
|
||||
<xs:element name="MAC" type="xs:string"/>
|
||||
<xs:element name="USED" type="xs:integer"/>
|
||||
<xs:element name="VID" type="xs:integer"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:include schemaLocation="vnet.xsd"/>
|
||||
<xs:element name="VNET_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
||||
<xs:element ref="VNET" maxOccurs="unbounded" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'pp'
|
||||
|
||||
DEFAULT=%w{optional sunstone quota cloud ozones_server acct}
|
||||
DEFAULT=%w{optional sunstone quota cloud ozones_server acct auth_ldap}
|
||||
|
||||
if defined?(RUBY_VERSION) && RUBY_VERSION>="1.8.7"
|
||||
SQLITE='sqlite3'
|
||||
@@ -31,11 +31,16 @@ GROUPS={
|
||||
:ozones_server_mysql => %w{json data_mapper dm-mysql-adapter mysql},
|
||||
:acct => ['sequel', SQLITE, 'mysql'],
|
||||
:acct_sqlite => ['sequel', SQLITE],
|
||||
:acct_mysql => ['sequel', 'mysql']
|
||||
:acct_mysql => ['sequel', 'mysql'],
|
||||
:auth_ldap => 'net-ldap'
|
||||
}
|
||||
|
||||
PACKAGES=GROUPS.keys
|
||||
|
||||
GEM_TEST={
|
||||
'net-ldap' => 'net/ldap'
|
||||
}
|
||||
|
||||
DISTRIBUTIONS={
|
||||
:debian => {
|
||||
:id => ['Ubuntu', 'Debian'],
|
||||
@@ -95,8 +100,14 @@ def installed_gems
|
||||
end
|
||||
|
||||
def try_library(name, error_message)
|
||||
if GEM_TEST[name.to_s]
|
||||
lib_test=GEM_TEST[name.to_s]
|
||||
else
|
||||
lib_test=name.to_s
|
||||
end
|
||||
|
||||
begin
|
||||
require name.to_s
|
||||
require lib_test
|
||||
rescue LoadError, Exception
|
||||
STDERR.puts error_message
|
||||
exit(-1)
|
||||
|
||||
@@ -82,7 +82,7 @@ class Quota
|
||||
if template['TYPE'] == 'DATABLOCK'
|
||||
template['SIZE'].to_i
|
||||
elsif template['PATH']
|
||||
File.size(template['PATH'])
|
||||
(File.size(template['PATH']).to_f / 2**20).round(2)
|
||||
elsif template['SAVED_VM_ID']
|
||||
vm_id = template['SAVED_VM_ID'].to_i
|
||||
disk_id = template['SAVED_DISK_ID'].to_i
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# This template is processed by the OCCI Server to include specific data for
|
||||
# the VNET, you should not need to modify the ruby code.
|
||||
# You can add common attributes for your VNET templates (e.g. VLAN, PHYDEV)
|
||||
#
|
||||
|
||||
NAME = "<%= @vnet_info['NAME'] %>"
|
||||
TYPE = RANGED
|
||||
|
||||
NETWORK_ADDRESS = <%= @vnet_info['ADDRESS'] %>
|
||||
<% if @vnet_info['SIZE'] != nil %>
|
||||
NETWORK_SIZE = <%= @vnet_info['SIZE']%>
|
||||
<% end %>
|
||||
|
||||
<% if @vnet_info['DESCRIPTION'] != nil %>
|
||||
DESCRIPTION = "<%= @vnet_info['DESCRIPTION'] %>"
|
||||
<% end %>
|
||||
|
||||
<% if @vnet_info['PUBLIC'] != nil %>
|
||||
PUBLIC = "<%= @vnet_info['PUBLIC'] %>"
|
||||
<% end %>
|
||||
|
||||
#BRIDGE = NAME_OF_DEFAULT_BRIDGE
|
||||
#PHYDEV = NAME_OF_PHYSICAL_DEVICE
|
||||
#VLAN = YES|NO
|
||||
@@ -30,7 +30,7 @@ class ImageOCCI < Image
|
||||
<DESCRIPTION><%= self['TEMPLATE/DESCRIPTION'] %></DESCRIPTION>
|
||||
<% end %>
|
||||
<SIZE><%= self['SIZE'] %></SIZE>
|
||||
<% if self['FSTYPE'] != nil %>
|
||||
<% if self['FSTYPE'] != nil and !self['FSTYPE'].empty? %>
|
||||
<FSTYPE><%= self['FSTYPE'] %></FSTYPE>
|
||||
<% end %>
|
||||
<PUBLIC><%= self['PUBLIC'] == "0" ? "NO" : "YES"%></PUBLIC>
|
||||
|
||||
@@ -44,6 +44,9 @@ module DriverExecHelper
|
||||
# dummy paths
|
||||
@remote_scripts_path = File.join(@remote_scripts_base_path, directory)
|
||||
@local_scripts_path = File.join(@local_scripts_base_path, directory)
|
||||
|
||||
# mutex for logging
|
||||
@send_mutex = Mutex.new
|
||||
end
|
||||
|
||||
#
|
||||
@@ -94,6 +97,14 @@ module DriverExecHelper
|
||||
#
|
||||
# METHODS FOR LOGS & COMMAND OUTPUT
|
||||
#
|
||||
# Sends a message to the OpenNebula core through stdout
|
||||
def send_message(action="-", result=RESULT[:failure], id="-", info="-")
|
||||
@send_mutex.synchronize {
|
||||
STDOUT.puts "#{action} #{result} #{id} #{info}"
|
||||
STDOUT.flush
|
||||
}
|
||||
end
|
||||
|
||||
# Sends a log message to ONE. The +message+ can be multiline, it will
|
||||
# be automatically splitted by lines.
|
||||
def log(number, message)
|
||||
|
||||
@@ -57,23 +57,15 @@ class OpenNebulaDriver < ActionManager
|
||||
|
||||
super(@options[:concurrency], @options[:threaded])
|
||||
|
||||
@retries = @options[:retries]
|
||||
@retries = @options[:retries]
|
||||
|
||||
@send_mutex = Mutex.new
|
||||
|
||||
#Set default values
|
||||
initialize_helper(directory, @options)
|
||||
|
||||
register_action(:INIT, method("init"))
|
||||
end
|
||||
|
||||
# Sends a message to the OpenNebula core through stdout
|
||||
def send_message(action="-", result=RESULT[:failure], id="-", info="-")
|
||||
@send_mutex.synchronize {
|
||||
STDOUT.puts "#{action} #{result} #{id} #{info}"
|
||||
STDOUT.flush
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
# Calls remotes or local action checking the action name and
|
||||
# @local_actions. Optional arguments can be specified as a hash
|
||||
|
||||
@@ -46,7 +46,7 @@ module OpenNebula
|
||||
STDERR.puts format_error_message(message)
|
||||
end
|
||||
|
||||
#This function formats an error message for OpenNebula Copyright e
|
||||
#This function formats an error message for OpenNebula
|
||||
def self.format_error_message(message)
|
||||
error_str = "ERROR MESSAGE --8<------\n"
|
||||
error_str << message
|
||||
|
||||
+251
-38
@@ -14,47 +14,260 @@
|
||||
# limitations under the License. #
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
# ---------------------------------------------------------------------------- #
|
||||
# Set up the environment for the driver #
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
ONE_LOCATION = ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION)
|
||||
|
||||
if !ONE_LOCATION
|
||||
BIN_LOCATION = "/usr/bin" if !defined?(BIN_LOCATION)
|
||||
ETC_LOCATION = "/etc/one/" if !defined?(ETC_LOCATION)
|
||||
RUBY_LIB_LOCATION = "/usr/lib/one/ruby" if !defined?(RUBY_LIB_LOCATION)
|
||||
else
|
||||
BIN_LOCATION = ONE_LOCATION + "/bin" if !defined?(BIN_LOCATION)
|
||||
ETC_LOCATION = ONE_LOCATION + "/etc/" if !defined?(ETC_LOCATION)
|
||||
if !defined?(RUBY_LIB_LOCATION)
|
||||
RUBY_LIB_LOCATION = ONE_LOCATION + "/lib/ruby"
|
||||
end
|
||||
end
|
||||
|
||||
$: << RUBY_LIB_LOCATION
|
||||
|
||||
require "OpenNebulaDriver"
|
||||
require "scripts_common"
|
||||
require "CommandManager"
|
||||
|
||||
# Do host sustitution in the libvirt URI
|
||||
LIBVIRT_URI.gsub!('@HOST@', @host)
|
||||
class VmWareDriver
|
||||
# -------------------------------------------------------------------------#
|
||||
# Set up the environment for the driver #
|
||||
# -------------------------------------------------------------------------#
|
||||
ONE_LOCATION = ENV["ONE_LOCATION"]
|
||||
|
||||
# Common functions
|
||||
def perform_action(command)
|
||||
command = BIN_LOCATION + "/tty_expect -u " + USERNAME + " -p " + PASSWORD + " " + command
|
||||
|
||||
action_result = LocalCommand.run(command)
|
||||
|
||||
if action_result.code == 0
|
||||
return action_result.stdout
|
||||
if !ONE_LOCATION
|
||||
BIN_LOCATION = "/usr/bin"
|
||||
LIB_LOCATION = "/usr/lib/one"
|
||||
ETC_LOCATION = "/etc/one/"
|
||||
else
|
||||
log(command, action_result.stderr, action_result.stdout)
|
||||
return action_result.code
|
||||
LIB_LOCATION = ONE_LOCATION + "/lib"
|
||||
BIN_LOCATION = ONE_LOCATION + "/bin"
|
||||
ETC_LOCATION = ONE_LOCATION + "/etc/"
|
||||
end
|
||||
end
|
||||
|
||||
def log(cmd, stdout, stderr)
|
||||
STDERR.puts "[VMWARE] cmd failed [" + cmd +
|
||||
"]. Stderr: " + stderr + ". Stdout: " + stdout
|
||||
end
|
||||
CONF_FILE = ETC_LOCATION + "/vmwarerc"
|
||||
CHECKPOINT = VAR_LOCATION + "/remotes/vmm/vmware/checkpoint"
|
||||
|
||||
ENV['LANG'] = 'C'
|
||||
|
||||
SHUTDOWN_INTERVAL = 5
|
||||
SHUTDOWN_TIMEOUT = 500
|
||||
|
||||
def initialize(host)
|
||||
conf = YAML::load(File.read(CONF_FILE))
|
||||
|
||||
@uri = conf[:libvirt_uri].gsub!('@HOST@', host)
|
||||
@user = conf[:password]
|
||||
@pass = conf[:username]
|
||||
|
||||
end
|
||||
|
||||
# ######################################################################## #
|
||||
# VMWARE DRIVER ACTIONS #
|
||||
# ######################################################################## #
|
||||
|
||||
# ------------------------------------------------------------------------ #
|
||||
# Deploy & define a VM based on its description file #
|
||||
# ------------------------------------------------------------------------ #
|
||||
def deploy(dfile)
|
||||
# Define the VM
|
||||
deploy_id = define_domain(dfile)
|
||||
|
||||
exit -1 if deploy_id.nil?
|
||||
|
||||
# Start the VM
|
||||
rc, info = do_action("virsh -c #{@uri} start #{deploy_id}")
|
||||
|
||||
if rc == false
|
||||
undefine_domain(deploy_id)
|
||||
exit info
|
||||
end
|
||||
|
||||
return deploy_id
|
||||
end
|
||||
|
||||
# ------------------------------------------------------------------------ #
|
||||
# Cancels & undefine the VM #
|
||||
# ------------------------------------------------------------------------ #
|
||||
def cancel(deploy_id)
|
||||
# Destroy the VM
|
||||
rc, info = perform_action("virsh -c #{@uri} destroy #{deploy_id}")
|
||||
|
||||
if rc == false
|
||||
exit info
|
||||
end
|
||||
|
||||
# Undefine the VM
|
||||
exit undefine_domain(deploy_id)
|
||||
end
|
||||
|
||||
# ------------------------------------------------------------------------ #
|
||||
# Migrate #
|
||||
# ------------------------------------------------------------------------ #
|
||||
def migrate
|
||||
OpenNebula.log_error("TBD")
|
||||
exit -1
|
||||
end
|
||||
|
||||
# ------------------------------------------------------------------------ #
|
||||
# Monitor a VM #
|
||||
# ------------------------------------------------------------------------ #
|
||||
def poll(deploy_id)
|
||||
rc, info = do_action("virsh -c #{@uri} --readonly dominfo #{deploy_id}")
|
||||
|
||||
if rc == false
|
||||
puts "STATE=d"
|
||||
exit 0
|
||||
end
|
||||
|
||||
state = ""
|
||||
|
||||
info.split('\n').each{ |line|
|
||||
mdata = line.match("^State: (.*)")
|
||||
|
||||
if mdata
|
||||
state = mdata[1].strip
|
||||
break
|
||||
end
|
||||
}
|
||||
|
||||
case state
|
||||
when "running","blocked","shutdown","dying"
|
||||
state = 'a'
|
||||
when "paused"
|
||||
state = 'p'
|
||||
when "crashed"
|
||||
state = 'c'
|
||||
else
|
||||
state = 'd'
|
||||
end
|
||||
|
||||
return "STATE=#{state_short}"
|
||||
end
|
||||
|
||||
# ------------------------------------------------------------------------ #
|
||||
# Restore a VM from a previously saved checkpoint #
|
||||
# ------------------------------------------------------------------------ #
|
||||
def restore(checkpoint)
|
||||
begin
|
||||
# Define the VM
|
||||
dfile = File.dirname(File.dirname(checkpoint)) + "/deployment.0"
|
||||
rescue => e
|
||||
OpenNebula.log_error("Can not open checkpoint #{e.message}")
|
||||
exit -1
|
||||
end
|
||||
|
||||
deploy_id = define_domain(dfile)
|
||||
|
||||
exit -1 if did.nil?
|
||||
|
||||
# Revert snapshot VM
|
||||
# Note: This assumes the checkpoint name is "checkpoint", to change
|
||||
# this it is needed to change also [1]
|
||||
#
|
||||
# [1] $ONE_LOCATION/lib/remotes/vmm/vmware/checkpoint
|
||||
|
||||
rc, info = do_action(
|
||||
"virsh -c #{@uri} snapshot-revert #{deploy_id} checkpoint")
|
||||
|
||||
exit info if rc == false
|
||||
|
||||
# Delete checkpoint
|
||||
rc, info = do_action(
|
||||
"virsh -c #{@uri} snapshot-delete #{deploy_id} checkpoint")
|
||||
|
||||
OpenNebula.log_error("Could not delete snapshot") if rc == false
|
||||
end
|
||||
|
||||
# ------------------------------------------------------------------------ #
|
||||
# Saves a VM taking a snapshot #
|
||||
# ------------------------------------------------------------------------ #
|
||||
def save(deploy_id)
|
||||
# Take a snapshot for the VM
|
||||
rc, info = do_action(
|
||||
"virsh -c #{@uri} snapshot-create #{deploy_id} #{CHECKPOINT}")
|
||||
|
||||
exit info if rc == false
|
||||
|
||||
# Suspend VM
|
||||
rc, info = do_action("virsh -c #{@uri} suspend #{deploy_id}")
|
||||
|
||||
exit info if rc == false
|
||||
|
||||
# Undefine VM
|
||||
undefine_domain(deploy_id)
|
||||
end
|
||||
|
||||
# ------------------------------------------------------------------------ #
|
||||
# Shutdown a VM #
|
||||
# ------------------------------------------------------------------------ #
|
||||
def shutdown(deploy_id)
|
||||
rc, info = do_action("virsh -c #{@uri} shutdown #{deploy_id}")
|
||||
|
||||
exit info if rc == false
|
||||
|
||||
counter = 0
|
||||
|
||||
begin
|
||||
rc, info = do_action("virsh -c #{@uri} list")
|
||||
info = "" if rc == false
|
||||
|
||||
sleep SHUTDOWN_INTERVAL
|
||||
|
||||
counter = counter + SHUTDOWN_INTERVAL
|
||||
end while info.match(deploy_id) and counter < SHUTDOWN_TIMEOUT
|
||||
|
||||
if counter >= SHUTDOWN_TIMEOUT
|
||||
OpenNebula.error_message(
|
||||
"Timeout reached, VM #{deploy_id} is still alive")
|
||||
exit - 1
|
||||
end
|
||||
|
||||
undefine_domain(deploy_id)
|
||||
end
|
||||
|
||||
# ######################################################################## #
|
||||
# DRIVER HELPER FUNCTIONS #
|
||||
# ######################################################################## #
|
||||
|
||||
private
|
||||
|
||||
#Generates an ESX command using ttyexpect
|
||||
def esx_cmd(command)
|
||||
cmd = BIN_LOCATION
|
||||
cmd << "/tty_expect -u " << @user << " -p " << @pass << " " << command
|
||||
end
|
||||
|
||||
#Performs a action usgin libvirt
|
||||
def do_action(cmd)
|
||||
rc = LocalCommand.run(esx_cmd(command))
|
||||
|
||||
if rc.code = 0
|
||||
return [true, rc.stdout]
|
||||
else
|
||||
err = "Error executing: #{cmd} err: #{rc.stderr} out: #{rc.stdout}"
|
||||
OpenNebula.log_error(err)
|
||||
return [false, rc.code]
|
||||
end
|
||||
end
|
||||
|
||||
# Undefines a domain in the ESX hypervisor
|
||||
def undefine_domain(id)
|
||||
rc, info = do_action("virsh -c #{@uri} undefine #{id}")
|
||||
|
||||
if rc == false
|
||||
OpenNebula.log_error("Error undefining domain #{id}")
|
||||
OpenNebula.log_error("Domain #{id} has to be undefined manually")
|
||||
return info
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
#defines a domain in the ESX hypervisor
|
||||
def define_domain(dfile)
|
||||
deploy_id = nil
|
||||
rc, info = do_action("virsh -c #{@uri} define #{dfile}")
|
||||
|
||||
return nil if rc == false
|
||||
|
||||
data.split('\n').each{ |line|
|
||||
mdata = line.match("Domain (.*) defined from (.*)")
|
||||
|
||||
if mdata
|
||||
deploy_id = mdata[1]
|
||||
break
|
||||
end
|
||||
}
|
||||
|
||||
return deploy_id
|
||||
end
|
||||
end
|
||||
@@ -28,13 +28,42 @@ module Migrator
|
||||
end
|
||||
|
||||
def up
|
||||
puts " > Networking isolation hooks have been moved to Host drivers.\n"<<
|
||||
" If you were using a networking hook, enter its name, or press enter\n"<<
|
||||
" to use the default dummy vn_mad driver.\n\n"
|
||||
print " Driver name (802.1Q, dummy, ebtables, ovswitch): "
|
||||
vn_mad = gets.chomp
|
||||
puts " > Networking isolation hooks have been moved to Host drivers.\n"<<
|
||||
" If you were using a networking hook, enter its name, or press enter\n"<<
|
||||
" to use the default dummy vn_mad driver.\n\n"
|
||||
|
||||
vn_mad = "dummy" if vn_mad.empty?
|
||||
vn_mad = ""
|
||||
|
||||
while !( ["802.1Q", "dummy", "ebtables", "ovswitch", "fw"].include?(vn_mad) ) do
|
||||
print " Driver name (802.1Q, dummy, ebtables, ovswitch, fw): "
|
||||
vn_mad = gets.chomp
|
||||
vn_mad = "dummy" if vn_mad.empty?
|
||||
end
|
||||
|
||||
# 0 = all, 1 = none, 2 = interactive
|
||||
vlan_option = 1
|
||||
|
||||
if ( vn_mad == "ebtables" || vn_mad == "ovswitch" )
|
||||
puts
|
||||
puts " > A new attribute, VLAN = YES/NO will be added to each VNET.\n"<<
|
||||
" For driver '#{vn_mad}', please choose if you want to isolate all networks (all),\n"<<
|
||||
" none (none), or be asked individually for each VNET (interactive)\n"
|
||||
|
||||
vlan = ""
|
||||
while !( ["all", "none", "interactive"].include?(vlan) ) do
|
||||
print " Isolate VNETs (all, none, interactive): "
|
||||
vlan = gets.chomp
|
||||
end
|
||||
|
||||
case vlan
|
||||
when "all"
|
||||
vlan_option = 0
|
||||
when "none"
|
||||
vlan_option = 1
|
||||
when "interactive"
|
||||
vlan_option = 2
|
||||
end
|
||||
end
|
||||
|
||||
# New VN_MAD element for hosts
|
||||
|
||||
@@ -80,7 +109,19 @@ module Migrator
|
||||
net_address = e.text
|
||||
}
|
||||
|
||||
net_address = IPAddr.new(net_address, Socket::AF_INET)
|
||||
net_valid = false
|
||||
while !net_valid do
|
||||
begin
|
||||
net_address = IPAddr.new(net_address, Socket::AF_INET)
|
||||
net_valid = true
|
||||
rescue ArgumentError
|
||||
puts
|
||||
puts " > Error processing VNET ##{row[:oid]} '#{row[:name]}'\n"<<
|
||||
" This network address is invalid: '#{net_address}'\n"
|
||||
print " Please enter a valid network address: "
|
||||
net_address = gets.chomp
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
st_size = ""
|
||||
@@ -98,18 +139,44 @@ module Migrator
|
||||
size = st_size.to_i
|
||||
host_bits = (Math.log(size+2)/Math.log(2)).ceil
|
||||
end
|
||||
|
||||
|
||||
net_mask = 0xFFFFFFFF << host_bits
|
||||
|
||||
net_address = net_address.to_i & net_mask
|
||||
|
||||
ip_start_elem.text = IPAddr.new((ip_start = net_address + 1), Socket::AF_INET).to_s
|
||||
ip_start_elem.text = IPAddr.new((net_address + 1), Socket::AF_INET).to_s
|
||||
ip_end_elem.text = IPAddr.new((net_address + (1 << host_bits) - 2), Socket::AF_INET).to_s
|
||||
end
|
||||
|
||||
# TODO: Set vlan = 1 if PHYDEV is set
|
||||
phydev_present = false
|
||||
doc.root.each_element("PHYDEV") { |e|
|
||||
phydev_present = true
|
||||
}
|
||||
|
||||
vlan_elem = doc.root.add_element("VLAN")
|
||||
vlan_elem.text = "0"
|
||||
|
||||
if phydev_present
|
||||
vlan_elem.text = "1"
|
||||
else
|
||||
case vlan_option
|
||||
when 0
|
||||
vlan_elem.text = "1"
|
||||
when 1
|
||||
vlan_elem.text = "0"
|
||||
when 2
|
||||
vlan = ""
|
||||
while !( ["y", "n"].include?(vlan) ) do
|
||||
print " > Isolate VNET ##{row[:oid]} '#{row[:name]}'? (y/n) : "
|
||||
vlan = gets.chomp
|
||||
end
|
||||
|
||||
if ( vlan == "y" )
|
||||
vlan_elem.text = "1"
|
||||
else
|
||||
vlan_elem.text = "0"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@db[:network_pool].insert(
|
||||
:oid => row[:oid],
|
||||
@@ -122,6 +189,27 @@ module Migrator
|
||||
|
||||
@db.run "DROP TABLE old_network_pool;"
|
||||
|
||||
# Add empty HISTORY_RECORDS element to VMs without any records
|
||||
@db.run "ALTER TABLE vm_pool RENAME TO old_vm_pool;"
|
||||
@db.run "CREATE TABLE vm_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, last_poll INTEGER, state INTEGER, lcm_state INTEGER);"
|
||||
@db.run "INSERT INTO vm_pool SELECT * FROM old_vm_pool;"
|
||||
|
||||
@db.fetch("SELECT * FROM old_vm_pool") do |row|
|
||||
doc = Document.new(row[:body])
|
||||
|
||||
found = false
|
||||
doc.root.each_element("HISTORY_RECORDS") { |e|
|
||||
found = true
|
||||
}
|
||||
|
||||
if !found
|
||||
doc.root.add_element("HISTORY_RECORDS")
|
||||
end
|
||||
end
|
||||
|
||||
@db.run "DROP TABLE old_vm_pool;"
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -750,20 +750,17 @@ function setupCreateVMDialog(){
|
||||
if (!template_id.length){
|
||||
notifyError("You have not selected a template");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
if (n_times.length){
|
||||
n_times_int=parseInt(n_times,10);
|
||||
}
|
||||
};
|
||||
|
||||
if (n_times_int>1){
|
||||
if (!vm_name.length){
|
||||
vm_name = $('#template_id option:selected',this).text();
|
||||
}
|
||||
for (var i=0; i< n_times_int; i++){
|
||||
Sunstone.runAction("Template.instantiate",template_id,vm_name+"_"+i);
|
||||
};
|
||||
} else {
|
||||
if (!vm_name.length){
|
||||
vm_name = $('#template_id option:selected',this).text();
|
||||
};
|
||||
|
||||
for (var i=0; i< n_times_int; i++){
|
||||
Sunstone.runAction("Template.instantiate",template_id,vm_name);
|
||||
};
|
||||
|
||||
|
||||
+19
-23
@@ -146,7 +146,6 @@ void get_image_attribute(VirtualMachine * vm,
|
||||
ImagePool * ipool = nd.get_ipool();
|
||||
Image * img;
|
||||
int iid = -1;
|
||||
string iid_str;
|
||||
|
||||
int num;
|
||||
vector<const Attribute *> attrs;
|
||||
@@ -154,7 +153,7 @@ void get_image_attribute(VirtualMachine * vm,
|
||||
|
||||
attr_value.clear();
|
||||
|
||||
if (img_name.empty() || img_name != "IMAGE_ID")
|
||||
if ( img_name.empty() || (img_name!="IMAGE" && img_name!="IMAGE_ID") )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -174,11 +173,10 @@ void get_image_attribute(VirtualMachine * vm,
|
||||
continue;
|
||||
}
|
||||
|
||||
iid_str = disk->vector_value("IMAGE_ID");
|
||||
|
||||
if ( iid_str == img_value )
|
||||
if ( disk->vector_value(img_name.c_str()) == img_value )
|
||||
{
|
||||
istringstream iss(img_value);
|
||||
string iid_str = disk->vector_value("IMAGE_ID");
|
||||
istringstream iss(iid_str);
|
||||
|
||||
iss >> iid;
|
||||
|
||||
@@ -232,7 +230,6 @@ void get_network_attribute(VirtualMachine * vm,
|
||||
VirtualNetworkPool * vnpool = nd.get_vnpool();
|
||||
VirtualNetwork * vn;
|
||||
int vnet_id = -1;
|
||||
string vnet_id_str;
|
||||
|
||||
int num;
|
||||
vector<const Attribute *> attrs;
|
||||
@@ -240,7 +237,7 @@ void get_network_attribute(VirtualMachine * vm,
|
||||
|
||||
attr_value.clear();
|
||||
|
||||
if (net_name.empty() || net_name != "NETWORK_ID")
|
||||
if ( net_name.empty() || (net_name!="NETWORK" && net_name!="NETWORK_ID") )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -260,11 +257,10 @@ void get_network_attribute(VirtualMachine * vm,
|
||||
continue;
|
||||
}
|
||||
|
||||
vnet_id_str = net->vector_value("NETWORK_ID");
|
||||
|
||||
if ( vnet_id_str == net_value )
|
||||
if ( net->vector_value(net_name.c_str()) == net_value )
|
||||
{
|
||||
istringstream iss(net_value);
|
||||
string vnet_id_str = net->vector_value("NETWORK_ID");
|
||||
istringstream iss(vnet_id_str);
|
||||
|
||||
iss >> vnet_id;
|
||||
|
||||
@@ -460,7 +456,7 @@ void insert_vector(VirtualMachine * vm,
|
||||
|
||||
|
||||
/* Line 268 of yacc.c */
|
||||
#line 464 "vm_var_syntax.cc"
|
||||
#line 460 "vm_var_syntax.cc"
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
@@ -506,7 +502,7 @@ typedef union YYSTYPE
|
||||
{
|
||||
|
||||
/* Line 293 of yacc.c */
|
||||
#line 408 "vm_var_syntax.y"
|
||||
#line 404 "vm_var_syntax.y"
|
||||
|
||||
char * val_str;
|
||||
int val_int;
|
||||
@@ -515,7 +511,7 @@ typedef union YYSTYPE
|
||||
|
||||
|
||||
/* Line 293 of yacc.c */
|
||||
#line 519 "vm_var_syntax.cc"
|
||||
#line 515 "vm_var_syntax.cc"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
@@ -540,7 +536,7 @@ typedef struct YYLTYPE
|
||||
|
||||
|
||||
/* Line 343 of yacc.c */
|
||||
#line 544 "vm_var_syntax.cc"
|
||||
#line 540 "vm_var_syntax.cc"
|
||||
|
||||
#ifdef short
|
||||
# undef short
|
||||
@@ -830,7 +826,7 @@ static const yytype_int8 yyrhs[] =
|
||||
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
||||
static const yytype_uint16 yyrline[] =
|
||||
{
|
||||
0, 432, 432, 433, 436, 440, 453, 468
|
||||
0, 428, 428, 429, 432, 436, 449, 464
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1831,7 +1827,7 @@ yyreduce:
|
||||
case 4:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 437 "vm_var_syntax.y"
|
||||
#line 433 "vm_var_syntax.y"
|
||||
{
|
||||
(*parsed) << (yyvsp[(1) - (1)].val_str);
|
||||
}
|
||||
@@ -1840,7 +1836,7 @@ yyreduce:
|
||||
case 5:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 441 "vm_var_syntax.y"
|
||||
#line 437 "vm_var_syntax.y"
|
||||
{
|
||||
string name((yyvsp[(1) - (2)].val_str));
|
||||
|
||||
@@ -1858,7 +1854,7 @@ yyreduce:
|
||||
case 6:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 454 "vm_var_syntax.y"
|
||||
#line 450 "vm_var_syntax.y"
|
||||
{
|
||||
string name((yyvsp[(1) - (5)].val_str));
|
||||
string vname((yyvsp[(3) - (5)].val_str));
|
||||
@@ -1878,7 +1874,7 @@ yyreduce:
|
||||
case 7:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 469 "vm_var_syntax.y"
|
||||
#line 465 "vm_var_syntax.y"
|
||||
{
|
||||
string name((yyvsp[(1) - (9)].val_str));
|
||||
string vname((yyvsp[(3) - (9)].val_str));
|
||||
@@ -1901,7 +1897,7 @@ yyreduce:
|
||||
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 1905 "vm_var_syntax.cc"
|
||||
#line 1901 "vm_var_syntax.cc"
|
||||
default: break;
|
||||
}
|
||||
/* User semantic actions sometimes alter yychar, and that requires
|
||||
@@ -2139,7 +2135,7 @@ yyreturn:
|
||||
|
||||
|
||||
/* Line 2067 of yacc.c */
|
||||
#line 487 "vm_var_syntax.y"
|
||||
#line 483 "vm_var_syntax.y"
|
||||
|
||||
|
||||
extern "C" void vm_var__error(
|
||||
|
||||
@@ -56,7 +56,7 @@ typedef union YYSTYPE
|
||||
{
|
||||
|
||||
/* Line 2068 of yacc.c */
|
||||
#line 408 "vm_var_syntax.y"
|
||||
#line 404 "vm_var_syntax.y"
|
||||
|
||||
char * val_str;
|
||||
int val_int;
|
||||
|
||||
+8
-12
@@ -85,7 +85,6 @@ void get_image_attribute(VirtualMachine * vm,
|
||||
ImagePool * ipool = nd.get_ipool();
|
||||
Image * img;
|
||||
int iid = -1;
|
||||
string iid_str;
|
||||
|
||||
int num;
|
||||
vector<const Attribute *> attrs;
|
||||
@@ -93,7 +92,7 @@ void get_image_attribute(VirtualMachine * vm,
|
||||
|
||||
attr_value.clear();
|
||||
|
||||
if (img_name.empty() || img_name != "IMAGE_ID")
|
||||
if ( img_name.empty() || (img_name!="IMAGE" && img_name!="IMAGE_ID") )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -113,11 +112,10 @@ void get_image_attribute(VirtualMachine * vm,
|
||||
continue;
|
||||
}
|
||||
|
||||
iid_str = disk->vector_value("IMAGE_ID");
|
||||
|
||||
if ( iid_str == img_value )
|
||||
if ( disk->vector_value(img_name.c_str()) == img_value )
|
||||
{
|
||||
istringstream iss(img_value);
|
||||
string iid_str = disk->vector_value("IMAGE_ID");
|
||||
istringstream iss(iid_str);
|
||||
|
||||
iss >> iid;
|
||||
|
||||
@@ -171,7 +169,6 @@ void get_network_attribute(VirtualMachine * vm,
|
||||
VirtualNetworkPool * vnpool = nd.get_vnpool();
|
||||
VirtualNetwork * vn;
|
||||
int vnet_id = -1;
|
||||
string vnet_id_str;
|
||||
|
||||
int num;
|
||||
vector<const Attribute *> attrs;
|
||||
@@ -179,7 +176,7 @@ void get_network_attribute(VirtualMachine * vm,
|
||||
|
||||
attr_value.clear();
|
||||
|
||||
if (net_name.empty() || net_name != "NETWORK_ID")
|
||||
if ( net_name.empty() || (net_name!="NETWORK" && net_name!="NETWORK_ID") )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -199,11 +196,10 @@ void get_network_attribute(VirtualMachine * vm,
|
||||
continue;
|
||||
}
|
||||
|
||||
vnet_id_str = net->vector_value("NETWORK_ID");
|
||||
|
||||
if ( vnet_id_str == net_value )
|
||||
if ( net->vector_value(net_name.c_str()) == net_value )
|
||||
{
|
||||
istringstream iss(net_value);
|
||||
string vnet_id_str = net->vector_value("NETWORK_ID");
|
||||
istringstream iss(vnet_id_str);
|
||||
|
||||
iss >> vnet_id;
|
||||
|
||||
|
||||
@@ -68,20 +68,18 @@ class VmmAction
|
||||
get_data(:dest_driver, :MIGR_NET_DRV)
|
||||
|
||||
# Initialize streams and vnm
|
||||
@ssh_src = @vmm.get_ssh_stream(@data[:host], @id)
|
||||
@ssh_src = @vmm.get_ssh_stream(action, @data[:host], @id)
|
||||
@vnm_src = VirtualNetworkDriver.new(@data[:net_drv],
|
||||
:local_actions => @vmm.options[:local_actions],
|
||||
:message => @xml_data,
|
||||
:ssh_stream => @ssh_src,
|
||||
:extra_data => @data)
|
||||
:ssh_stream => @ssh_src)
|
||||
|
||||
if @data[:dest_host] and !@data[:dest_host].empty?
|
||||
@ssh_dst = @vmm.get_ssh_stream(@data[:dest_host], @id)
|
||||
@ssh_dst = @vmm.get_ssh_stream(action, @data[:dest_host], @id)
|
||||
@vnm_dst = VirtualNetworkDriver.new(@data[:dest_driver],
|
||||
:local_actions => @vmm.options[:local_actions],
|
||||
:message => @xml_data,
|
||||
:ssh_stream => @ssh_dst,
|
||||
:extra_data => @data)
|
||||
:ssh_stream => @ssh_dst)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -149,15 +147,15 @@ class VmmAction
|
||||
vnm = @vnm_src
|
||||
end
|
||||
|
||||
result, info = vnm.do_action(@id, step[:action])
|
||||
result, info = vnm.do_action(@id, step[:action],
|
||||
:parameters => get_parameters(step[:parameters]))
|
||||
else
|
||||
result = DriverExecHelper.const_get(:RESULT)[:failure]
|
||||
info = "No driver in #{step[:action]}"
|
||||
end
|
||||
|
||||
# Save the step info
|
||||
@data["#{step[:action]}_info".to_sym] = info
|
||||
@data[step[:save_info_as]] = info if step[:save_info_as]
|
||||
@data["#{step[:action]}_info".to_sym] = info.strip
|
||||
|
||||
# Roll back steps, store failed info and break steps
|
||||
if DriverExecHelper.failed?(result)
|
||||
@@ -170,7 +168,7 @@ class VmmAction
|
||||
break
|
||||
else
|
||||
@vmm.log(@id,
|
||||
"Sussecfully execute #{DRIVER_NAMES[step[:driver]]} " \
|
||||
"Successfully execute #{DRIVER_NAMES[step[:driver]]} " \
|
||||
"operation: #{step[:action]}.")
|
||||
end
|
||||
end
|
||||
@@ -230,10 +228,16 @@ class ExecDriver < VirtualMachineDriver
|
||||
# @param[String] the hostname of the host
|
||||
# @param[String] id of the VM to log messages
|
||||
# @return [SshStreamCommand]
|
||||
def get_ssh_stream(host, id)
|
||||
SshStreamCommand.new(host,
|
||||
@remote_scripts_base_path,
|
||||
log_method(id))
|
||||
def get_ssh_stream(aname, host, id)
|
||||
stream = nil
|
||||
|
||||
if not action_is_local?(aname)
|
||||
stream = SshStreamCommand.new(host,
|
||||
@remote_scripts_base_path,
|
||||
log_method(id))
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -280,12 +284,12 @@ class ExecDriver < VirtualMachineDriver
|
||||
:action => :deploy,
|
||||
:parameters => [dfile, :host],
|
||||
:stdin => domain,
|
||||
:save_info_as => :deploy_id
|
||||
},
|
||||
# Execute post-boot networking setup
|
||||
{
|
||||
:driver => :vnm,
|
||||
:action => :post,
|
||||
:parameters => [:deploy_info],
|
||||
:fail_actions => [
|
||||
{
|
||||
:driver => :vmm,
|
||||
@@ -391,6 +395,7 @@ class ExecDriver < VirtualMachineDriver
|
||||
{
|
||||
:driver => :vnm,
|
||||
:action => :post,
|
||||
:parameters => [:deploy_id],
|
||||
:fail_actions => [
|
||||
{
|
||||
:driver => :vmm,
|
||||
@@ -432,6 +437,7 @@ class ExecDriver < VirtualMachineDriver
|
||||
{
|
||||
:driver => :vnm,
|
||||
:action => :post,
|
||||
:parameters => [:deploy_id],
|
||||
:destination => :true
|
||||
#TODO :fail_action what to do here? cancel VM?
|
||||
},
|
||||
@@ -448,7 +454,7 @@ class ExecDriver < VirtualMachineDriver
|
||||
host = data.elements['HOST'].text
|
||||
deploy_id = data.elements['DEPLOY_ID'].text
|
||||
|
||||
do_action("#{deploy_id} #{host}", id, host, :poll)
|
||||
do_action("#{deploy_id} #{host}", id, host, ACTION[:poll])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -496,5 +502,3 @@ exec_driver = ExecDriver.new(hypervisor,
|
||||
:local_actions => local_actions)
|
||||
|
||||
exec_driver.start_driver
|
||||
|
||||
|
||||
@@ -22,4 +22,4 @@ else
|
||||
MAD_LOCATION=$ONE_LOCATION/lib/mads
|
||||
fi
|
||||
|
||||
exec $MAD_LOCATION/one_vmm_exec -l deploy,shutdown,cancel,save,restore,migrate,poll $*
|
||||
exec $MAD_LOCATION/one_vmm_exec -l deploy,shutdown,cancel,save,restore,migrate,poll,pre,post,clean $*
|
||||
@@ -16,77 +16,24 @@
|
||||
# limitations under the License. #
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION)
|
||||
ONE_LOCATION=ENV["ONE_LOCATION"]
|
||||
|
||||
if !ONE_LOCATION
|
||||
ETC_LOCATION="/etc/one" if !defined?(ETC_LOCATION)
|
||||
RUBY_LIB_LOCATION="/usr/lib/one/ruby"
|
||||
else
|
||||
ETC_LOCATION=ONE_LOCATION+"/etc" if !defined?(ETC_LOCATION)
|
||||
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
|
||||
end
|
||||
|
||||
deployment_file = ARGV[0]
|
||||
@host = ARGV[1]
|
||||
$: << RUBY_LIB_LOCATION
|
||||
$: << File.dirname(__FILE__)
|
||||
|
||||
if !@host or !deployment_file
|
||||
exit -1
|
||||
end
|
||||
require 'vmwarelib'
|
||||
|
||||
load ETC_LOCATION + "/vmwarerc"
|
||||
dfile = ARGV[0]
|
||||
host = ARGV[1]
|
||||
|
||||
if USERNAME.class!=String || PASSWORD.class!=String
|
||||
warn "Bad ESX credentials, aborting"
|
||||
exit -1
|
||||
end
|
||||
vmware_drv = VMWareDriver.new(host)
|
||||
|
||||
# Define the VM
|
||||
data = perform_action("virsh -c #{LIBVIRT_URI} define #{deployment_file}")
|
||||
puts vmware_drv.deploy(dfile)
|
||||
|
||||
if data.class == Fixnum
|
||||
exit data
|
||||
end
|
||||
|
||||
domainname = ""
|
||||
success = false
|
||||
|
||||
data.split('\n').each{ |line|
|
||||
domainname = line.match("Domain (.*) defined from (.*)")
|
||||
if domainname
|
||||
success = true
|
||||
break
|
||||
end
|
||||
}
|
||||
|
||||
if !success
|
||||
exit -1
|
||||
end
|
||||
|
||||
domainname = domainname[1]
|
||||
|
||||
# Start the VM
|
||||
data = perform_action("virsh -c #{LIBVIRT_URI} start #{domainname}")
|
||||
|
||||
if data.class == Fixnum
|
||||
exit data
|
||||
end
|
||||
|
||||
definedname = domainname
|
||||
domainname = ""
|
||||
success = false
|
||||
|
||||
data.split('\n').each{ |line|
|
||||
domainname = line.match("Domain (.*) started")
|
||||
if domainname
|
||||
success = true
|
||||
break
|
||||
end
|
||||
}
|
||||
|
||||
if !success
|
||||
exit -1
|
||||
end
|
||||
|
||||
if definedname != domainname[1]
|
||||
exit -1
|
||||
else
|
||||
puts definedname
|
||||
end
|
||||
exit 0
|
||||
@@ -14,28 +14,11 @@
|
||||
# limitations under the License. #
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
# User configurable variables (Ruby syntax)
|
||||
LIBVIRT_URI = "esx://@HOST@/?no_verify=1"
|
||||
QEMU_PROTOCOL = "qemu"
|
||||
# Libvirt configuration
|
||||
|
||||
:libvirt_uri: "esx://@HOST@/?no_verify=1"
|
||||
:qemu_protocol: "qemu"
|
||||
|
||||
# Username and password of the VMware hypervisor
|
||||
USERNAME = "oneadmin"
|
||||
PASSWORD =
|
||||
|
||||
# Loading the vmware library for mads
|
||||
# Please leave this uncommented
|
||||
ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION)
|
||||
|
||||
if !ONE_LOCATION
|
||||
LIB_LOCATION = "/usr/lib/one" if !defined?(LIB_LOCATION)
|
||||
else
|
||||
LIB_LOCATION = ONE_LOCATION+"/lib" if !defined?(LIB_LOCATION)
|
||||
end
|
||||
|
||||
load LIB_LOCATION + "/ruby/vmwarelib.rb"
|
||||
|
||||
ENV['LANG']='C'
|
||||
|
||||
|
||||
|
||||
|
||||
:username: "oneadmin"
|
||||
:password:
|
||||
@@ -37,7 +37,7 @@ output=`$XM_CREATE $domain`
|
||||
|
||||
error_exit $? "Unable to create domain"
|
||||
|
||||
domain_name=`echo $output | grep 'Started domain' | sed 's/^.*Started domain //' | tr -d '\n'`
|
||||
domain_name=`echo $output | grep 'Started domain' | sed 's/^.*Started domain //' | tr -d '\n' | cut -d' ' -f1`
|
||||
|
||||
out=`grep -e '^\#O CPU_CREDITS =' < $domain`
|
||||
|
||||
@@ -46,7 +46,7 @@ if [ "x$?" = "x0" ]; then
|
||||
|
||||
log_debug "Credits set to $credits"
|
||||
|
||||
name=`grep -e '^name =' < $domain | cut -d= -f2 | tr -d ' ' | tr -d "\'"`
|
||||
name=`grep -e '^name =' < $domain | cut -d= -f2 | tr -d ' ' | tr -d "\'" | cut -d' ' -f1`
|
||||
|
||||
$XM_CREDITS -d $name -w $credits
|
||||
|
||||
|
||||
+10
-6
@@ -31,7 +31,6 @@ class VirtualNetworkDriver
|
||||
@options = options
|
||||
@ssh_stream = options[:ssh_stream]
|
||||
@message = options[:message]
|
||||
@extra_data = options[:extra_data]
|
||||
|
||||
@vm_encoded = Base64.encode64(@message.elements['VM'].to_s).delete("\n")
|
||||
|
||||
@@ -45,18 +44,21 @@ class VirtualNetworkDriver
|
||||
# @param [String, Symbol] aname name of the action
|
||||
# @param [Hash] ops extra options for the command
|
||||
# @option ops [String] :stdin text to be writen to stdin
|
||||
# @option ops [String] :parameters additional parameters for vnm action
|
||||
def do_action(id, aname, ops = {})
|
||||
options={
|
||||
:stdin => nil,
|
||||
:stdin => nil,
|
||||
:parameters => nil
|
||||
}.merge(ops)
|
||||
|
||||
deploy_id=@extra_data[:deploy_id] || '-'
|
||||
cmd_params = "#{@vm_encoded}"
|
||||
cmd_params << " #{options[:parameters]}" if options[:parameters]
|
||||
|
||||
cmd = action_command_line(aname, "#{@vm_encoded} #{deploy_id}")
|
||||
cmd = action_command_line(aname, cmd_params)
|
||||
|
||||
if action_is_local?(aname)
|
||||
execution = LocalCommand.run(cmd, log_method(id))
|
||||
else
|
||||
elsif @ssh_stream != nil
|
||||
if options[:stdin]
|
||||
cmdin = "cat << EOT | #{cmd}"
|
||||
stdin = "#{options[:stdin]}\nEOT\n"
|
||||
@@ -66,8 +68,10 @@ class VirtualNetworkDriver
|
||||
end
|
||||
|
||||
execution = @ssh_stream.run(cmdin, stdin, cmd)
|
||||
else
|
||||
return RESULT[:failure], "Network action #{aname} needs a ssh stream."
|
||||
end
|
||||
|
||||
result, info = get_info_from_execution(execution)
|
||||
return get_info_from_execution(execution)
|
||||
end
|
||||
end
|
||||
@@ -43,7 +43,7 @@ describe 'networking' do
|
||||
$capture_commands = {
|
||||
/virsh.*dumpxml/ => OUTPUT[:virsh_dumpxml]
|
||||
}
|
||||
onevlan = OpenNebulaNetwork.new(OUTPUT[:onevm_show],"TEMPLATE/NIC","kvm")
|
||||
onevlan = OpenNebulaNetwork.new(OUTPUT[:onevm_show],"TEMPLATE/NIC",nil,"kvm")
|
||||
nics_expected = [{:bridge=>"br0",
|
||||
:ip=>"172.16.0.100",
|
||||
:mac=>"02:00:ac:10:00:64",
|
||||
@@ -76,7 +76,7 @@ describe 'ebtables' do
|
||||
/virsh.*dumpxml/ => OUTPUT[:virsh_dumpxml],
|
||||
/ebtables/ => nil
|
||||
}
|
||||
onevlan = EbtablesVLAN.new(OUTPUT[:onevm_show],"kvm")
|
||||
onevlan = EbtablesVLAN.new(OUTPUT[:onevm_show],nil,"kvm")
|
||||
onevlan.activate
|
||||
ebtables_cmds = [
|
||||
"sudo /sbin/ebtables -A FORWARD -s ! 02:00:ac:10:00:00/ff:ff:ff:ff:ff:00 -o vnet0 -j DROP",
|
||||
@@ -98,7 +98,7 @@ describe 'openvswitch' do
|
||||
/virsh.*dumpxml/ => OUTPUT[:virsh_dumpxml],
|
||||
/ovs-vsctl/ => nil
|
||||
}
|
||||
onevlan = OpenvSwitchVLAN.new(OUTPUT[:onevm_show],"kvm")
|
||||
onevlan = OpenvSwitchVLAN.new(OUTPUT[:onevm_show],nil,"kvm")
|
||||
onevlan.activate
|
||||
openvswitch_tags = [
|
||||
"sudo /usr/local/bin/ovs-vsctl set Port vnet0 tag=2",
|
||||
@@ -117,7 +117,7 @@ describe 'openvswitch' do
|
||||
/brctl show/ => OUTPUT[:brctl_show],
|
||||
/ovs-vsctl/ => nil
|
||||
}
|
||||
onevlan = OpenvSwitchVLAN.new(OUTPUT[:onevm_show_vlan_id_kvm],"kvm")
|
||||
onevlan = OpenvSwitchVLAN.new(OUTPUT[:onevm_show_vlan_id_kvm],nil,"kvm")
|
||||
onevlan.activate
|
||||
|
||||
onevlan_rules = ["sudo /usr/local/bin/ovs-vsctl set Port vnet0 tag=6",
|
||||
@@ -166,7 +166,7 @@ describe 'host-managed' do
|
||||
/ip link set/ => nil,
|
||||
/ip link show/ => [nil,255]
|
||||
}
|
||||
hm = OpenNebulaHM.new(OUTPUT[:onevm_show_phydev_kvm],"kvm")
|
||||
hm = OpenNebulaHM.new(OUTPUT[:onevm_show_phydev_kvm],nil,"kvm")
|
||||
hm.activate
|
||||
|
||||
hm_activate_rules = ["sudo /sbin/brctl addbr onebr6",
|
||||
@@ -189,7 +189,7 @@ describe 'host-managed' do
|
||||
/ip link set/ => nil,
|
||||
/ip link show/ => [nil,255]
|
||||
}
|
||||
hm = OpenNebulaHM.new(OUTPUT[:onevm_show_vlan_id_kvm],"kvm")
|
||||
hm = OpenNebulaHM.new(OUTPUT[:onevm_show_vlan_id_kvm],nil,"kvm")
|
||||
hm.activate
|
||||
|
||||
hm_vlan_id = ["sudo /sbin/brctl addbr onebr10",
|
||||
@@ -222,7 +222,7 @@ describe 'host-managed' do
|
||||
|
||||
|
||||
|
||||
hm = OpenNebulaHM.new(OUTPUT[:onevm_show_mixed],"kvm")
|
||||
hm = OpenNebulaHM.new(OUTPUT[:onevm_show_mixed],nil,"kvm")
|
||||
hm.activate
|
||||
|
||||
hm_vlan_tag = [ "sudo /sbin/brctl show",
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<NETWORK><![CDATA[virt-net]]></NETWORK>
|
||||
<NETWORK_ID><![CDATA[3]]></NETWORK_ID>
|
||||
<VLAN><![CDATA[YES]]></VLAN>
|
||||
<WHITE_PORTS_TCP><![CDATA[22,80]]></WHITE_PORTS_TCP>
|
||||
<WHITE_PORTS_TCP><![CDATA[22, 80]]></WHITE_PORTS_TCP>
|
||||
</NIC>
|
||||
<NIC>
|
||||
<BRIDGE><![CDATA[onebr2]]></BRIDGE>
|
||||
|
||||
Reference in new issue
Block a user