Skip to content

Instantly share code, notes, and snippets.

@penguin2716
Last active December 22, 2015 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penguin2716/6547798 to your computer and use it in GitHub Desktop.
Save penguin2716/6547798 to your computer and use it in GitHub Desktop.
I want to test PCI pass-through on CloudStack 4.1.x, KVM Host!!!
ref. http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.1.1/html/Installation_Guide/sect-source-buildrpm.html
ref. http://cloudstack.apache.org/downloads.html
ref. http://maven.apache.org/download.cgi
# yum groupinstall "Development Tools"
# yum install java-1.6.0-openjdk-devel.x86_64 genisoimage mysql mysql-server ws-commons-util MySQL-python tomcat6 createrepo
# yum install git wget -y
# wget http://ftp.meisei-u.ac.jp/mirror/apache/dist/maven/maven-3/3.1.0/binaries/apache-maven-3.1.0-bin.tar.gz
# tar xf apache-maven-3.1.0-bin.tar.gz
# mv apache-maven-3.1.0 /usr/local/
# echo 'export PATH=/usr/local/apache-maven-3.1.0/bin:$PATH' >> ~/.bashrc
# echo 'export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/' >> ~/.bashrc
# source ~/.bashrc
From git repository
# git clone https://git-wip-us.apache.org/repos/asf/cloudstack.git
# cd cloudstack/
# git checkout -b cs41-pcipassthuru remotes/origin/4.1
Branch cs41-pcipassthuru set up to track remote branch 4.1 from origin.
Switched to a new branch 'cs41-pcipassthuru'
# git commit -a -m 'add pci pass-through support'
# patch -p0 < ../patches/LibvirtComputingResource.java.patch
patching file plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
# patch -p0 < ../patches/LibvirtVMDef.java.patch
patching file plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
# cd packaging/centos63
Generating RPMs is done using the package.sh script:
# ./package.sh
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ cloud-awsapi ---
[INFO] Compiling 977 source files to /root/cloudstack/dist/rpmbuild/BUILD/cloudstack-4.1.2-SNAPSHOT/awsapi/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: error reading /root/.m2/repository/org/apache/axis2/mex/1.5.4/mex-1.5.4-impl.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/axis2/axis2-mtompolicy/1.5.4/axis2-mtompolicy-1.5.4.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/ws/commons/axiom/axiom-dom/1.2.10/axiom-dom-1.2.10.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/opensaml/opensaml1/1.1/opensaml1-1.1.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar; error in opening zip file
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache CloudStack ................................. SUCCESS [8.854s]
[INFO] Apache CloudStack Utils ........................... SUCCESS [27.731s]
[INFO] Apache CloudStack API ............................. SUCCESS [20.783s]
[INFO] Apache CloudStack Core ............................ SUCCESS [12.164s]
[INFO] Apache CloudStack Agents .......................... SUCCESS [11.728s]
[INFO] Apache CloudStack SystemVM Patches ................ SUCCESS [0.614s]
[INFO] Apache CloudStack Console Proxy ................... SUCCESS [17.157s]
[INFO] Apache CloudStack Framework ....................... SUCCESS [0.093s]
[INFO] Apache CloudStack Framework - IPC ................. SUCCESS [7.776s]
[INFO] Apache CloudStack Framework - REST ................ SUCCESS [6.866s]
[INFO] Apache CloudStack Cloud Engine .................... SUCCESS [0.094s]
[INFO] Apache CloudStack Cloud Engine API ................ SUCCESS [4.849s]
[INFO] Apache CloudStack Framework - Event Notification .. SUCCESS [3.446s]
[INFO] Apache CloudStack Server .......................... SUCCESS [36.122s]
[INFO] Apache CloudStack Usage Server .................... SUCCESS [9.520s]
[INFO] Apache XenSource XAPI ............................. SUCCESS [10.117s]
[INFO] Apache CloudStack Plugin POM ...................... SUCCESS [0.573s]
[INFO] Apache CloudStack Plugin - API Rate Limit ......... SUCCESS [9.735s]
[INFO] Apache CloudStack Plugin - API Discovery .......... SUCCESS [7.537s]
[INFO] Apache CloudStack Plugin - ACL Static Role Based .. SUCCESS [3.862s]
[INFO] Apache CloudStack Plugin - User Concentrated Pod Deployment Planner SUCCESS [3.951s]
[INFO] Apache CloudStack Plugin - User Dispersing Deployment Planner SUCCESS [3.993s]
[INFO] Apache CloudStack Plugin - Host Allocator Random .. SUCCESS [3.893s]
[INFO] Apache CloudStack Plugin - Hypervisor OracleVM .... SUCCESS [5.791s]
[INFO] Apache CloudStack Cloud Engine Internal Components API SUCCESS [3.310s]
[INFO] Apache CloudStack Engine Storage Component ........ SUCCESS [7.174s]
[INFO] Apache CloudStack Plugin - Open vSwitch ........... SUCCESS [5.341s]
[INFO] Apache CloudStack Plugin - Hypervisor Xen ......... SUCCESS [10.133s]
[INFO] Apache CloudStack Plugin - Hypervisor KVM ......... SUCCESS [14.437s]
[INFO] Apache CloudStack Plugin - RabbitMQ Event Bus ..... SUCCESS [4.227s]
[INFO] Apache CloudStack Plugin - Hypervisor Simulator ... SUCCESS [7.084s]
[INFO] Apache CloudStack Plugin - Network Elastic Load Balancer SUCCESS [5.045s]
[INFO] Apache CloudStack Plugin - Network Nicira NVP ..... SUCCESS [12.769s]
[INFO] Apache CloudStack Plugin - BigSwitch Virtual Network Segment SUCCESS [9.220s]
[INFO] Apache CloudStack Plugin - Storage Allocator Random SUCCESS [3.791s]
[INFO] Apache CloudStack Plugin - User Authenticator LDAP SUCCESS [3.909s]
[INFO] Apache CloudStack Plugin - User Authenticator MD5 . SUCCESS [3.730s]
[INFO] Apache CloudStack Plugin - User Authenticator Plain Text SUCCESS [3.972s]
[INFO] Apache CloudStack Plugin - User Authenticator SHA256 Salted SUCCESS [21.903s]
[INFO] Apache CloudStack Plugin - Dns Notifier Example ... SUCCESS [3.616s]
[INFO] Apache CloudStack Engine Storage Image Component .. SUCCESS [4.273s]
[INFO] Apache CloudStack Plugin - Storage Image S3 ....... SUCCESS [0.969s]
[INFO] Apache CloudStack Engine Storage Volume Component . SUCCESS [7.152s]
[INFO] Apache CloudStack Plugin - Storage Volume solidfire SUCCESS [6.525s]
[INFO] Apache CloudStack Cloud Engine Compute Component .. SUCCESS [3.414s]
[INFO] Apache CloudStack Cloud Engine API ................ SUCCESS [3.172s]
[INFO] Apache CloudStack Cloud Engine Orchestration Component SUCCESS [9.414s]
[INFO] Apache CloudStack Cloud Engine Schema Component ... SUCCESS [0.851s]
[INFO] Apache CloudStack Engine Storage Backup Component . SUCCESS [3.335s]
[INFO] Apache CloudStack Engine Storage Image Motion Component SUCCESS [3.700s]
[INFO] Apache CloudStack Engine Storage Snapshot Component SUCCESS [4.262s]
[INFO] Apache CloudStack Client UI ....................... SUCCESS [12.277s]
[INFO] Apache CloudStack Test ............................ SUCCESS [7.812s]
[INFO] Apache CloudStack Engine Storage integration test Component SUCCESS [4.931s]
[INFO] Apache CloudStack Cloud Engine Service ............ SUCCESS [8.562s]
[INFO] Apache CloudStack AWS API Bridge .................. FAILURE [47.387s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7:47.905s
[INFO] Finished at: Fri Sep 13 06:18:24 JST 2013
[INFO] Final Memory: 63M/410M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project cloud-awsapi: Compilation failure: Compilation failure:
[ERROR] error: error reading /root/.m2/repository/org/apache/axis2/mex/1.5.4/mex-1.5.4-impl.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/axis2/axis2-mtompolicy/1.5.4/axis2-mtompolicy-1.5.4.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/ws/commons/axiom/axiom-dom/1.2.10/axiom-dom-1.2.10.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/opensaml/opensaml1/1.1/opensaml1-1.1.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar; error in opening zip file
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :cloud-awsapi
error: Bad exit status from /var/tmp/rpm-tmp.GfGxTs (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.GfGxTs (%build)
from source
# wget http://ftp.riken.jp/net/apache/cloudstack/releases/4.1.1/apache-cloudstack-4.1.1-src.tar.bz2
# tar xjf apache-cloudstack-4.1.1-src.tar.bz2
# cd apache-cloudstack-4.1.1-src
# patch -p0 < ../patches/LibvirtComputingResource.java.patch
patching file plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
Hunk #1 succeeded at 3057 (offset -34 lines).
# patch -p0 < ../patches/LibvirtVMDef.java.patch
patching file plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
Hunk #2 succeeded at 272 (offset -2 lines).
Hunk #3 succeeded at 292 (offset -2 lines).
Hunk #4 succeeded at 345 (offset -2 lines).
# cd packaging/centos63/
# ./package.sh
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ cloud-awsapi ---
[INFO] Compiling 977 source files to /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/BUILD/cloudstack-4.1.1/awsapi/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: error reading /root/.m2/repository/org/apache/axis2/mex/1.5.4/mex-1.5.4-impl.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/axis2/axis2-mtompolicy/1.5.4/axis2-mtompolicy-1.5.4.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/ws/commons/axiom/axiom-dom/1.2.10/axiom-dom-1.2.10.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/opensaml/opensaml1/1.1/opensaml1-1.1.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar; error in opening zip file
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache CloudStack ................................. SUCCESS [2.274s]
[INFO] Apache CloudStack Utils ........................... SUCCESS [19.616s]
[INFO] Apache CloudStack API ............................. SUCCESS [20.842s]
[INFO] Apache CloudStack Core ............................ SUCCESS [12.473s]
[INFO] Apache CloudStack Agents .......................... SUCCESS [9.841s]
[INFO] Apache CloudStack SystemVM Patches ................ SUCCESS [0.572s]
[INFO] Apache CloudStack Console Proxy ................... SUCCESS [15.888s]
[INFO] Apache CloudStack Framework ....................... SUCCESS [0.094s]
[INFO] Apache CloudStack Framework - IPC ................. SUCCESS [7.774s]
[INFO] Apache CloudStack Framework - REST ................ SUCCESS [5.295s]
[INFO] Apache CloudStack Cloud Engine .................... SUCCESS [0.091s]
[INFO] Apache CloudStack Cloud Engine API ................ SUCCESS [4.769s]
[INFO] Apache CloudStack Framework - Event Notification .. SUCCESS [3.332s]
[INFO] Apache CloudStack Server .......................... SUCCESS [36.986s]
[INFO] Apache CloudStack Usage Server .................... SUCCESS [9.128s]
[INFO] Apache XenSource XAPI ............................. SUCCESS [10.026s]
[INFO] Apache CloudStack Plugin POM ...................... SUCCESS [0.554s]
[INFO] Apache CloudStack Plugin - API Rate Limit ......... SUCCESS [9.468s]
[INFO] Apache CloudStack Plugin - API Discovery .......... SUCCESS [7.457s]
[INFO] Apache CloudStack Plugin - ACL Static Role Based .. SUCCESS [3.776s]
[INFO] Apache CloudStack Plugin - User Concentrated Pod Deployment Planner SUCCESS [3.847s]
[INFO] Apache CloudStack Plugin - User Dispersing Deployment Planner SUCCESS [3.956s]
[INFO] Apache CloudStack Plugin - Host Allocator Random .. SUCCESS [3.915s]
[INFO] Apache CloudStack Plugin - Hypervisor OracleVM .... SUCCESS [5.782s]
[INFO] Apache CloudStack Cloud Engine Internal Components API SUCCESS [3.330s]
[INFO] Apache CloudStack Engine Storage Component ........ SUCCESS [7.232s]
[INFO] Apache CloudStack Plugin - Open vSwitch ........... SUCCESS [5.063s]
[INFO] Apache CloudStack Plugin - Hypervisor Xen ......... SUCCESS [10.448s]
[INFO] Apache CloudStack Plugin - Hypervisor KVM ......... SUCCESS [10.258s]
[INFO] Apache CloudStack Plugin - RabbitMQ Event Bus ..... SUCCESS [4.068s]
[INFO] Apache CloudStack Plugin - Hypervisor Simulator ... SUCCESS [6.654s]
[INFO] Apache CloudStack Plugin - Network Elastic Load Balancer SUCCESS [5.119s]
[INFO] Apache CloudStack Plugin - Network Nicira NVP ..... SUCCESS [12.578s]
[INFO] Apache CloudStack Plugin - BigSwitch Virtual Network Segment SUCCESS [9.350s]
[INFO] Apache CloudStack Plugin - Storage Allocator Random SUCCESS [3.721s]
[INFO] Apache CloudStack Plugin - User Authenticator LDAP SUCCESS [3.841s]
[INFO] Apache CloudStack Plugin - User Authenticator MD5 . SUCCESS [3.783s]
[INFO] Apache CloudStack Plugin - User Authenticator Plain Text SUCCESS [3.703s]
[INFO] Apache CloudStack Plugin - User Authenticator SHA256 Salted SUCCESS [6.938s]
[INFO] Apache CloudStack Plugin - Dns Notifier Example ... SUCCESS [3.701s]
[INFO] Apache CloudStack Engine Storage Image Component .. SUCCESS [4.223s]
[INFO] Apache CloudStack Plugin - Storage Image S3 ....... SUCCESS [0.968s]
[INFO] Apache CloudStack Engine Storage Volume Component . SUCCESS [7.296s]
[INFO] Apache CloudStack Plugin - Storage Volume solidfire SUCCESS [6.454s]
[INFO] Apache CloudStack Cloud Engine Compute Component .. SUCCESS [3.308s]
[INFO] Apache CloudStack Cloud Engine API ................ SUCCESS [3.182s]
[INFO] Apache CloudStack Cloud Engine Orchestration Component SUCCESS [9.526s]
[INFO] Apache CloudStack Cloud Engine Schema Component ... SUCCESS [0.841s]
[INFO] Apache CloudStack Engine Storage Backup Component . SUCCESS [3.327s]
[INFO] Apache CloudStack Engine Storage Image Motion Component SUCCESS [3.880s]
[INFO] Apache CloudStack Engine Storage Snapshot Component SUCCESS [4.145s]
[INFO] Apache CloudStack Client UI ....................... SUCCESS [11.430s]
[INFO] Apache CloudStack Test ............................ SUCCESS [6.656s]
[INFO] Apache CloudStack Engine Storage integration test Component SUCCESS [5.166s]
[INFO] Apache CloudStack Cloud Engine Service ............ SUCCESS [8.305s]
[INFO] Apache CloudStack AWS API Bridge .................. FAILURE [1.488s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6:19.165s
[INFO] Finished at: Fri Sep 13 06:31:34 JST 2013
[INFO] Final Memory: 53M/416M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project cloud-awsapi: Compilation failure: Compilation failure:
[ERROR] error: error reading /root/.m2/repository/org/apache/axis2/mex/1.5.4/mex-1.5.4-impl.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/axis2/axis2-mtompolicy/1.5.4/axis2-mtompolicy-1.5.4.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/ws/commons/axiom/axiom-dom/1.2.10/axiom-dom-1.2.10.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/opensaml/opensaml1/1.1/opensaml1-1.1.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar; error in opening zip file
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :cloud-awsapi
error: Bad exit status from /var/tmp/rpm-tmp.uKNLdw (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.uKNLdw (%build)
# file /root/.m2/repository/org/apache/axis2/mex/1.5.4/mex-1.5.4-impl.jar
/root/.m2/repository/org/apache/axis2/mex/1.5.4/mex-1.5.4-impl.jar: HTML document text
# file /root/.m2/repository/org/apache/axis2/axis2-mtompolicy/1.5.4/axis2-mtompolicy-1.5.4.jar
/root/.m2/repository/org/apache/axis2/axis2-mtompolicy/1.5.4/axis2-mtompolicy-1.5.4.jar: HTML document text
# file /root/.m2/repository/org/apache/ws/commons/axiom/axiom-dom/1.2.10/axiom-dom-1.2.10.jar
/root/.m2/repository/org/apache/ws/commons/axiom/axiom-dom/1.2.10/axiom-dom-1.2.10.jar: HTML document text
# file /root/.m2/repository/org/opensaml/opensaml1/1.1/opensaml1-1.1.jar
/root/.m2/repository/org/opensaml/opensaml1/1.1/opensaml1-1.1.jar: HTML document text
# file /root/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar
/root/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar: HTML document text
# cd /root/.m2/repository/org/apache/axis2/mex/1.5.4/
# mv mex-1.5.4-impl.jar mex-1.5.4-impl.jar.html
# wget http://mirrors.ibiblio.org/maven2/org/apache/axis2/mex/1.5.4/mex-1.5.4-impl.jar
# file mex-1.5.4-impl.jar
mex-1.5.4-impl.jar: Zip archive data, at least v1.0 to extract
# cd /root/.m2/repository/org/apache/axis2/axis2-mtompolicy/1.5.4/
# mv axis2-mtompolicy-1.5.4.jar axis2-mtompolicy-1.5.4.jar.html
# wget http://mirrors.ibiblio.org/maven2/org/apache/axis2/axis2-mtompolicy/1.5.4/axis2-mtompolicy-1.5.4.jar
# file axis2-mtompolicy-1.5.4.jar
axis2-mtompolicy-1.5.4.jar: Zip archive data, at least v1.0 to extract
# cd /root/.m2/repository/org/apache/ws/commons/axiom/axiom-dom/1.2.10/
# mv axiom-dom-1.2.10.jar axiom-dom-1.2.10.jar.html
# wget http://mirrors.ibiblio.org/maven2/org/apache/ws/commons/axiom/axiom-dom/1.2.10/axiom-dom-1.2.10.jar
# cd /root/.m2/repository/org/opensaml/opensaml1/1.1/
# mv opensaml1-1.1.jar opensaml1-1.1.jar.html
# wget http://mirrors.ibiblio.org/maven2/org/opensaml/opensaml1/1.1/opensaml1-1.1.jar
# cd /root/.m2/repository/commons-lang/commons-lang/2.3/
# mv commons-lang-2.3.jar commons-lang-2.3.jar.html
# wget http://mirrors.ibiblio.org/maven2/commons-lang/commons-lang/2.3/commons-lang-2.3.jar
# cd /root/apache-cloudstack-4.1.1-src/packaging/centos63/
# ./package.sh
Wrote: /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/SRPMS/cloudstack-4.1.1-0.el6.src.rpm
Wrote: /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/RPMS/x86_64/cloudstack-management-4.1.1-0.el6.x86_64.rpm
Wrote: /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/RPMS/x86_64/cloudstack-common-4.1.1-0.el6.x86_64.rpm
Wrote: /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/RPMS/x86_64/cloudstack-agent-4.1.1-0.el6.x86_64.rpm
Wrote: /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/RPMS/x86_64/cloudstack-usage-4.1.1-0.el6.x86_64.rpm
Wrote: /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/RPMS/x86_64/cloudstack-cli-4.1.1-0.el6.x86_64.rpm
Wrote: /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/RPMS/x86_64/cloudstack-awsapi-4.1.1-0.el6.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.SPN9Hm
+ umask 022
+ cd /root/apache-cloudstack-4.1.1-src/packaging/centos63/../../dist/rpmbuild/BUILD
+ cd cloudstack-4.1.1
+ '[' /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/BUILDROOT/cloudstack-4.1.1-0.el6.x86_64 '!=' / ']'
+ rm -rf /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/BUILDROOT/cloudstack-4.1.1-0.el6.x86_64
+ exit 0
error: File /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/ is not a regular file.
# ls /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/RPMS/x86_64
cloudstack-agent-4.1.1-0.el6.x86_64.rpm cloudstack-cli-4.1.1-0.el6.x86_64.rpm cloudstack-management-4.1.1-0.el6.x86_64.rpm
cloudstack-awsapi-4.1.1-0.el6.x86_64.rpm cloudstack-common-4.1.1-0.el6.x86_64.rpm cloudstack-usage-4.1.1-0.el6.x86_64.rpm
# cd /root/apache-cloudstack-4.1.1-src/dist/rpmbuild/RPMS/x86_64
# createrepo .
Spawning worker 0 with 6 pkgs
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
# cat > /etc/yum.repos.d/cloudstack.repo
[apache-cloudstack-4.1]
name=Apache CloudStack 4.1 with PCI Pass-through support
baseurl=file:///root/apache-cloudstack-4.1.1-src/dist/rpmbuild/RPMS/x86_64
enabled=1
gpgcheck=0
# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.riken.jp
* extras: ftp.riken.jp
* updates: ftp.riken.jp
apache-cloudstack-4.1 | 2.9 kB 00:00 ...
apache-cloudstack-4.1/primary_db | 6.5 kB 00:00 ...
Setting up Update Process
No Packages marked for Update
# touch /var/local/pci-attach-list
# added intel_iommu=on to /boot/grub/grub.conf
# reboot
# dmesg | grep IOMMU
Intel-IOMMU: enabled
dmar: IOMMU 0: reg_base_addr fed90000 ver 1:0 cap c9008020660262 ecap f0105a
IOMMU 0xfed90000: using Queued invalidation
IOMMU: Setting RMRR:
IOMMU: Setting identity map for device 0000:00:1d.0 [0xdeb11000 - 0xdeb2d000]
IOMMU: Setting identity map for device 0000:00:1a.0 [0xdeb11000 - 0xdeb2d000]
IOMMU: Setting identity map for device 0000:00:14.0 [0xdeb11000 - 0xdeb2d000]
IOMMU: Prepare 0-16MiB unity mapping for LPC
IOMMU: Setting identity map for device 0000:00:1f.0 [0x0 - 0x1000000]
# cat LibvirtComputingResource.java.patch
--- plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java.orig 2013-09-13 05:57:43.217108879 +0900
+++ plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java 2013-09-13 06:00:49.025120076 +0900
@@ -3091,6 +3091,7 @@
DevicesDef devices = new DevicesDef();
devices.setEmulatorPath(_hypervisorPath);
+ devices.setDomainName(vmTO.getName());
SerialDef serial = new SerialDef("pty", null, (short) 0);
devices.addDevice(serial);
# cat LibvirtVMDef.java.patch
--- plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java.orig 2013-09-13 05:57:50.438109632 +0900
+++ plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java 2013-09-13 06:05:12.642103729 +0900
@@ -16,6 +16,7 @@
// under the License.
package com.cloud.hypervisor.kvm.resource;
+import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -273,6 +274,7 @@
public static class DevicesDef {
private String _emulator;
+ private String _domName;
private final Map<String, List<?>> devices = new HashMap<String, List<?>>();
public boolean addDevice(Object device) {
@@ -292,6 +294,45 @@
_emulator = emulator;
}
+ public void setDomainName(String domName) {
+ _domName = domName;
+ }
+
+ public String getHostPCIDeviceXml(String instanceName) {
+ try {
+ BufferedReader br = new BufferedReader(new FileReader("/var/local/pci-attach-list"));
+ String line;
+ while ( (line = br.readLine()) != null ) {
+ String domname = line.split(" ")[0];
+ String deviceid = line.split(" ")[1];
+
+ if ( domname.equals(instanceName) ) {
+ String bus = deviceid.split("[:.]")[0];
+ String slot = deviceid.split("[:.]")[1];
+ String function = deviceid.split("[:.]")[2];
+
+ String xmlstr = "<hostdev mode='subsystem' type='pci' managed='yes'>\n" +
+ " <source>\n" +
+ " <address domain='0x0000'" +
+ " bus='0x" + bus +
+ "' slot='0x" + slot +
+ "' function='0x" + function + "'/>\n" +
+ " </source>\n" +
+ "</hostdev>\n";
+ return xmlstr;
+ }
+ }
+ return null;
+ }
+ catch (FileNotFoundException e) {
+ return null;
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
@Override
public String toString() {
StringBuilder devicesBuilder = new StringBuilder();
@@ -306,6 +347,12 @@
devicesBuilder.append(dev.toString());
}
}
+
+ String pciDeviceXml = getHostPCIDeviceXml(_domName);
+ if ( pciDeviceXml != null ) {
+ devicesBuilder.append(pciDeviceXml);
+ }
+
devicesBuilder.append("</devices>\n");
return devicesBuilder.toString();
}
--- plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java.orig 2013-09-13 05:57:43.217108879 +0900
+++ plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java 2013-09-13 06:00:49.025120076 +0900
@@ -3091,6 +3091,7 @@
DevicesDef devices = new DevicesDef();
devices.setEmulatorPath(_hypervisorPath);
+ devices.setDomainName(vmTO.getName());
SerialDef serial = new SerialDef("pty", null, (short) 0);
devices.addDevice(serial);
--- plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java.orig 2013-09-13 05:57:50.438109632 +0900
+++ plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java 2013-09-13 06:05:12.642103729 +0900
@@ -16,6 +16,7 @@
// under the License.
package com.cloud.hypervisor.kvm.resource;
+import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -273,6 +274,7 @@
public static class DevicesDef {
private String _emulator;
+ private String _domName;
private final Map<String, List<?>> devices = new HashMap<String, List<?>>();
public boolean addDevice(Object device) {
@@ -292,6 +294,45 @@
_emulator = emulator;
}
+ public void setDomainName(String domName) {
+ _domName = domName;
+ }
+
+ public String getHostPCIDeviceXml(String instanceName) {
+ try {
+ BufferedReader br = new BufferedReader(new FileReader("/var/local/pci-attach-list"));
+ String line;
+ while ( (line = br.readLine()) != null ) {
+ String domname = line.split(" ")[0];
+ String deviceid = line.split(" ")[1];
+
+ if ( domname.equals(instanceName) ) {
+ String bus = deviceid.split("[:.]")[0];
+ String slot = deviceid.split("[:.]")[1];
+ String function = deviceid.split("[:.]")[2];
+
+ String xmlstr = "<hostdev mode='subsystem' type='pci' managed='yes'>\n" +
+ " <source>\n" +
+ " <address domain='0x0000'" +
+ " bus='0x" + bus +
+ "' slot='0x" + slot +
+ "' function='0x" + function + "'/>\n" +
+ " </source>\n" +
+ "</hostdev>\n";
+ return xmlstr;
+ }
+ }
+ return null;
+ }
+ catch (FileNotFoundException e) {
+ return null;
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
@Override
public String toString() {
StringBuilder devicesBuilder = new StringBuilder();
@@ -306,6 +347,12 @@
devicesBuilder.append(dev.toString());
}
}
+
+ String pciDeviceXml = getHostPCIDeviceXml(_domName);
+ if ( pciDeviceXml != null ) {
+ devicesBuilder.append(pciDeviceXml);
+ }
+
devicesBuilder.append("</devices>\n");
return devicesBuilder.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment