Merge branch 'master' into vim51_win8

Conflicts:
	setup/db/db/schema-40to410.sql
This commit is contained in:
Min Chen 2013-03-01 16:46:58 -08:00
commit 8b9c45b96d
69 changed files with 789 additions and 364 deletions

View File

@ -35,8 +35,6 @@
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>
<build>

View File

@ -454,6 +454,10 @@ public class ApiConstants {
public static final String GUEST_VM_CIDR = "guestvmcidr";
public static final String NETWORK_CIDR = "networkcidr";
public static final String RESERVED_IP_RANGE = "reservediprange";
public static final String UCS_MANAGER_ID = "ucsmanagerid";
public static final String UCS_PROFILE_DN = "profiledn";
public static final String UCS_BLADE_DN = "bladedn";
public static final String UCS_BLADE_ID = "bladeid";
public enum HostDetails {
all, capacity, events, stats, min;

View File

@ -20,6 +20,7 @@ import javax.ejb.Local;
import org.apache.log4j.Logger;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.springframework.stereotype.Component;
import com.cloud.bridge.model.CloudStackUserVO;
import com.cloud.bridge.util.EncryptionSecretKeyCheckerUtil;
@ -28,6 +29,7 @@ import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.Transaction;
@Component
@Local(value={CloudStackUserDao.class})
public class CloudStackUserDaoImpl extends GenericDaoBase<CloudStackUserVO, String> implements CloudStackUserDao {
public static final Logger logger = Logger.getLogger(CloudStackUserDaoImpl.class);

View File

@ -85,11 +85,6 @@
<artifactId>cloud-plugin-hypervisor-xen</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-hypervisor-ovm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-hypervisor-baremetal</artifactId>
@ -100,6 +95,11 @@
<artifactId>cloud-plugin-hypervisor-ucs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-hypervisor-ovm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-hypervisor-kvm</artifactId>
@ -268,15 +268,9 @@
</goals>
<configuration>
<target>
<exec executable="mkdir">
<arg value="-p" />
<arg value="${basedir}/target/generated-webapp/WEB-INF/classes/scripts" />
</exec>
<exec executable="cp">
<arg value="-r" />
<arg value="${basedir}/../scripts" />
<arg value="${basedir}/target/generated-webapp/WEB-INF/classes/" />
</exec>
<copy todir="${basedir}/target/generated-webapp/WEB-INF/classes/scripts">
<fileset dir="${basedir}/../scripts" />
</copy>
<copy
todir="${basedir}/target/generated-webapp/WEB-INF/">
<fileset dir="${basedir}/WEB-INF/">

View File

@ -57,6 +57,9 @@
<bean id="BaremetalKickStartPxeService" class="com.cloud.baremetal.networkservice.BaremetalKickStartServiceImpl"/>
<bean id="BaremetalPingPxeService" class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl" />
<bean id="BaremetalPxeManager" class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl" />
<bean id="UcsManager" class="com.cloud.ucs.manager.UcsManagerImpl" />
<bean id="UcsBladeDao" class="com.cloud.ucs.database.UcsBladeDaoImpl" />
<bean id="UcsManagerDao" class="com.cloud.ucs.database.UcsManagerDaoImpl" />
<!--

View File

@ -282,6 +282,7 @@ under the License.
<dao name="CloudStackSvcOfferingDao" class="com.cloud.bridge.persist.dao.CloudStackSvcOfferingDaoImpl" singleton="false"/>
<dao name="OfferingDao" class="com.cloud.bridge.persist.dao.OfferingDaoImpl" singleton="false"/>
<dao name="CloudStackAccountDao" class="com.cloud.bridge.persist.dao.CloudStackAccountDaoImpl" singleton="false"/>
<dao name="CloudStackUserDao" class="com.cloud.bridge.persist.dao.CloudStackUserDaoImpl" singleton="false"/>
</awsapi-ec2server>
<awsapi-s3server class="com.cloud.bridge.service.S3RestServlet">

View File

@ -15,11 +15,11 @@
# specific language governing permissions and limitations
# under the License.
/etc/cloud/agent/agent.properties
/etc/cloud/agent/environment.properties
/etc/cloud/agent/log4j-cloud.xml
/etc/init.d/cloud-agent
/etc/cloudstack/agent/agent.properties
/etc/cloudstack/agent/environment.properties
/etc/cloudstack/agent/log4j-cloud.xml
/etc/init.d/cloudstack-agent
/usr/bin/cloud-setup-agent
/usr/bin/cloud-ssh
/var/log/cloudstack/agent
/usr/share/cloudstack-agent/lib/cloudstack-agent-kvm.jar
/usr/share/cloudstack-agent/lib/*

View File

@ -15,8 +15,6 @@
# specific language governing permissions and limitations
# under the License.
/usr/share/cloudstack-common/lib/cloudstack-core.jar
/usr/share/cloudstack-common/lib/cloudstack-api.jar
/usr/share/cloudstack-common/vms/systemvm.iso
/usr/share/cloudstack-common/scripts/installer/*
/usr/share/cloudstack-common/scripts/network/*

View File

@ -15,9 +15,9 @@
# specific language governing permissions and limitations
# under the License.
/etc/cloud/server/*
/etc/cloud/management/*
/etc/init.d/cloud-management
/etc/cloudstack/server/*
/etc/cloudstack/management/*
/etc/init.d/cloudstack-management
/var/cache/cloudstack/management
/var/cache/cloudstack/management/work
/var/cache/cloudstack/management/temp

View File

@ -16,6 +16,6 @@
# under the License.
/usr/share/cloudstack-usage/lib/cloudstack-usage.jar
/etc/init.d/cloud-usage
/etc/init.d/cloudstack-usage
/var/log/cloudstack/usage
/etc/cloud/usage/*
/etc/cloudstack/usage/*

2
debian/control vendored
View File

@ -22,7 +22,7 @@ Description: CloudStack server library
Package: cloudstack-agent
Architecture: all
Depends: openjdk-6-jre | openjdk-7-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), openssh-client, libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, wget, jsvc
Depends: openjdk-6-jre | openjdk-7-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), libcommons-daemon-java, openssh-client, libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, wget, jsvc
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
Description: CloudStack agent
The CloudStack agent is in charge of managing shared computing resources in

104
debian/rules vendored
View File

@ -12,6 +12,8 @@
DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[~-].*//')
PACKAGE = $(shell dh_listpackages|head -n 1|cut -d '-' -f 1)
SYSCONFDIR = "/etc"
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
@ -48,85 +50,85 @@ install:
dh_prep -s
# Common packages
mkdir -p debian/tmp/etc/cloud
mkdir -p debian/tmp/etc/init.d
mkdir -p debian/tmp/var/cache/cloudstack
mkdir -p debian/tmp/var/log/cloudstack
mkdir -p debian/tmp$(SYSCONFDIR)/$(PACKAGE)
mkdir -p debian/tmp$(SYSCONFDIR)/init.d
mkdir -p debian/tmp/var/cache/$(PACKAGE)
mkdir -p debian/tmp/var/log/$(PACKAGE)
mkdir -p debian/tmp/var/lib/cloud
mkdir -p debian/tmp/usr/bin
mkdir -p debian/tmp/usr/share/cloud
mkdir -p debian/tmp/usr/lib/cloud
# cloudstack-agent
mkdir debian/tmp/etc/cloud/agent
mkdir debian/tmp/var/log/cloudstack/agent
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-agent/lib/cloudstack-agent-kvm.jar
install -D packaging/debian/init/cloud-agent debian/tmp/etc/init.d/
mkdir debian/tmp$(SYSCONFDIR)/$(PACKAGE)/agent
mkdir debian/tmp/var/log/$(PACKAGE)/agent
install -D agent/target/cloud-agent-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/$(PACKAGE)-agent/lib/$(PACKAGE)-agent.jar
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/$(PACKAGE)-agent/lib/
install -D plugins/hypervisors/kvm/target/dependencies/* debian/tmp/usr/share/$(PACKAGE)-agent/lib/
install -D packaging/debian/init/cloud-agent debian/tmp$(SYSCONFDIR)/init.d/$(PACKAGE)-agent
install -D agent/bindir/cloud-setup-agent.in debian/tmp/usr/bin/cloud-setup-agent
install -D agent/bindir/cloud-ssh.in debian/tmp/usr/bin/cloud-ssh
cp agent/target/transformed/* debian/tmp/etc/cloud/agent
install -D agent/target/transformed/* debian/tmp$(SYSCONFDIR)/$(PACKAGE)/agent
# cloudstack-management
mkdir debian/tmp/etc/cloud/server
mkdir debian/tmp/etc/cloud/management
mkdir -p debian/tmp/usr/share/cloudstack-management
mkdir -p debian/tmp/usr/share/cloudstack-management/webapps/client
mkdir debian/tmp/usr/share/cloudstack-management/setup
mkdir debian/tmp/var/log/cloudstack/management
mkdir debian/tmp/var/cache/cloudstack/management
mkdir debian/tmp/var/cache/cloudstack/management/work
mkdir debian/tmp/var/cache/cloudstack/management/temp
mkdir debian/tmp/var/log/cloudstack/ipallocator
mkdir debian/tmp$(SYSCONFDIR)/$(PACKAGE)/server
mkdir debian/tmp$(SYSCONFDIR)/$(PACKAGE)/management
mkdir -p debian/tmp/usr/share/$(PACKAGE)-management
mkdir -p debian/tmp/usr/share/$(PACKAGE)-management/webapps/client
mkdir debian/tmp/usr/share/$(PACKAGE)-management/setup
mkdir debian/tmp/var/log/$(PACKAGE)/management
mkdir debian/tmp/var/cache/$(PACKAGE)/management
mkdir debian/tmp/var/cache/$(PACKAGE)/management/work
mkdir debian/tmp/var/cache/$(PACKAGE)/management/temp
mkdir debian/tmp/var/log/$(PACKAGE)/ipallocator
mkdir debian/tmp/var/lib/cloud/management
mkdir debian/tmp/var/lib/cloud/mnt
cp -r client/target/utilities/scripts/db/* debian/tmp/usr/share/cloudstack-management/setup/
cp -r client/target/cloud-client-ui-4.2.0-SNAPSHOT/* debian/tmp/usr/share/cloudstack-management/webapps/client/
cp server/target/conf/* debian/tmp/etc/cloud/server/
cp client/target/conf/* debian/tmp/etc/cloud/management/
ln -s tomcat6-nonssl.conf debian/tmp/etc/cloud/management/tomcat6.conf
mkdir -p debian/tmp/etc/cloud/management/Catalina/localhost/client
install -D packaging/debian/init/cloud-management debian/tmp/etc/init.d/cloud-management
cp -r client/target/utilities/scripts/db/* debian/tmp/usr/share/$(PACKAGE)-management/setup/
cp -r client/target/cloud-client-ui-4.2.0-SNAPSHOT/* debian/tmp/usr/share/$(PACKAGE)-management/webapps/client/
cp server/target/conf/* debian/tmp$(SYSCONFDIR)/$(PACKAGE)/server/
cp client/target/conf/* debian/tmp$(SYSCONFDIR)/$(PACKAGE)/management/
ln -s tomcat6-nonssl.conf debian/tmp$(SYSCONFDIR)/$(PACKAGE)/management/tomcat6.conf
mkdir -p debian/tmp$(SYSCONFDIR)/$(PACKAGE)/management/Catalina/localhost/client
install -D packaging/debian/init/cloud-management debian/tmp$(SYSCONFDIR)/init.d/$(PACKAGE)-management
install -D client/bindir/cloud-update-xenserver-licenses.in debian/tmp/usr/bin/cloud-update-xenserver-licenses
install -D server/target/cloud-server-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-management/lib/cloudstack-server.jar
ln -s /usr/share/tomcat6/bin debian/tmp/usr/share/cloudstack-management/bin
ln -s ../../../etc/cloud/management debian/tmp/usr/share/cloudstack-management/conf
ln -s /usr/share/tomcat6/lib debian/tmp/usr/share/cloudstack-management/lib
ln -s ../../../var/log/cloudstack/management debian/tmp/usr/share/cloudstack-management/logs
ln -s ../../../var/cache/cloudstack/management/temp debian/tmp/usr/share/cloudstack-management/temp
ln -s ../../../var/cache/cloudstack/management/work debian/tmp/usr/share/cloudstack-management/work
install -D server/target/cloud-server-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/$(PACKAGE)-management/lib/$(PACKAGE)-server.jar
ln -s /usr/share/tomcat6/bin debian/tmp/usr/share/$(PACKAGE)-management/bin
ln -s ../../..$(SYSCONFDIR)/$(PACKAGE)/management debian/tmp/usr/share/$(PACKAGE)-management/conf
ln -s /usr/share/tomcat6/lib debian/tmp/usr/share/$(PACKAGE)-management/lib
ln -s ../../../var/log/$(PACKAGE)/management debian/tmp/usr/share/$(PACKAGE)-management/logs
ln -s ../../../var/cache/$(PACKAGE)/management/temp debian/tmp/usr/share/$(PACKAGE)-management/temp
ln -s ../../../var/cache/$(PACKAGE)/management/work debian/tmp/usr/share/$(PACKAGE)-management/work
# cloudstack-common
mkdir -p debian/tmp/usr/share/cloudstack-common
mkdir debian/tmp/usr/share/cloudstack-common/scripts
mkdir debian/tmp/usr/share/cloudstack-common/setup
cp -r scripts/installer debian/tmp/usr/share/cloudstack-common/scripts
cp -r scripts/network debian/tmp/usr/share/cloudstack-common/scripts
cp -r scripts/storage debian/tmp/usr/share/cloudstack-common/scripts
cp -r scripts/util debian/tmp/usr/share/cloudstack-common/scripts
cp -r scripts/vm debian/tmp/usr/share/cloudstack-common/scripts
mkdir -p debian/tmp/usr/share/$(PACKAGE)-common
mkdir debian/tmp/usr/share/$(PACKAGE)-common/scripts
mkdir debian/tmp/usr/share/$(PACKAGE)-common/setup
cp -r scripts/installer debian/tmp/usr/share/$(PACKAGE)-common/scripts
cp -r scripts/network debian/tmp/usr/share/$(PACKAGE)-common/scripts
cp -r scripts/storage debian/tmp/usr/share/$(PACKAGE)-common/scripts
cp -r scripts/util debian/tmp/usr/share/$(PACKAGE)-common/scripts
cp -r scripts/vm debian/tmp/usr/share/$(PACKAGE)-common/scripts
install -D client/target/utilities/bin/cloud-migrate-databases debian/tmp/usr/bin
install -D client/target/utilities/bin/cloud-set-guest-password debian/tmp/usr/bin
install -D client/target/utilities/bin/cloud-set-guest-sshkey debian/tmp/usr/bin
install -D client/target/utilities/bin/cloud-setup-databases debian/tmp/usr/bin
install -D client/target/utilities/bin/cloud-setup-management debian/tmp/usr/bin
install -D services/console-proxy/server/dist/systemvm.iso debian/tmp/usr/share/cloudstack-common/vms/systemvm.iso
install -D core/target/cloud-core-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-core.jar
install -D api/target/cloud-api-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-api.jar
install -D services/console-proxy/server/dist/systemvm.iso debian/tmp/usr/share/$(PACKAGE)-common/vms/systemvm.iso
# cloudstack-python
mkdir -p debian/tmp/usr/lib/python2.7/dist-packages
cp -r python/lib/cloud* debian/tmp/usr/lib/python2.7/dist-packages
# cloudstack-usage
mkdir debian/tmp/etc/cloud/usage
mkdir debian/tmp/var/log/cloudstack/usage
install -D usage/target/cloud-usage-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-usage/lib/cloudstack-usage.jar
cp usage/target/transformed/* debian/tmp/etc/cloud/usage/
ln -s ../management/db.properties debian/tmp/etc/cloud/usage/db.properties
install -D packaging/debian/init/cloud-usage debian/tmp/etc/init.d
mkdir debian/tmp$(SYSCONFDIR)/$(PACKAGE)/usage
mkdir debian/tmp/var/log/$(PACKAGE)/usage
install -D usage/target/cloud-usage-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/$(PACKAGE)-usage/lib/$(PACKAGE)-usage.jar
cp usage/target/transformed/* debian/tmp$(SYSCONFDIR)/$(PACKAGE)/usage/
ln -s ../management/db.properties debian/tmp$(SYSCONFDIR)/$(PACKAGE)/usage/db.properties
install -D packaging/debian/init/cloud-usage debian/tmp$(SYSCONFDIR)/init.d/$(PACKAGE)-usage
# cloudstack-awsapi
mkdir debian/tmp/var/log/cloudstack/awsapi
mkdir debian/tmp/var/log/$(PACKAGE)/awsapi
dh_installdirs
dh_install

View File

@ -28,12 +28,12 @@
<orderedlist>
<listitem><para>Add a companion non-OVM cluster to the Pod. This cluster provides an environment where the &PRODUCT; System VMs can run. You should have already installed a non-OVM hypervisor on at least one Host to prepare for this step. Depending on which hypervisor you used:</para>
<itemizedlist>
<listitem><para>For VMWare, follow the steps in Add Cluster: vSphere. When finished, return here and continue with the next step.</para></listitem>
<listitem><para>For VMWare, follow the steps in <xref linkend="add-clusters-vsphere"/>. When finished, return here and continue with the next step.</para></listitem>
<listitem><para>For KVM or XenServer, follow the steps in <xref linkend="add-clusters-kvm-xenserver"/>. When finished, return here and continue with the next step</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>In the left navigation, choose Infrastructure. In Zones, click View More, then click the zone in which you want to add the cluster.</para></listitem>
<listitem><para>Click the Compute tab. In the Pods node, click View All. Select the same pod you used in step 1.</para></listitem>
<listitem><para>In the left navigation, choose Infrastructure. In Zones, click View All, then click the zone in which you want to add the cluster.</para></listitem>
<listitem><para>Click the Compute and Storage tab. In the Pods node, click View All.</para></listitem>
<listitem><para>Click View Clusters, then click Add Cluster.</para>
<para>The Add Cluster dialog is displayed.</para></listitem>
<listitem><para>In Hypervisor, choose OVM.</para></listitem>

View File

@ -24,7 +24,7 @@
<section id="added-error-codes">
<title>Added &PRODUCT; Error Codes</title>
<para>You can now find the &PRODUCT;-specific error code in the exception response for each type of exception. The following list of error codes is added to the new class named CSExceptionErrorCode. These codes are applicable in &PRODUCT; 3.0.3 and later versions.</para>
<para>You can now find the &PRODUCT;-specific error code in the exception response for each type of exception. The following list of error codes is added to the new class named CSExceptionErrorCode.</para>
<informaltable frame="all">
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<colspec colname="c1" />

View File

@ -28,14 +28,13 @@
<para>The software that provides AWS API compatibility is installed along with &PRODUCT;. You must enable the services and perform some setup steps prior to using it.
</para>
<orderedlist>
<listitem><para>Set the global configuration parameters for each service to true.
<listitem id="set-global-config"><para>Set the global configuration parameters for each service to true.
See <xref linkend="global-config" />.</para></listitem>
<listitem><para>Create a set of &PRODUCT; service offerings with names that match the Amazon service offerings.
You can do this through the &PRODUCT; UI as described in the Administration Guide.</para>
<warning><para>Be sure you have included the Amazon default service offering, m1.small. As well as any EC2 instance types that you will use.</para></warning>
</listitem>
<listitem><para>If you did not already do so when you set the configuration parameter in step 1,
restart the Management Server.</para>
<listitem><para>If you did not already do so when you set the configuration parameter in step <xref linkend="set-global-config"/>, restart the Management Server.</para>
<programlisting># service cloud-management restart</programlisting>
</listitem>
</orderedlist>

View File

@ -45,7 +45,7 @@
<title>AWS API User Registration</title>
<para>Each user must perform a one-time registration. The user follows these steps:</para>
<orderedlist>
<listitem>
<listitem id="obtain-access-secret-keys">
<para>Obtain the following by looking in the &PRODUCT; UI, using the API, or asking the cloud administrator:
</para>
<itemizedlist>
@ -69,7 +69,7 @@
<programlisting>wget -O cloudstack-aws-api-register <ulink url="https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=awsapi-setup/setup/cloudstack-aws-api-register;hb=HEAD">"https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob_plain;f=awsapi-setup/setup/cloudstack-aws-api-register;hb=HEAD"</ulink>
</programlisting>
</para>
<para> Then execute it, using the parameter values that were obtained in step 1. An example is shown below.</para>
<para> Then execute it, using the access and secret keys that were obtained in step <xref linkend="obtain-access-secret-keys"/>. An example is shown below.</para>
<para>
<programlisting>$ cloudstack-aws-api-register --apikey=<replaceable>Users &PRODUCT; API key</replaceable> --secretkey=<replaceable>Users &PRODUCT; Secret key</replaceable> --cert=<replaceable>/path/to/cert.pem</replaceable> --url=http://<replaceable>&PRODUCT;.server</replaceable>:7080/awsapi</programlisting>
</para>

View File

@ -38,8 +38,8 @@
</listitem>
<listitem><para>In the Update SSL Certificate screen of the &PRODUCT; UI, paste the following</para>
<itemizedlist>
<listitem><para>Certificate from step 1(c).</para></listitem>
<listitem><para>Private key from step 1(e).</para></listitem>
<listitem><para>The Certificate you generated in the previous steps.</para></listitem>
<listitem><para>The Private key you generated in the previous steps.</para></listitem>
<listitem><para>The desired new domain name; for example, company.com</para></listitem>
</itemizedlist>
</listitem>

View File

@ -261,15 +261,15 @@ server 3.xenserver.pool.ntp.org
<para>Connect FiberChannel cable to all hosts in the cluster and to the FiberChannel storage
host.</para>
</listitem>
<listitem>
<listitem id="rescan-scsi">
<para>Rescan the SCSI bus. Either use the following command or use XenCenter to perform an
HBA rescan.</para>
<programlisting># scsi-rescan</programlisting>
</listitem>
<listitem>
<para>Repeat step 2 on every host.</para>
<para>Repeat step <xref linkend="rescan-scsi"/> on every host.</para>
</listitem>
<listitem>
<listitem id="verify-scsi">
<para>Check to be sure you see the new SCSI disk.</para>
<programlisting># ls /dev/disk/by-id/scsi-360a98000503365344e6f6177615a516b -l</programlisting>
<para>The output should look like this, although the specific file name will be different
@ -279,7 +279,7 @@ server 3.xenserver.pool.ntp.org
</programlisting>
</listitem>
<listitem>
<para>Repeat step 4 on every host.</para>
<para>Repeat step <xref linkend="verify-scsi"/> on every host.</para>
</listitem>
<listitem>
<para>On the storage server, run this command to get a unique ID for the new SR.</para>

View File

@ -108,10 +108,10 @@
<para>In the Update SSL Certificate screen of the &PRODUCT; UI, paste the following:</para>
<itemizedlist>
<listitem>
<para>Certificate from step 1(c).</para>
<para>The certificate you've just generated.</para>
</listitem>
<listitem>
<para>Private key from step 1(e).</para>
<para>The private key you've just generated.</para>
</listitem>
<listitem>
<para>The desired new domain name; for example, company.com</para>

View File

@ -24,7 +24,6 @@
<section id="create-bare-metal-template">
<title>Creating a Bare Metal Template</title>
<note><para><emphasis role="bold">Beta feature. Untested in &PRODUCT; 3.0.3. Provided without guarantee of performance</emphasis>.</para></note>
<para>Before you can create a bare metal template, you must have performed several other installation and setup steps to create a bare metal cluster and environment. See Bare Metal Installation in the Installation Guide. It is assumed you already have a directory named "win7_64bit" on your CIFS server, containing the image for the bare metal instance. This directory and image are set up as part of the Bare Metal Installation procedure.</para>
<orderedlist>
<listitem><para>Log in to the &PRODUCT; UI as an administrator or end user.</para></listitem>

View File

@ -23,7 +23,7 @@
<section id="creating-vms">
<title>Creating VMs</title>
<para>Virtual machines are usually created from a template. Users can also create blank virtual machines. A blank virtual machine is a virtual machine without an OS template. Users can attach an ISO file and install the OS from the CD/DVD-ROM.</para>
<note><para>Starting with v3.0.3, you can create a VM without starting it. You can determine whether the VM needs to be started as part of the VM deployment. A new request parameter, startVM, is introduced in the deployVm API to support this feature. For more information, see the Developer's Guide</para></note>
<note><para>You can create a VM without starting it. You can determine whether the VM needs to be started as part of the VM deployment. A request parameter, startVM, in the deployVm API provides this feature. For more information, see the Developer's Guide</para></note>
<para>To create a VM from a template:</para>
<orderedlist>
<listitem><para>Log in to the &PRODUCT; UI as an administrator or user.</para></listitem>

View File

@ -24,7 +24,7 @@
<section id="dedicated-ha-hosts">
<title>Dedicated HA Hosts</title>
<para>(v3.0.3 and greater) One or more hosts can be designated for use only by HA-enabled VMs that are restarting due to a host failure. Setting up a pool of such dedicated HA hosts as the recovery destination for all HA-enabled VMs is useful to:</para>
<para>One or more hosts can be designated for use only by HA-enabled VMs that are restarting due to a host failure. Setting up a pool of such dedicated HA hosts as the recovery destination for all HA-enabled VMs is useful to:</para>
<itemizedlist>
<listitem><para>Make it easier to determine which VMs have been restarted as part of the &PRODUCT; high-availability function. If a VM is running on a dedicated HA host, then it must be an HA-enabled VM whose original host failed. (With one exception: It is possible for an administrator to manually migrate any VM to a dedicated HA host.).</para></listitem>
<listitem><para>Keep HA-enabled VMs from restarting on hosts which may be reserved for other purposes.</para></listitem>

View File

@ -25,8 +25,7 @@
<title>Shared Networks</title>
<para>A shared network can be accessed by virtual machines that belong to many different
accounts. Network Isolation on shared networks is accomplished using techniques such as
security groups (supported only in basic zones in &PRODUCT; 3.0.3 and later
versions).</para>
security groups (supported only in basic zones).</para>
<itemizedlist>
<listitem><para>Shared Networks are created by the administrator</para></listitem>
<listitem><para>Shared Networks can be designated to a certain domain</para></listitem>

View File

@ -29,7 +29,7 @@
<para>You cannot upload a volume if the preconfigured volume limit has already been reached. The default limit for the cloud is set in the global configuration parameter max.account.volumes, but administrators can also set per-domain limits that are different from the global default. See Setting Usage Limits </para>
<para>To upload a volume:</para>
<orderedlist>
<listitem><para>(Optional) Create an MD5 hash (checksum) of the disk image file that you are going to upload. After uploading the data disk, &PRODUCT; will use this value to verify that no data corruption has occurred.</para></listitem>
<listitem id="optional-hash"><para>(Optional) Create an MD5 hash (checksum) of the disk image file that you are going to upload. After uploading the data disk, &PRODUCT; will use this value to verify that no data corruption has occurred.</para></listitem>
<listitem><para>Log in to the &PRODUCT; UI as an administrator or user</para></listitem>
<listitem><para>In the left navigation bar, click Storage.</para></listitem>
<listitem><para>Click Upload Volume.</para></listitem>
@ -68,9 +68,9 @@
</informaltable></listitem>
<listitem><para>URL. The secure HTTP or HTTPS URL that &PRODUCT; can use to access your disk. The type of file at the URL must match the value chosen in Format. For example, if Format is VHD, the URL might look like the following:</para>
<para>http://yourFileServerIP/userdata/myDataDisk.vhd</para></listitem>
<listitem><para>MD5 checksum. (Optional) Use the hash that you created in step 1.</para></listitem>
<listitem><para>MD5 checksum. (Optional) Use the hash that you created in step <xref linkend="optional-hash"/>.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>Wait until the status of the volume shows that the upload is complete. Click Instances - Volumes, find the name you specified in step 5, and make sure the status is Uploaded.</para></listitem>
<listitem><para>Wait until the status of the volume shows that the upload is complete. Click Instances - Volumes, find the name you specified in step <xref linkend="optional-hash"/>, and make sure the status is Uploaded.</para></listitem>
</orderedlist>
</section>

View File

@ -24,5 +24,18 @@
<section id="using-vpn-with-mac">
<title>Using VPN with Mac OS X</title>
<para>In Mac OS X, in Network Preferences - Advanced, make sure Send all traffic over VPN connection is not checked.</para>
<para>First, be sure you've configured the VPN settings in your &PRODUCT; install. This section is only concerned with connecting via Mac OS X to your VPN.</para>
<para>Note, these instructions were written on Mac OS X 10.7.5. They may differ slightly in older or newer releases of Mac OS X.</para>
<orderedlist>
<listitem><para>On your Mac, open System Preferences and click Network.</para></listitem>
<listitem><para>Make sure Send all traffic over VPN connection is not checked.</para></listitem>
<listitem><para>If your preferences are locked, you'll need to click the lock in the bottom left-hand corner to make any changes and provide your administrator credentials.</para></listitem>
<listitem><para>You will need to create a new network entry. Click the plus icon on the bottom left-hand side and you'll see a dialog that says "Select the interface and enter a name for the new service." Select VPN from the Interface drop-down menu, and "L2TP over IPSec" for the VPN Type. Enter whatever you like within the "Service Name" field.</para></listitem>
<listitem><para>You'll now have a new network interface with the name of whatever you put in the "Service Name" field. For the purposes of this example, we'll assume you've named it "CloudStack." Click on that interface and provide the IP address of the interface for your VPN under the Server Address field, and the user name for your VPN under Account Name.</para></listitem>
<listitem><para>Click Authentication Settings, and add the user's password under User Authentication and enter the pre-shared IPSec key in the Shared Secret field under Machine Authentication. Click OK.</para></listitem>
<listitem><para>You may also want to click the "Show VPN status in menu bar" but that's entirely optional.</para></listitem>
<listitem><para>Now click "Connect" and you will be connected to the CloudStack VPN.</para></listitem>
</orderedlist>
</section>

View File

@ -26,17 +26,17 @@
<title>Using VPN with Windows</title>
<para>The procedure to use VPN varies by Windows version. Generally, the user must edit the VPN properties and make sure that the default route is not the VPN. The following steps are for Windows L2TP clients on Windows Vista. The commands should be similar for other Windows versions.</para>
<orderedlist>
<listitem><para>Log in to the &PRODUCT; UI and click on the source NAT IP for the account. The VPN tab should display the IPsec preshared key. Make a note of this and the source NAT IP. The UI also lists one or more users and their passwords. Choose one of these users, or, if none exists, add a user and password.</para></listitem>
<listitem id="source-nat"><para>Log in to the &PRODUCT; UI and click on the source NAT IP for the account. The VPN tab should display the IPsec preshared key. Make a note of this and the source NAT IP. The UI also lists one or more users and their passwords. Choose one of these users, or, if none exists, add a user and password.</para></listitem>
<listitem><para>On the Windows box, go to Control Panel, then select Network and Sharing center. Click Setup a connection or network.</para></listitem>
<listitem><para>In the next dialog, select No, create a new connection.</para></listitem>
<listitem><para>In the next dialog, select Use my Internet Connection (VPN).</para></listitem>
<listitem><para>In the next dialog, enter the source NAT IP from step 1 and give the connection a name. Check Don't connect now.</para></listitem>
<listitem><para>In the next dialog, enter the user name and password selected in step 1.</para></listitem>
<listitem><para>In the next dialog, enter the source NAT IP from step <xref linkend="source-nat"/> and give the connection a name. Check Don't connect now.</para></listitem>
<listitem><para>In the next dialog, enter the user name and password selected in step <xref linkend="source-nat"/>.</para></listitem>
<listitem><para>Click Create.</para></listitem>
<listitem><para>Go back to the Control Panel and click Network Connections to see the new connection. The connection is not active yet.</para></listitem>
<listitem><para>Right-click the new connection and select Properties. In the Properties dialog, select the Networking tab.</para></listitem>
<listitem><para>In Type of VPN, choose L2TP IPsec VPN, then click IPsec settings. Select Use preshared key. Enter the preshared key from Step 1.</para></listitem>
<listitem><para>In Type of VPN, choose L2TP IPsec VPN, then click IPsec settings. Select Use preshared key. Enter the preshared key from step <xref linkend="source-nat"/>.</para></listitem>
<listitem><para>The connection is ready for activation. Go back to Control Panel -> Network Connections and double-click the created connection.</para></listitem>
<listitem><para>Enter the user name and password from Step 1.</para></listitem>
<listitem><para>Enter the user name and password from step <xref linkend="source-nat"/>.</para></listitem>
</orderedlist>
</section>

View File

@ -58,8 +58,8 @@ export JAVA_HOME
SCP=""
DCP=""
ACP=`ls /usr/share/cloudstack-agent/cloud-plugin-hypervisor-kvm-*.jar`":"`ls /usr/share/cloudstack-agent/lib/* | tr '\n' ':'`
JCP="/usr/share/java/jna.jar:/usr/share/java/commons-daemon.jar"
ACP=`ls /usr/share/cloudstack-agent/cloud-plugin-hypervisor-kvm-*.jar`":"`ls /usr/share/cloudstack-agent/lib/* | tr '\n' ':' | sed s'/.$//'`
JCP="/usr/share/java/commons-daemon.jar"
# We need to append the JSVC daemon JAR to the classpath
# AgentShell implements the JSVC daemon methods

View File

@ -113,7 +113,6 @@ Requires: libvirt
Requires: bridge-utils
Requires: ebtables
Requires: jsvc
Requires: jna
Requires: jakarta-commons-daemon
Requires: jakarta-commons-daemon-jsvc
Provides: cloud-agent

View File

@ -46,7 +46,7 @@ unset OPTIONS
[ -r /etc/default/"$SHORTNAME" ] && source /etc/default/"$SHORTNAME"
# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT)
JDK_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-ibm"
JDK_DIRS="/usr/lib/jvm/java-7-openjdk-amd64 /usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-sun"
for jdir in $JDK_DIRS; do
if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then
@ -55,9 +55,11 @@ for jdir in $JDK_DIRS; do
done
export JAVA_HOME
ACP=`ls /usr/share/cloudstack-agent/lib/* | tr '\n' ':' | sed s'/.$//'`
# We need to append the JSVC daemon JAR to the classpath
# AgentShell implements the JSVC daemon methods
export CLASSPATH="/usr/share/java/commons-daemon.jar:/usr/share/java/cloud-agent-kvm.jar:/etc/cloud/agent"
export CLASSPATH="/usr/share/java/commons-daemon.jar:$ACP:/etc/cloudstack/agent"
wait_for_network() {
i=1
@ -93,7 +95,7 @@ start() {
wait_for_network
if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -errfile SYSLOG -D jna.nosys=true $CLASS
if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -errfile SYSLOG -Djna.nosys=true $CLASS
RETVAL=$?
then
rc=0

View File

@ -45,7 +45,7 @@ unset OPTIONS
[ -r @SYSCONFDIR@/default/"$SHORTNAME" ] && source @SYSCONFDIR@/default/"$SHORTNAME"
# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT)
JDK_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-sun /usr/lib/jvm/jre-1.6.0 /usr/lib/j2sdk1.5-sun /usr/lib/jre-openjdk"
JDK_DIRS="/usr/lib/jvm/java-7-openjdk-amd64 /usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-sun"
for jdir in $JDK_DIRS; do
if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then

View File

@ -26,37 +26,37 @@ COMPONENTS-SPEC=components-premium.xml
AWSAPILOG=awsapi.log
REMOTEHOST=localhost
AGENTCLASSPATH=
AGENTLOG=/var/log/cloud/agent/agent.log
AGENTLOGDIR=/var/log/cloud/agent/
AGENTSYSCONFDIR=/etc/cloud/agent
APISERVERLOG=/var/log/cloud/management/apilog.log
AWSAPILOG=/var/log/cloud/awsapi/awsapi.log
AGENTLOG=/var/log/cloudstack/agent/agent.log
AGENTLOGDIR=/var/log/cloudstack/agent/
AGENTSYSCONFDIR=/etc/cloudstack/agent
APISERVERLOG=/var/log/cloudstack/management/apilog.log
AWSAPILOG=/var/log/cloudstack/awsapi/awsapi.log
BINDIR=/usr/bin
COMMONLIBDIR=/usr/share/java
COMMONLIBDIR=/usr/share/cloudstack-common
CONFIGUREVARS=
DEPSCLASSPATH=
DOCDIR=
IPALOCATORLOG=/var/log/cloud/management/ipallocator.log
IPALOCATORLOG=/var/log/cloudstack/management/ipallocator.log
JAVADIR=/usr/share/cloudstack-management/webapps/client/WEB-INF/lib
LIBEXECDIR=/usr/libexec
LOCKDIR=/var/lock
MSCLASSPATH=
MSCONF=/etc/cloud/management
MSCONF=/etc/cloudstack/management
MSENVIRON=/usr/share/cloudstack-management
MSLOG=/var/log/cloud/management/management-server.log
MSLOGDIR=/var/log/cloud/management/
MSLOG=/var/log/cloudstack/management/management-server.log
MSLOGDIR=/var/log/cloudstack/management/
MSMNTDIR=/var/lib/cloud/mnt
MSUSER=cloud
PIDDIR=/var/run
PLUGINJAVADIR=
PREMIUMJAVADIR=
PYTHONDIR=/usr/lib/python2.6/site-packages/
SERVERSYSCONFDIR=/etc/cloud/server
SERVERSYSCONFDIR=/etc/cloudstack/server
SETUPDATADIR=/usr/share/cloudstack-management/setup
SYSCONFDIR=/etc
SYSTEMCLASSPATH=
SYSTEMJARS=
USAGECLASSPATH=
USAGELOG=/var/log/cloud/usage
USAGESYSCONFDIR=/etc/cloud/usage
USAGELOG=/var/log/cloudstack/usage
USAGESYSCONFDIR=/etc/cloudstack/usage
PACKAGE=cloud

View File

@ -41,12 +41,13 @@
<dependency>
<groupId>org.libvirt</groupId>
<artifactId>libvirt</artifactId>
<version>0.4.9</version>
<version>${cs.libvirt-java.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>3.5.1</version>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>${cs.jna.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.database;
import com.cloud.utils.db.GenericDao;

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.database;
import javax.ejb.Local;
@ -22,9 +23,8 @@ import org.springframework.stereotype.Component;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.GenericDaoBase;
@Local(value = { UcsBladeDao.class })
@DB(txn = false)
@Component
@Local(value = { UcsBladeDao.class })
@DB(txn = false)
public class UcsBladeDaoImpl extends GenericDaoBase<UcsBladeVO, Long> implements UcsBladeDao {
}

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.database;
import javax.persistence.Column;
@ -22,10 +23,13 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
@Entity
@Table(name="ucs_blade")
public class UcsBladeVO {
public class UcsBladeVO implements InternalIdentity, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
@ -41,8 +45,11 @@ public class UcsBladeVO {
private Long hostId;
@Column(name="dn")
private String dn;
private String dn;
@Column(name="profile_dn")
private String profileDn;
public long getId() {
return id;
}
@ -81,5 +88,13 @@ public class UcsBladeVO {
public void setUuid(String uuid) {
this.uuid = uuid;
}
}
public String getProfileDn() {
return profileDn;
}
public void setProfileDn(String profileDn) {
this.profileDn = profileDn;
}
}

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.database;
import java.util.List;

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.database;
import javax.ejb.Local;
@ -23,9 +24,8 @@ import org.springframework.stereotype.Component;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.GenericDaoBase;
@Local(value = { UcsManagerDao.class })
@DB(txn = false)
@Component
@Local(value = { UcsManagerDao.class })
@DB(txn = false)
public class UcsManagerDaoImpl extends GenericDaoBase<UcsManagerVO, Long> implements UcsManagerDao {
}

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.database;
import javax.persistence.Column;
@ -22,10 +23,13 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
@Entity
@Table(name="ucs_manager")
public class UcsManagerVO {
public class UcsManagerVO implements InternalIdentity, Identity {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import javax.inject.Inject;
@ -25,6 +26,7 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseCmd.CommandType;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
@ -35,33 +37,33 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.server.ManagementService;
import com.cloud.user.Account;
@APICommand(description="Adds a Ucs manager", responseObject=AddUcsManagerResponse.class)
@APICommand(name="addUcsManager", description="Adds a Ucs manager", responseObject=UcsManagerResponse.class)
public class AddUcsManagerCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(AddUcsManagerCmd.class);
@Inject
private UcsManager mgr;
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone id for the ucs manager", required=true)
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, description="the Zone id for the ucs manager", entityType=ZoneResponse.class, required=true)
private Long zoneId;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of UCS manager")
private String name;
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, description="the name of UCS url")
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, description="the name of UCS url", required=true)
private String url;
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, description="the username of UCS")
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, description="the username of UCS", required=true)
private String username;
@Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, description="the password of UCS")
@Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, description="the password of UCS", required=true)
private String password;
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
ResourceAllocationException, NetworkRuleConflictException {
try {
AddUcsManagerResponse rsp = mgr.addUcsManager(this);
UcsManagerResponse rsp = mgr.addUcsManager(this);
rsp.setObjectName("ucsmanager");
rsp.setResponseName(getCommandName());
this.setResponseObject(rsp);

View File

@ -5,22 +5,25 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import javax.inject.Inject;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.log4j.Logger;
@ -30,25 +33,26 @@ import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
@APICommand(description="associate a profile to a blade", responseObject=AssociateUcsProfileToBladesInClusterResponse.class)
@APICommand(name="associatesUscProfileToBlade", description="associate a profile to a blade", responseObject=UcsBladeResponse.class)
public class AssociateUcsProfileToBladeCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(AssociateUcsProfileToBladeCmd.class);
@Inject
private UcsManager mgr;
@Parameter(name=ApiConstants.UCS_MANAGER_ID, type=CommandType.UUID, description="ucs manager id", entityType=UcsManagerResponse.class, required=true)
private Long ucsManagerId;
@Parameter(name=ApiConstants.UCS_PROFILE_DN, type=CommandType.STRING, description="profile dn", required=true)
private String profileDn;
@Parameter(name=ApiConstants.UCS_BLADE_ID, type=CommandType.UUID, entityType=UcsBladeResponse.class, description="blade id", required=true)
private Long bladeId;
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
ResourceAllocationException, NetworkRuleConflictException {
try {
mgr.associateProfileToBlade(this);
AssociateUcsProfileToBladesInClusterResponse rsp = new AssociateUcsProfileToBladesInClusterResponse();
UcsBladeResponse rsp = mgr.associateProfileToBlade(this);
rsp.setResponseName(getCommandName());
rsp.setObjectName("associateucsprofiletobalde");
this.setResponseObject(rsp);
} catch (Exception e) {
s_logger.warn("Exception: ", e);

View File

@ -1,22 +0,0 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.ucs.manager;
import org.apache.cloudstack.api.BaseResponse;
public class AssociateUcsProfileToBladesInClusterResponse extends BaseResponse {
}

View File

@ -0,0 +1,87 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.ucs.manager;
import javax.inject.Inject;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
@APICommand(name="listUcsBlade", description="List ucs blades", responseObject=UcsBladeResponse.class)
public class ListUcsBladeCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListUcsBladeCmd.class);
@Inject
private UcsManager mgr;
@Parameter(name=ApiConstants.UCS_MANAGER_ID, type=CommandType.UUID, description="ucs manager id", entityType=UcsManagerResponse.class, required=true)
private Long ucsManagerId;
public UcsManager getMgr() {
return mgr;
}
public void setMgr(UcsManager mgr) {
this.mgr = mgr;
}
public Long getUcsManagerId() {
return ucsManagerId;
}
public void setUcsManagerId(Long ucsManagerId) {
this.ucsManagerId = ucsManagerId;
}
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
ResourceAllocationException, NetworkRuleConflictException {
try {
ListResponse<UcsBladeResponse> response = mgr.listUcsBlades(this);
response.setResponseName(getCommandName());
response.setObjectName("ucsblade");
this.setResponseObject(response);
} catch (Exception e) {
s_logger.warn(e.getMessage(), e);
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
}
}
@Override
public String getCommandName() {
return "listucsbladeresponse";
}
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
}

View File

@ -5,15 +5,24 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
// Automatically generated by addcopyright.py at 02/28/2013
// regarding copyright ownership. The ASF licenses this file
// "License"); you may not use this file except in compliance
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
package com.cloud.ucs.manager;
import javax.inject.Inject;
@ -22,6 +31,7 @@ import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
@ -34,8 +44,8 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.server.ManagementService;
import com.cloud.user.Account;
@APICommand(description="List ucs manager", responseObject=ListUcsManagerResponse.class)
public class ListUcsManagerCmd extends BaseCmd {
@APICommand(description="List ucs manager", responseObject=UcsManagerResponse.class)
public class ListUcsManagerCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListUcsManagerCmd.class);
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the zone id", required=true)
@ -48,7 +58,7 @@ public class ListUcsManagerCmd extends BaseCmd {
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
ResourceAllocationException, NetworkRuleConflictException {
try {
ListResponse<ListUcsManagerResponse> response = mgr.listUcsManager(this);
ListResponse<UcsManagerResponse> response = mgr.listUcsManager(this);
response.setResponseName(getCommandName());
response.setObjectName("ucsmanager");
this.setResponseObject(response);

View File

@ -1,58 +0,0 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.ucs.manager;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
public class ListUcsManagerResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="id of ucs manager")
private String id;
@SerializedName(ApiConstants.NAME) @Param(description="name of ucs manager")
private String name;
@SerializedName(ApiConstants.ZONE_ID) @Param(description="zone id the ucs manager belongs to")
private String zoneId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getZoneId() {
return zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
}

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import javax.inject.Inject;
@ -23,6 +24,7 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseCmd.CommandType;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
@ -35,13 +37,13 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.server.ManagementService;
import com.cloud.user.Account;
@APICommand(description="List profile in ucs manager", responseObject=ListUcsProfileResponse.class)
public class ListUcsProfileCmd extends BaseCmd {
@APICommand(name="listUcsProfile", description="List profile in ucs manager", responseObject=UcsProfileResponse.class)
public class ListUcsProfileCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListUcsProfileCmd.class);
@Inject UcsManager mgr;
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the id for the ucs manager", required=true)
@Parameter(name=ApiConstants.UCS_MANAGER_ID, type=CommandType.UUID, entityType=UcsManagerResponse.class, description="the id for the ucs manager", required=true)
private Long ucsManagerId;
public Long getUcsManagerId() {
@ -56,9 +58,9 @@ public class ListUcsProfileCmd extends BaseCmd {
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
ResourceAllocationException, NetworkRuleConflictException {
try {
ListResponse<ListUcsProfileResponse> response = mgr.listUcsProfiles(this);
ListResponse<UcsProfileResponse> response = mgr.listUcsProfiles(this);
response.setResponseName(getCommandName());
response.setObjectName("ucsprofile");
response.setObjectName("ucsprofiles");
this.setResponseObject(response);
} catch (Exception e) {
s_logger.warn("Exception: ", e);

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import java.util.Map;

View File

@ -0,0 +1,84 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.ucs.manager;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.ucs.database.UcsBladeVO;
import com.google.gson.annotations.SerializedName;
@EntityReference(value=UcsBladeVO.class)
public class UcsBladeResponse extends BaseResponse {
@SerializedName(ApiConstants.ID)
@Param(description = "ucs blade id")
private String id;
@SerializedName(ApiConstants.UCS_MANAGER_ID)
@Param(description = "ucs manager id")
private String ucsManagerId;
@SerializedName(ApiConstants.HOST_ID)
@Param(description = "cloudstack host id this blade associates to")
private String hostId;
@SerializedName(ApiConstants.UCS_BLADE_DN)
@Param(description = "ucs blade dn")
private String dn;
@SerializedName(ApiConstants.UCS_PROFILE_DN)
@Param(description = "associated ucs profile dn")
private String associatedProfileDn;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUcsManagerId() {
return ucsManagerId;
}
public void setUcsManagerId(String ucsManagerId) {
this.ucsManagerId = ucsManagerId;
}
public String getHostId() {
return hostId;
}
public void setHostId(String hostId) {
this.hostId = hostId;
}
public String getDn() {
return dn;
}
public void setDn(String dn) {
this.dn = dn;
}
public String getAssociatedProfileDn() {
return associatedProfileDn;
}
public void setAssociatedProfileDn(String associatedProfileDn) {
this.associatedProfileDn = associatedProfileDn;
}
}

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import com.cloud.utils.xmlobject.XmlObject;
@ -83,7 +84,7 @@ public class UcsCommands {
.putElement("statsPolicyName", "default")
.putElement("status", "")
.putElement("usrLbl", "")
.putElement("", "")
.putElement("uuid", "")
.putElement("vconProfileName", "")
.putElement("lsBinding", new XmlObject("lsBinding")
.putElement("pnDn", bladeDn)

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import org.apache.commons.httpclient.HttpClient;
@ -39,7 +40,12 @@ public class UcsHttpClient {
if (result != 200) {
throw new CloudRuntimeException("Call failed: " + post.getResponseBodyAsString());
}
return post.getResponseBodyAsString();
String res = post.getResponseBodyAsString();
if (res.contains("errorCode")) {
String err = String.format("ucs call failed:\nsubmitted doc:%s\nresponse:%s\n", xml, res);
throw new CloudRuntimeException(err);
}
return res;
} catch (Exception e) {
throw new CloudRuntimeException(e.getMessage(), e);
} finally {

View File

@ -5,27 +5,31 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import org.apache.cloudstack.api.response.ListResponse;
import com.cloud.utils.component.Manager;
import com.cloud.utils.component.PluggableService;
public interface UcsManager extends Manager {
AddUcsManagerResponse addUcsManager(AddUcsManagerCmd cmd);
public interface UcsManager extends Manager, PluggableService {
UcsManagerResponse addUcsManager(AddUcsManagerCmd cmd);
ListResponse<ListUcsProfileResponse> listUcsProfiles(ListUcsProfileCmd cmd);
ListResponse<UcsProfileResponse> listUcsProfiles(ListUcsProfileCmd cmd);
ListResponse<ListUcsManagerResponse> listUcsManager(ListUcsManagerCmd cmd);
ListResponse<UcsManagerResponse> listUcsManager(ListUcsManagerCmd cmd);
void associateProfileToBlade(AssociateUcsProfileToBladeCmd cmd);
UcsBladeResponse associateProfileToBlade(AssociateUcsProfileToBladeCmd cmd);
ListResponse<UcsBladeResponse> listUcsBlades(ListUcsBladeCmd cmd);
}

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import java.io.File;
@ -42,8 +43,11 @@ import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.dc.ClusterDetailsDao;
import com.cloud.dc.DataCenterVO;
import com.cloud.dc.dao.ClusterDao;
import com.cloud.dc.dao.DataCenterDao;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.org.Cluster;
import com.cloud.resource.ResourceService;
@ -64,7 +68,6 @@ import com.cloud.utils.xmlobject.XmlObject;
import com.cloud.utils.xmlobject.XmlObjectParser;
@Local(value = { UcsManager.class })
@Component
public class UcsManagerImpl implements UcsManager {
public static final Logger s_logger = Logger.getLogger(UcsManagerImpl.class);
@ -78,8 +81,15 @@ public class UcsManagerImpl implements UcsManager {
private ClusterDetailsDao clusterDetailsDao;
@Inject
private UcsBladeDao bladeDao;
@Inject
private HostDao hostDao;
@Inject
private DataCenterDao dcDao;
private Map<Long, String> cookies = new HashMap<Long, String>();
private Map<Long, String> cookies = new HashMap<Long, String>();
private String name;
private int runLevel;
private Map<String, Object> params;
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
@ -98,7 +108,7 @@ public class UcsManagerImpl implements UcsManager {
@Override
public String getName() {
return "UcsManager";
return name;
}
private void discoverBlades(UcsManagerVO ucsMgrVo) {
@ -114,7 +124,7 @@ public class UcsManagerImpl implements UcsManager {
@Override
@DB
public AddUcsManagerResponse addUcsManager(AddUcsManagerCmd cmd) {
public UcsManagerResponse addUcsManager(AddUcsManagerCmd cmd) {
UcsManagerVO vo = new UcsManagerVO();
vo.setUuid(UUID.randomUUID().toString());
vo.setPassword(cmd.getPassword());
@ -127,7 +137,7 @@ public class UcsManagerImpl implements UcsManager {
txn.start();
ucsDao.persist(vo);
txn.commit();
AddUcsManagerResponse rsp = new AddUcsManagerResponse();
UcsManagerResponse rsp = new UcsManagerResponse();
rsp.setId(String.valueOf(vo.getId()));
rsp.setName(vo.getName());
rsp.setUrl(vo.getUrl());
@ -145,7 +155,9 @@ public class UcsManagerImpl implements UcsManager {
UcsManagerVO mgrvo = ucsDao.findById(ucsMgrId);
UcsHttpClient client = new UcsHttpClient(mgrvo.getUrl());
String login = UcsCommands.loginCmd(mgrvo.getUsername(), mgrvo.getPassword());
cookie = client.call(login);
String ret = client.call(login);
XmlObject xo = XmlObjectParser.parseFromString(ret);
cookie = xo.get("outCookie");
cookies.put(ucsMgrId, cookie);
}
@ -175,12 +187,12 @@ public class UcsManagerImpl implements UcsManager {
}
@Override
public ListResponse<ListUcsProfileResponse> listUcsProfiles(ListUcsProfileCmd cmd) {
public ListResponse<UcsProfileResponse> listUcsProfiles(ListUcsProfileCmd cmd) {
List<UcsProfile> profiles = getUcsProfiles(cmd.getUcsManagerId());
ListResponse<ListUcsProfileResponse> response = new ListResponse<ListUcsProfileResponse>();
List<ListUcsProfileResponse> rs = new ArrayList<ListUcsProfileResponse>();
ListResponse<UcsProfileResponse> response = new ListResponse<UcsProfileResponse>();
List<UcsProfileResponse> rs = new ArrayList<UcsProfileResponse>();
for (UcsProfile p : profiles) {
ListUcsProfileResponse r = new ListUcsProfileResponse();
UcsProfileResponse r = new UcsProfileResponse();
r.setObjectName("ucsprofile");
r.setDn(p.getDn());
rs.add(r);
@ -196,7 +208,7 @@ public class UcsManagerImpl implements UcsManager {
String cmd = UcsCommands.cloneProfile(cookie, srcDn, newProfileName);
String res = client.call(cmd);
XmlObject xo = XmlObjectParser.parseFromString(res);
return xo.get("lsClone.outConfig.lsServer.dn");
return xo.get("outConfig.lsServer.dn");
}
private boolean isProfileAssociated(Long ucsMgrId, String dn) {
@ -206,11 +218,11 @@ public class UcsManagerImpl implements UcsManager {
String cmd = UcsCommands.configResolveDn(cookie, dn);
String res = client.call(cmd);
XmlObject xo = XmlObjectParser.parseFromString(res);
return xo.get("outConfig.lsServer.assocState").equals("associated");
return xo.get("outConfig.computeBlade.association").equals("associated");
}
@Override
public void associateProfileToBlade(AssociateUcsProfileToBladeCmd cmd) {
public UcsBladeResponse associateProfileToBlade(AssociateUcsProfileToBladeCmd cmd) {
SearchCriteriaService<UcsBladeVO, UcsBladeVO> q = SearchCriteria2.create(UcsBladeVO.class);
q.addAnd(q.getEntity().getUcsManagerId(), Op.EQ, cmd.getUcsManagerId());
q.addAnd(q.getEntity().getId(), Op.EQ, cmd.getBladeId());
@ -248,57 +260,115 @@ public class UcsManagerImpl implements UcsManager {
if (count >= timeout) {
throw new CloudRuntimeException(String.format("associating profile[%s] to balde[%s] timeout after 600 seconds", pdn, bvo.getDn()));
}
bvo.setProfileDn(pdn);
bladeDao.update(bvo.getId(), bvo);
UcsBladeResponse rsp = bladeVOToResponse(bvo);
s_logger.debug(String.format("successfully associated profile[%s] to blade[%s]", pdn, bvo.getDn()));
}
s_logger.debug(String.format("successfully associated profile[%s] to blade[%s]", pdn, bvo.getDn()));
return rsp;
}
private String hostIdToUuid(Long hostId) {
if (hostId == null) {
return null;
}
HostVO vo = hostDao.findById(hostId);
return vo.getUuid();
}
private String zoneIdToUuid(Long zoneId) {
DataCenterVO vo = dcDao.findById(zoneId);
return vo.getUuid();
}
private String ucsManagerIdToUuid(Long ucsMgrId) {
UcsManagerVO vo = ucsDao.findById(ucsMgrId);
return vo.getUuid();
}
@Override
public ListResponse<ListUcsManagerResponse> listUcsManager(ListUcsManagerCmd cmd) {
public ListResponse<UcsManagerResponse> listUcsManager(ListUcsManagerCmd cmd) {
SearchCriteriaService<UcsManagerVO, UcsManagerVO> serv = SearchCriteria2.create(UcsManagerVO.class);
serv.addAnd(serv.getEntity().getZoneId(), Op.EQ, cmd.getZoneId());
List<UcsManagerVO> vos = serv.list();
List<ListUcsManagerResponse> rsps = new ArrayList<ListUcsManagerResponse>(vos.size());
List<UcsManagerResponse> rsps = new ArrayList<UcsManagerResponse>(vos.size());
for (UcsManagerVO vo : vos) {
ListUcsManagerResponse rsp = new ListUcsManagerResponse();
UcsManagerResponse rsp = new UcsManagerResponse();
rsp.setObjectName("ucsmanager");
rsp.setId(String.valueOf(vo.getId()));
rsp.setName(vo.getName());
rsp.setZoneId(String.valueOf(vo.getZoneId()));
rsp.setId(vo.getUuid());
rsp.setName(vo.getName());
rsp.setUrl(vo.getUrl());
rsp.setZoneId(zoneIdToUuid(vo.getZoneId()));
rsps.add(rsp);
}
ListResponse<ListUcsManagerResponse> response = new ListResponse<ListUcsManagerResponse>();
ListResponse<UcsManagerResponse> response = new ListResponse<UcsManagerResponse>();
response.setResponses(rsps);
return response;
}
private UcsBladeResponse bladeVOToResponse(UcsBladeVO vo) {
UcsBladeResponse rsp = new UcsBladeResponse();
rsp.setObjectName("ucsblade");
rsp.setId(vo.getUuid());
rsp.setDn(vo.getDn());
rsp.setHostId(hostIdToUuid(vo.getHostId()));
rsp.setUcsManagerId(ucsManagerIdToUuid(vo.getUcsManagerId()));
return rsp;
}
public ListResponse<UcsBladeResponse> listUcsBlades(ListUcsBladeCmd cmd) {
SearchCriteriaService<UcsBladeVO, UcsBladeVO> serv = SearchCriteria2.create(UcsBladeVO.class);
serv.addAnd(serv.getEntity().getUcsManagerId(), Op.EQ, cmd.getUcsManagerId());
List<UcsBladeVO> vos = serv.list();
List<UcsBladeResponse> rsps = new ArrayList<UcsBladeResponse>(vos.size());
for (UcsBladeVO vo : vos) {
UcsBladeResponse rsp = bladeVOToResponse(vo);
rsps.add(rsp);
}
ListResponse<UcsBladeResponse> response = new ListResponse<UcsBladeResponse>();
response.setResponses(rsps);
return response;
}
@Override
public void setName(String name) {
// TODO Auto-generated method stub
public void setName(String name) {
this.name = name;
}
@Override
public void setConfigParams(Map<String, Object> params) {
// TODO Auto-generated method stub
public void setConfigParams(Map<String, Object> params) {
this.params = params;
}
@Override
public Map<String, Object> getConfigParams() {
// TODO Auto-generated method stub
return null;
return this.params;
}
@Override
public int getRunLevel() {
// TODO Auto-generated method stub
return 0;
return runLevel;
}
@Override
public void setRunLevel(int level) {
// TODO Auto-generated method stub
public void setRunLevel(int level) {
this.runLevel = level;
}
@Override
public List<Class<?>> getCommands() {
List<Class<?>> cmds = new ArrayList<Class<?>>();
cmds.add(ListUcsBladeCmd.class);
cmds.add(ListUcsManagerCmd.class);
cmds.add(ListUcsProfileCmd.class);
cmds.add(AddUcsManagerCmd.class);
cmds.add(AssociateUcsProfileToBladeCmd.class);
return cmds;
}
}

View File

@ -5,24 +5,28 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
import com.cloud.ucs.database.UcsManagerVO;
import com.google.gson.annotations.SerializedName;
public class AddUcsManagerResponse extends BaseResponse {
@EntityReference(value=UcsManagerVO.class)
public class UcsManagerResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the ID of the ucs manager")
private String id;

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.manager;
import org.apache.cloudstack.api.ApiConstants;
@ -22,9 +23,9 @@ import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
public class ListUcsProfileResponse extends BaseResponse {
@SerializedName(ApiConstants.UCS_DN) @Param(description="the dn of ucs profile")
private String dn;
public class UcsProfileResponse extends BaseResponse {
@SerializedName(ApiConstants.UCS_DN) @Param(description="ucs profile dn")
private String dn;
public String getDn() {
return dn;

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.structure;
import java.util.ArrayList;
@ -45,7 +46,7 @@ public class ComputeBlade {
public static List<ComputeBlade> fromXmString(String xmlstr) {
XmlObject root = XmlObjectParser.parseFromString(xmlstr);
List<XmlObject> lst = root.getAsList("configResolveClass.outConfigs.computeBlade");
List<XmlObject> lst = root.getAsList("outConfigs.computeBlade");
List<ComputeBlade> blades = new ArrayList<ComputeBlade>();
if (lst == null) {
return blades;

View File

@ -5,15 +5,16 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
package com.cloud.ucs.structure;
import java.util.ArrayList;
@ -36,7 +37,9 @@ public class UcsProfile {
List<XmlObject> xos = xo.getAsList("outDns.dn");
if (xos != null) {
for (XmlObject x : xos) {
UcsProfile p = UcsProfile.fromXmlObject(x);
//UcsProfile p = UcsProfile.fromXmlObject(x);
UcsProfile p = new UcsProfile();
p.setDn(x.get("value").toString());
ps.add(p);
}
}

View File

@ -91,6 +91,10 @@
<cs.reflections.version>0.9.8</cs.reflections.version>
<cs.java-ipv6.version>0.10</cs.java-ipv6.version>
<cs.replace.properties>build/replace.properties</cs.replace.properties>
<!-- jna is a dependecy of libvirt, check libvirt
version requirements before changing -->
<cs.jna.version>3.2.4</cs.jna.version>
<cs.libvirt-java.version>0.4.9</cs.libvirt-java.version>
</properties>
<distributionManagement>

View File

@ -77,8 +77,6 @@
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
@ -108,16 +106,40 @@
<testResources>
<testResource>
<directory>test/resources</directory>
<excludes>
<exclude>%regex[.*[0-9]*To[0-9]*.*Test.*]</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<configuration>
<testExcludes>
<exclude>**/com/cloud/upgrade/*.java</exclude>
<exclude>**/com/cloud/async/*.java</exclude>
</testExcludes>
</configuration>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx1024m</argLine>
<excludes>
<exclude>com/cloud/upgrade/*</exclude>
<exclude>%regex[.*[0-9]*To[0-9]*.*Test.*]</exclude>
<exclude>com/cloud/upgrade/AdvanceZone223To224UpgradeTest</exclude>
<exclude>com/cloud/upgrade/AdvanceZone217To224UpgradeTest</exclude>
<exclude>com/cloud/async/*</exclude>
<exclude>com/cloud/cluster/*</exclude>
<exclude>com/cloud/snapshot/*</exclude>

View File

@ -367,7 +367,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
if (router.getState() == State.Running) {
try {
Commands cmds = new Commands(OnError.Stop);
Commands cmds = new Commands(OnError.Stop);
UnPlugNicCommand unplugNicCmd = new UnPlugNicCommand(nic, vm.getName());
cmds.addCommand("unplugnic", unplugNicCmd);
_agentMgr.send(dest.getHost().getId(), cmds);
@ -448,15 +448,20 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
SetupGuestNetworkCommand setupCmd = new SetupGuestNetworkCommand(dhcpRange, networkDomain, false, null,
defaultDns1, defaultDns2, add, _itMgr.toNicTO(nicProfile, router.getHypervisorType()));
long guestVlanTag = Long.parseLong(network.getBroadcastUri().getHost());
String brd = NetUtils.long2Ip(NetUtils.ip2Long(guestNic.getIp4Address()) | ~NetUtils.ip2Long(guestNic.getNetmask()));
setupCmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId()));
setupCmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, getRouterIpInNetwork(network.getId(), router.getId()));
setupCmd.setAccessDetail(NetworkElementCommand.GUEST_VLAN_TAG, String.valueOf(guestVlanTag));
setupCmd.setAccessDetail(NetworkElementCommand.GUEST_NETWORK_GATEWAY, network.getGateway());
setupCmd.setAccessDetail(NetworkElementCommand.GUEST_BRIDGE, brd);
setupCmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
if (network.getBroadcastDomainType() == BroadcastDomainType.Vlan) {
long guestVlanTag = Long.parseLong(network.getBroadcastUri().getHost());
setupCmd.setAccessDetail(NetworkElementCommand.GUEST_VLAN_TAG, String.valueOf(guestVlanTag));
}
return setupCmd;
}
@ -571,8 +576,8 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
}
Commands netUsagecmds = new Commands(OnError.Continue);
VpcVO vpc = _vpcDao.findById(router.getVpcId());
VpcVO vpc = _vpcDao.findById(router.getVpcId());
//2) Plug the nics
for (String vlanTag : nicsToPlug.keySet()) {
PublicIpAddress ip = nicsToPlug.get(vlanTag);
@ -609,9 +614,9 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
}
//Create network usage commands. Send commands to router after IPAssoc
NetworkUsageCommand netUsageCmd = new NetworkUsageCommand(router.getPrivateIpAddress(), router.getInstanceName(), true, defaultNic.getIp4Address(), vpc.getCidr());
netUsagecmds.addCommand(netUsageCmd);
UserStatisticsVO stats = _userStatsDao.findBy(router.getAccountId(), router.getDataCenterId(),
publicNtwk.getId(), publicNic.getIp4Address(), router.getId(), router.getType().toString());
netUsagecmds.addCommand(netUsageCmd);
UserStatisticsVO stats = _userStatsDao.findBy(router.getAccountId(), router.getDataCenterId(),
publicNtwk.getId(), publicNic.getIp4Address(), router.getId(), router.getType().toString());
if (stats == null) {
stats = new UserStatisticsVO(router.getAccountId(), router.getDataCenterId(), publicNic.getIp4Address(), router.getId(),
router.getType().toString(), publicNtwk.getId());
@ -654,8 +659,8 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
}
});
if(result && netUsagecmds.size() > 0){
//After successful ipassoc, send commands to router
sendCommandsToRouter(router, netUsagecmds);
//After successful ipassoc, send commands to router
sendCommandsToRouter(router, netUsagecmds);
}
return result;
}
@ -820,7 +825,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
NetworkUsageCommand netUsageCmd = new NetworkUsageCommand(router.getPrivateIpAddress(), router.getInstanceName(), true, publicNic.getIp4Address(), vpc.getCidr());
usageCmds.add(netUsageCmd);
UserStatisticsVO stats = _userStatsDao.findBy(router.getAccountId(), router.getDataCenterId(),
publicNtwk.getId(), publicNic.getIp4Address(), router.getId(), router.getType().toString());
publicNtwk.getId(), publicNic.getIp4Address(), router.getId(), router.getType().toString());
if (stats == null) {
stats = new UserStatisticsVO(router.getAccountId(), router.getDataCenterId(), publicNic.getIp4Address(), router.getId(),
router.getType().toString(), publicNtwk.getId());
@ -1068,7 +1073,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
s_logger.warn("Unable to apply StaticRoute, virtual router is not in the right state " + router.getState());
throw new ResourceUnavailableException("Unable to apply StaticRoute on the backend," +
" virtual router is not in the right state", DataCenter.class, router.getDataCenterId());
" virtual router is not in the right state", DataCenter.class, router.getDataCenterId());
}
}
return result;

View File

@ -16,12 +16,14 @@
// under the License.
package com.cloud.upgrade;
import org.junit.Ignore;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({ AdvanceZone217To224UpgradeTest.class, AdvanceZone223To224UpgradeTest.class, PortForwarding218To224UpgradeTest.class, InstanceGroup218To224UpgradeTest.class,
BasicZone218To224UpgradeTest.class, UsageEvents218To224UpgradeTest.class })
@Ignore("maven-sure-fire discovered")
public class DbUpgrade22Test {
}

View File

@ -1655,4 +1655,26 @@ CREATE TABLE `cloud`.`baremetal_pxe_devices` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cloud`.`ucs_blade` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`uuid` varchar(40) UNIQUE,
`ucs_manager_id` bigint unsigned NOT NULL,
`host_id` bigint unsigned DEFAULT NULL,
`dn` varchar(512) NOT NULL,
`profile_dn` varchar(512) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cloud`.`ucs_manager` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`uuid` varchar(40) UNIQUE,
`zone_id` bigint unsigned NOT NULL,
`name` varchar(128) DEFAULT NULL,
`url` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET foreign_key_checks = 1;

View File

@ -17,7 +17,6 @@
# under the License.
set -x
set -e
appliance="systemvmtemplate"
build_date=`date +%Y-%m-%d`
@ -43,6 +42,14 @@ machine_uuid=`vboxmanage showvminfo $appliance | grep UUID | head -1 | awk '{pri
hdd_uuid=`vboxmanage showvminfo $appliance | grep vdi | head -1 | awk '{print $8}' | cut -d ')' -f 1`
hdd_path=`vboxmanage list hdds | grep $appliance | grep vdi | cut -c 14-`
# Remove any shared folder
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host`
while [ "$shared_folders" != "" ]
do
vboxmanage sharedfolder remove systemvmtemplate --name "`echo $shared_folders | head -1 | cut -c 8- | cut -d \' -f 1`"
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host`
done
# Compact the virtual hdd
vboxmanage modifyhd $hdd_uuid --compact
@ -50,9 +57,14 @@ vboxmanage modifyhd $hdd_uuid --compact
rm -fr dist *.ova *.vhd *.vdi *.qcow* *.bz2
mkdir dist
# Exit shell if exporting fails for any format
set -e
# Export for Xen
vboxmanage internalcommands converttoraw "$hdd_path" raw.img
vhd-util convert -s 0 -t 1 -i raw.img -o $appliance-$build_date-$branch-xen.vhd
vboxmanage internalcommands converttoraw "$hdd_path" img.raw
faketime '2010-01-01' vhd-util convert -s 0 -t 1 -i img.raw -o stagefixed.vhd
faketime '2010-01-01' vhd-util convert -s 1 -t 2 -i stagefixed.vhd -o $appliance-$build_date-$branch-xen.vhd
rm *.bak
bzip2 $appliance-$build_date-$branch-xen.vhd
echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2"

View File

@ -27,7 +27,8 @@ install_packages() {
# Basic packages
apt-get --no-install-recommends -q -y --force-yes install rsyslog logrotate cron chkconfig insserv net-tools ifupdown vim-tiny netbase iptables
apt-get --no-install-recommends -q -y --force-yes install openssh-server openssl grub-legacy e2fsprogs dhcp3-client tcpdump socat wget
apt-get --no-install-recommends -q -y --force-yes install openssh-server openssl e2fsprogs dhcp3-client tcpdump socat wget
# apt-get --no-install-recommends -q -y --force-yes install grub-legacy
apt-get --no-install-recommends -q -y --force-yes install python bzip2 sed gawk diffutils grep gzip less tar telnet ftp rsync traceroute psmisc lsof procps monit inetutils-ping iputils-arping httping
apt-get --no-install-recommends -q -y --force-yes install dnsutils zip unzip ethtool uuid file iproute acpid virt-what sudo

View File

@ -11073,9 +11073,10 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
/*Regions*/
.region-switcher {
display: inline-block;
z-index: 2002;
position: relative;
background: url(../images/bg-gradients.png) 0px -1px;
background: url(../images/bg-gradients.png) repeat-x 0px -867px;
border: 1px solid #5E5E5E;
/*+border-radius:4px;*/
-moz-border-radius: 4px;
@ -11084,7 +11085,6 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
border-radius: 4px;
border-top: 1px solid #717171;
border-bottom: 1px solid #FFFFFF;
width: 32px;
height: 28px;
float: left;
margin: 4px 13px 0 0;
@ -11213,10 +11213,26 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
}
.region-switcher .icon {
display: inline-block;
float: left;
display: block;
width: 100%;
height: 100%;
width: 26px;
height: 26px;
background: url(../images/sprites.png) -15px -1313px;
position: absolute;
}
.region-switcher .title {
display: inline-block;
float: right;
padding: 10px 9px 0 34px;
color: #FFFFFF;
font-size: 12px;
font-weight: bold;
max-width: 67px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.region-switcher:hover,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -27,7 +27,7 @@
args.response.success({
data: regions ? regions : [
{ id: -1, name: '(Default region)' }
{ id: -1, name: '(Default)' }
],
activeRegionID: cloudStack.context.users.regionid ?
cloudStack.context.users.regionid : 1

View File

@ -8950,7 +8950,8 @@
name: { label: 'label.name' },
ipaddress: { label: 'label.server' },
path: { label: 'label.path' },
clustername: { label: 'label.cluster'}
clustername: { label: 'label.cluster'},
scope:{label:'Scope'}
},
dataProvider: function(args) {
@ -8991,6 +8992,51 @@
createForm: {
title: 'label.add.primary.storage',
fields: {
scope: {
label: 'label.scope',
select: function(args) {
var scope = [
{ id: 'zone-wide', description: _l('label.zone.wide') },
{ id: 'cluster', description: _l('label.cluster') },
{ id: 'host', description: _l('label.host') }
];
args.response.success({
data: scope
});
args.$select.change(function() {
var $form = $(this).closest('form');
var scope = $(this).val();
if(scope == 'zone-wide'){
$form.find('.form-item[rel=podId]').hide();
$form.find('.form-item[rel=clusterId]').hide();
$form.find('.form-item[rel=hostId]').hide();
}
else if(scope == 'cluster'){
$form.find('.form-item[rel=hostId]').hide();
$form.find('.form-item[rel=podId]').css('display', 'inline-block');
$form.find('.form-item[rel=clusterId]').css('display', 'inline-block');
}
else if(scope == 'host'){
$form.find('.form-item[rel=podId]').css('display', 'inline-block');
$form.find('.form-item[rel=clusterId]').css('display', 'inline-block');
$form.find('.form-item[rel=hostId]').css('display', 'inline-block');
}
})
}
},
zoneid: {
label: 'Zone',
docID: 'helpPrimaryStorageZone',
@ -9064,6 +9110,29 @@
}
},
hostId: {
label: 'label.host',
validation: { required: true },
dependsOn: 'clusterId',
select: function(args) {
$.ajax({
url: createURL('listHosts'),
data: {
clusterid: args.clusterId
},
success: function(json) {
var hosts = json.listhostsresponse.host ?
json.listhostsresponse.host : []
args.response.success({
data: $.map(hosts, function(host) {
return { id: host.id, description: host.name }
})
});
}
});
}
},
name: {
label: 'label.name',
docID: 'helpPrimaryStorageName',
@ -9126,6 +9195,7 @@
var protocol = $(this).val();
if(protocol == null)
return;
if(protocol == "nfs") {
//$("#add_pool_server_container", $dialogAddPool).show();
@ -9445,9 +9515,24 @@
action: function(args) {
var array1 = [];
array1.push("&scope=" + todb(args.data.scope));
array1.push("&zoneid=" + args.data.zoneid);
array1.push("&podId=" + args.data.podId);
if(args.data.scope == 'cluster'){
array1.push("&podid=" + args.data.podId);
array1.push("&clusterid=" + args.data.clusterId);
}
if(args.data.scope == 'host'){
array1.push("&podid=" + args.data.podId);
array1.push("&clusterid=" + args.data.clusterId);
array1.push("&hostid=" + args.data.hostId);
}
array1.push("&name=" + todb(args.data.name));
var server = args.data.server;

View File

@ -31,6 +31,7 @@
$(data).each(function() {
var region = this;
var regionName = region.name;
var $li = $('<li>').append($('<span>').html(_s(region.name)));
$li.data('region-data', region);
@ -39,6 +40,10 @@
$li.addClass('active');
}
$regionSwitcherButton.find('.title')
.html(regionName)
.attr('title', regionName);
$regionList.append($li);
});
}
@ -62,7 +67,8 @@
var $regionSwitcherButton = $('<div>').addClass('region-switcher')
.attr('title', 'Select region')
.append(
$('<span>').addClass('icon').html('&nbsp;')
$('<span>').addClass('icon').html('&nbsp;'),
$('<span>').addClass('title').html('')
);
var closeRegionSelector = function(args) {
@ -72,7 +78,6 @@
};
var switchRegion = function(url) {
closeRegionSelector({
complete: function() {
$('#container').prepend($('<div>').addClass('loading-overlay'));

View File

@ -40,7 +40,10 @@ public class XmlObject {
this.tag = tag;
}
public XmlObject putElement(String key, Object e) {
public XmlObject putElement(String key, Object e) {
if (e == null) {
throw new IllegalArgumentException(String.format("element[%s] can not be null", key));
}
Object old = elements.get(key);
if (old == null) {
System.out.println(String.format("no %s, add new", key));

View File

@ -1000,6 +1000,7 @@ public class HypervisorHostHelper {
s_logger.error(msg);
throw new Exception(msg);
}
boolean importSuccess = true;
final HttpNfcLeaseMO leaseMo = new HttpNfcLeaseMO(context, morLease);
HttpNfcLeaseState state = leaseMo.waitState(
new HttpNfcLeaseState[] { HttpNfcLeaseState.READY, HttpNfcLeaseState.ERROR });
@ -1033,13 +1034,25 @@ public class HypervisorHostHelper {
}
}
}
} catch (Exception e) {
s_logger.error("Failed to complete file upload task. " + e.getMessage());
// Set flag to cleanup the stale template left due to failed import operation, if any
importSuccess = false;
throw e;
} finally {
progressReporter.close();
}
if (bytesAlreadyWritten == totalBytes) {
leaseMo.updateLeaseProgress(100);
}
}
} finally {
if (!importSuccess) {
s_logger.error("Aborting the lease on " + vmName + " after import operation failed.");
leaseMo.abortLease();
} else {
leaseMo.completeLease();
}
}
}
}