diff --git a/api/src/com/cloud/api/response/UserResponse.java b/api/src/com/cloud/api/response/UserResponse.java index 920eb598f5a..b1382e98b8a 100644 --- a/api/src/com/cloud/api/response/UserResponse.java +++ b/api/src/com/cloud/api/response/UserResponse.java @@ -69,6 +69,8 @@ public class UserResponse extends BaseResponse { @SerializedName("accountid") @Param(description="the account ID of the user") private IdentityProxy accountId = new IdentityProxy("account"); + @SerializedName("iscallerchilddomain") @Param(description="the boolean value representing if the updating target is in caller's child domain") + private boolean isCallerChildDomain; public Long getId() { return id.getValue(); @@ -188,4 +190,12 @@ public class UserResponse extends BaseResponse { public void setAccountId(Long accountId) { this.accountId.setValue(accountId); } + + public boolean getIsCallerSubdomain() { + return this.isCallerChildDomain; + } + + public void setIsCallerChildDomain(boolean isCallerChildDomain) { + this.isCallerChildDomain = isCallerChildDomain; + } } diff --git a/client/pom.xml b/client/pom.xml index 1673429f3d9..77077066f9a 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -44,7 +44,7 @@ org.apache.cloudstack cloud-plugin-user-authenticator-sha256salted ${project.version} - + org.apache.cloudstack cloud-plugin-network-nvp @@ -66,9 +66,9 @@ ${project.version} - org.apache.cloudstack - cloud-plugin-hypervisor-ovm - ${project.version} + org.apache.cloudstack + cloud-plugin-hypervisor-ovm + ${project.version} org.apache.cloudstack @@ -290,7 +290,7 @@ - org.eclipse.m2e @@ -324,6 +324,21 @@ + + simulator + + + simulator + + + + + org.apache.cloudstack + cloud-plugin-hypervisor-simulator + ${project.version} + + + netapp diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index 437c8d458f5..e55017ce5ea 100755 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -31,7 +31,7 @@ markDefaultZoneForAccount=com.cloud.api.commands.MarkDefaultZoneForAccountCmd;1 #### User commands createUser=com.cloud.api.commands.CreateUserCmd;3 deleteUser=com.cloud.api.commands.DeleteUserCmd;3 -updateUser=com.cloud.api.commands.UpdateUserCmd;3 +updateUser=com.cloud.api.commands.UpdateUserCmd;15 listUsers=com.cloud.api.commands.ListUsersCmd;7 ####lockUser=com.cloud.api.commands.LockUserCmd;7 disableUser=com.cloud.api.commands.DisableUserCmd;7 diff --git a/client/tomcatconf/simulator.properties.in b/client/tomcatconf/simulator_commands.properties.in similarity index 71% rename from client/tomcatconf/simulator.properties.in rename to client/tomcatconf/simulator_commands.properties.in index 24e5e627c71..d2a46997e6f 100644 --- a/client/tomcatconf/simulator.properties.in +++ b/client/tomcatconf/simulator_commands.properties.in @@ -5,9 +5,9 @@ # 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 @@ -15,17 +15,5 @@ # specific language governing permissions and limitations # under the License. -host=127.0.0.1 -port=8250 -workers=3 -zone=1 -pod=1 -run=13 -sequence=r -agent.save.path=/tmp/agents -latency=2 -latency.start.range=2 -latency.end.range=2 -delay.distribution={(5,10); (5,10); (5,10); (5,10); (5,10); (5,10); (5,10); (5,10); (5,10); (10,120)} -property.scan.enabled=1 -property.scan.interval=300 + +configureSimulator=com.cloud.api.commands.ConfigureSimulator;1 \ No newline at end of file diff --git a/developer/developer-prefill.sql b/developer/developer-prefill.sql index 8e215ba77d9..e14ac375e98 100644 --- a/developer/developer-prefill.sql +++ b/developer/developer-prefill.sql @@ -16,6 +16,8 @@ -- under the License. -- Add a default ROOT domain +use cloud; + INSERT INTO `cloud`.`domain` (id, name, parent, path, owner) VALUES (1, 'ROOT', NULL, '/', 2); diff --git a/developer/pom.xml b/developer/pom.xml index 61cb1108d3a..b782a595f3a 100644 --- a/developer/pom.xml +++ b/developer/pom.xml @@ -1,4 +1,4 @@ - 4.0.0 cloud-developer @@ -101,6 +102,7 @@ + org.gjt.mm.mysql.Driver jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud ${db.cloud.username} @@ -109,7 +111,6 @@ ${maven.test.skip} true - drop-database @@ -310,9 +311,9 @@ true - - ${basedir}/developer-prefill.sql - + + ${basedir}/developer-prefill.sql + @@ -320,5 +321,128 @@ + + + + simulator + + deploydb-simulator + + + + + org.codehaus.mojo + properties-maven-plugin + 1.0-alpha-2 + + + initialize + + read-project-properties + + + + ${project.parent.basedir}/utils/conf/db.properties + ${project.parent.basedir}/utils/conf/db.properties.override + + true + + + + + + org.codehaus.mojo + sql-maven-plugin + 1.5 + + + mysql + mysql-connector-java + ${cs.mysql.version} + + + + org.gjt.mm.mysql.Driver + jdbc:mysql://${db.simulator.host}:3306/simulator + ${db.simulator.username} + ${db.simulator.password} + ${maven.test.skip} + true + + + + drop-database + process-test-resources + + execute + + + root + ${db.root.password} + jdbc:mysql://${db.simulator.host}:3306 + drop database if exists `simulator` + + + + create-database + process-test-resources + + execute + + + root + ${db.root.password} + jdbc:mysql://${db.simulator.host}:3306 + create database `simulator` + + + + grant-user-cloud + process-test-resources + + execute + + + root + ${db.root.password} + jdbc:mysql://${db.simulator.host}:3306 + GRANT ALL ON simulator.* to + ${db.simulator.username}@`localhost` identified by + '${db.simulator.password}'; + + + + grant-user-cloud-all + process-test-resources + + execute + + + root + ${db.root.password} + jdbc:mysql://${db.simulator.host}:3306 + GRANT ALL ON simulator.* to + ${db.simulator.username}@`%` identified by + '${db.simulator.password}'; + + + + create-schema + process-test-resources + + execute + + + + ${basedir}/target/db/create-schema-simulator.sql + ${basedir}/target/db/templates.simulator.sql + + + + + + + + diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index 64459fd6118..fe536cbb5a9 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -477,6 +477,7 @@ setup_redundant_router() { cp /root/redundant_router/check_bumpup.sh $rrouter_bin_path/ cp /root/redundant_router/disable_pubip.sh $rrouter_bin_path/ cp /root/redundant_router/checkrouter.sh.templ /opt/cloud/bin/checkrouter.sh + cp /root/redundant_router/services.sh $rrouter_bin_path/ sed -i "s/\[ROUTER_ID\]/$NAME/g" /etc/keepalived/keepalived.conf sed -i "s/\[ROUTER_IP\]/$GUEST_GW\/$GUEST_CIDR_SIZE/g" /etc/keepalived/keepalived.conf sed -i "s/\[BOARDCAST\]/$GUEST_BRD/g" /etc/keepalived/keepalived.conf diff --git a/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh b/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh index c9a5e14e56b..5af5d9233a7 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh @@ -137,7 +137,7 @@ copy_routes_from_main() { ip_addr_add() { local dev="$1" local ip="$2" - sudo ip addr add dev $dev $ip > /dev/null + sudo ip addr add dev $dev $ip brd + > /dev/null } @@ -294,7 +294,7 @@ remove_an_ip () { then continue fi - sudo ip addr add dev $ethDev $ipMask + sudo ip addr add dev $ethDev $ipMask brd + done remove_routing $1 diff --git a/patches/systemvm/debian/config/opt/cloud/bin/passwd_server b/patches/systemvm/debian/config/opt/cloud/bin/passwd_server index 71349dd0336..0f4a7728874 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/passwd_server +++ b/patches/systemvm/debian/config/opt/cloud/bin/passwd_server @@ -19,5 +19,5 @@ ips=$(ip addr show dev eth0 | grep inet | grep eth0 | awk '{print $2}' ); echo $ips for ip in $ips; do addr=$(echo $ip | awk -F'/' '{print $1}') - /opt/cloud/bin/passwd_server_ip $addr & + /opt/cloud/bin/passwd_server_ip $addr >> /var/log/cloud.log 2>&1 & done; diff --git a/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh b/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh index af5edbfd2a1..ee4e894ba69 100644 --- a/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh +++ b/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh @@ -21,5 +21,3 @@ while read i do ifconfig $i down done < /tmp/iflist -service cloud-passwd-srvr stop -service dnsmasq stop diff --git a/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ b/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ index ccdef0b7ea6..0e42ec4968a 100644 --- a/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ +++ b/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ @@ -30,6 +30,4 @@ do ifconfig $i up fi done < /tmp/iflist -ip route add default via [GATEWAY] dev eth2 && \ -service cloud-passwd-srvr restart && \ -service dnsmasq restart +ip route add default via [GATEWAY] dev eth2 diff --git a/patches/systemvm/debian/config/root/redundant_router/master.sh.templ b/patches/systemvm/debian/config/root/redundant_router/master.sh.templ index 418fd5d83b8..11ca6284f65 100644 --- a/patches/systemvm/debian/config/root/redundant_router/master.sh.templ +++ b/patches/systemvm/debian/config/root/redundant_router/master.sh.templ @@ -28,12 +28,18 @@ fi echo To master called >> [RROUTER_LOG] [RROUTER_BIN_PATH]/enable_pubip.sh >> [RROUTER_LOG] 2>&1 ret=$? +if [ $ret -eq 0 ] +then + [RROUTER_BIN_PATH]/services.sh restart >> [RROUTER_LOG] 2>&1 + ret=$? +fi last_msg=`tail -n 1 [RROUTER_LOG]` echo Enable public ip returned $ret >> [RROUTER_LOG] if [ $ret -ne 0 ] then echo Fail to enable public ip! >> [RROUTER_LOG] [RROUTER_BIN_PATH]/disable_pubip.sh >> [RROUTER_LOG] 2>&1 + [RROUTER_BIN_PATH]/services.sh stop >> [RROUTER_LOG] 2>&1 service keepalived stop >> [RROUTER_LOG] 2>&1 service conntrackd stop >> [RROUTER_LOG] 2>&1 echo Status: FAULT \($last_msg\) >> [RROUTER_LOG] diff --git a/patches/systemvm/debian/config/root/redundant_router/services.sh b/patches/systemvm/debian/config/root/redundant_router/services.sh new file mode 100644 index 00000000000..b7ebeed264c --- /dev/null +++ b/patches/systemvm/debian/config/root/redundant_router/services.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# 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. + +vpn_service() { + ps aux|grep ipsec | grep -v grep > /dev/null + no_vpn=$? + if [ $no_vpn -eq 1 ] + then + return 0 + fi + r=0 + case "$1" in + stop) + service ipsec stop && \ + service xl2tpd stop + r=$? + ;; + restart) + service ipsec restart && \ + service xl2tpd restart + r=$? + ;; + esac + return $r +} + +ret=0 +case "$1" in + start) + vpn_service restart && \ + service cloud-passwd-srvr start && \ + service dnsmasq start + ret=$? + ;; + stop) + vpn_service stop && \ + service cloud-passwd-srvr stop && \ + service dnsmasq stop + ret=$? + ;; + restart) + vpn_service restart && \ + service cloud-passwd-srvr restart && \ + service dnsmasq restart + ret=$? + ;; + *) + echo "Usage: services {start|stop|restart}" + exit 1 + ;; +esac + +exit $ret diff --git a/patches/systemvm/debian/config/root/savepassword.sh b/patches/systemvm/debian/config/root/savepassword.sh index 80a6928df0e..a096b862fce 100755 --- a/patches/systemvm/debian/config/root/savepassword.sh +++ b/patches/systemvm/debian/config/root/savepassword.sh @@ -24,7 +24,7 @@ source /root/func.sh -lock="biglock" +lock="passwdlock" locked=$(getLockFile $lock) if [ "$locked" != "1" ] then diff --git a/plugins/hypervisors/simulator/pom.xml b/plugins/hypervisors/simulator/pom.xml new file mode 100644 index 00000000000..15b37900590 --- /dev/null +++ b/plugins/hypervisors/simulator/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + org.apache.cloudstack + cloudstack-plugins + 4.1.0-SNAPSHOT + ../../pom.xml + + org.apache.cloudstack + cloud-plugin-hypervisor-simulator + 4.1.0-SNAPSHOT + Apache CloudStack Plugin - Hypervisor Simulator + Simulator Hypervisor for Cloudstack + + install + src + test + + + + org.apache.cloudstack + cloud-utils + ${project.version} + + + \ No newline at end of file diff --git a/plugins/hypervisors/simulator/resources/components-simulator.xml b/plugins/hypervisors/simulator/resources/components-simulator.xml new file mode 100644 index 00000000000..2658e4db3ee --- /dev/null +++ b/plugins/hypervisors/simulator/resources/components-simulator.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + true + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/agent-simulator/src/com/cloud/agent/MetricsCollector.java b/plugins/hypervisors/simulator/src/com/cloud/agent/MetricsCollector.java similarity index 89% rename from agent-simulator/src/com/cloud/agent/MetricsCollector.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/MetricsCollector.java index 7d86a0c8e3e..fd611f83b9f 100644 --- a/agent-simulator/src/com/cloud/agent/MetricsCollector.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/MetricsCollector.java @@ -30,43 +30,43 @@ import com.cloud.utils.concurrency.NamedThreadFactory; public class MetricsCollector { private static final Logger s_logger = Logger.getLogger(MetricsCollector.class); - + private final Set vmNames = new HashSet(); private final Set newVMnames = new HashSet(); private final Map metricsMap = new HashMap(); - + private final transient ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("Metrics")); private Set _currentVms; - + public MetricsCollector(Set currentVms) { _currentVms = currentVms; getAllVMNames(); } - + public MetricsCollector() { - + } - + public synchronized void getAllVMNames() { Set currentVMs = _currentVms; - + newVMnames.clear(); newVMnames.addAll(currentVMs); newVMnames.removeAll(vmNames); //leave only new vms - + vmNames.removeAll(currentVMs); //old vms - current vms --> leave non-running vms; for (String vm: vmNames) { - removeVM(vm); + removeVM(vm); } - + vmNames.clear(); vmNames.addAll(currentVMs); } - + public synchronized void submitMetricsJobs() { s_logger.debug("Submit Metric Jobs called"); - + for (String vm : newVMnames) { MockVmMetrics task = new MockVmMetrics(vm); if (!metricsMap.containsKey(vm)) { @@ -77,30 +77,30 @@ public class MetricsCollector { } newVMnames.clear(); } - + public synchronized void addVM(String vmName) { newVMnames.add(vmName); s_logger.debug("Added vm name= " + vmName); } - + public synchronized void removeVM(String vmName) { newVMnames.remove(vmName); vmNames.remove(vmName); MockVmMetrics task = metricsMap.get(vmName); - if (task != null) { - task.stop(); - boolean r1= task.getFuture().cancel(false); - metricsMap.remove(vmName); - s_logger.debug("removeVM: cancel returned " + r1 + " for VM " + vmName); - } else { - s_logger.warn("removeVM called for nonexistent VM " + vmName); - } + if (task != null) { + task.stop(); + boolean r1= task.getFuture().cancel(false); + metricsMap.remove(vmName); + s_logger.debug("removeVM: cancel returned " + r1 + " for VM " + vmName); + } else { + s_logger.warn("removeVM called for nonexistent VM " + vmName); } - + } + public synchronized Set getVMNames() { return vmNames; } - + public synchronized Map getMetricsMap() { return metricsMap; } diff --git a/agent-simulator/src/com/cloud/agent/MockVmMetrics.java b/plugins/hypervisors/simulator/src/com/cloud/agent/MockVmMetrics.java similarity index 96% rename from agent-simulator/src/com/cloud/agent/MockVmMetrics.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/MockVmMetrics.java index f106f367a9c..30b99e753a1 100644 --- a/agent-simulator/src/com/cloud/agent/MockVmMetrics.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/MockVmMetrics.java @@ -25,52 +25,52 @@ import org.apache.log4j.Logger; public class MockVmMetrics implements Runnable { private static final Logger s_logger = Logger.getLogger(MockVmMetrics.class); - + private String vmName; - + public final int MAX_INTERFACES=1; - + public final int MAX_DISKS=8; - + //the last calculated traffic speed (transmit) per interface private Map netTxKBps = new HashMap(); - + //the last calculated traffic speed (receive) per interface private Map netRxKBps = new HashMap(); - + //the last calculated disk write speed per disk (Bytes Per Second) private Map diskWriteKBytesPerSec = new HashMap(); - + //the last calculated disk read speed per disk (Bytes Per Second) private Map diskReadKBytesPerSec = new HashMap(); - + //Total Bytes Transmitted on network interfaces private Map netTxTotalBytes = new HashMap(); - + //Total Bytes Received on network interfaces private Map netRxTotalBytes = new HashMap(); - + //Total Bytes read per disk private Map diskReadTotalBytes = new HashMap(); //Total Bytes written per disk private Map diskWriteTotalBytes = new HashMap(); - + //CPU time in seconds private Double cpuSeconds = new Double(0.0); - + //CPU percentage private Float cpuPercent = new Float(0.0); - + private Map diskMap = new HashMap(); private Map vifMap = new HashMap(); - + private Map diskStatTimestamp = new HashMap(); private Map netStatTimestamp = new HashMap(); - + private long cpuStatTimestamp = 0L; - + private ScheduledFuture future; private boolean stopped = false; private Random randSeed = new Random(); @@ -80,44 +80,44 @@ public class MockVmMetrics implements Runnable { vifMap.put("eth0", "eth0"); vifMap.put("eth1", "eth1"); vifMap.put("eth2", "eth2"); - + Long networkStart = 0L; netTxTotalBytes.put("eth0", networkStart); netRxTotalBytes.put("eth0", networkStart); - + netTxTotalBytes.put("eth1", networkStart); netRxTotalBytes.put("eth1", networkStart); - + netTxTotalBytes.put("eth2", networkStart); - netRxTotalBytes.put("eth2", networkStart); + netRxTotalBytes.put("eth2", networkStart); } - + private int getIncrementor() { return randSeed.nextInt(100); } - + @Override public void run() { if(s_logger.isDebugEnabled()) { s_logger.debug("Generating MockVM metrics"); } for (Map.Entry entry : netRxTotalBytes.entrySet()) { - entry.setValue(entry.getValue() + getIncrementor()); + entry.setValue(entry.getValue() + getIncrementor()); } - + for (Map.Entry entry : netTxTotalBytes.entrySet()) { entry.setValue(entry.getValue() + getIncrementor()); } } - + public String getVmName() { return vmName; } - + public Map getNetTxKBps() { return netTxKBps; } - + public Map getNetRxKBps() { return netRxKBps; } @@ -125,11 +125,11 @@ public class MockVmMetrics implements Runnable { public Map getDiskWriteBytesPerSec() { return diskWriteKBytesPerSec; } - + public Map getDiskReadBytesPerSec() { return diskReadKBytesPerSec; } - + public Map getNetTxTotalBytes() { return netTxTotalBytes; } @@ -137,7 +137,7 @@ public class MockVmMetrics implements Runnable { public Map getNetRxTotalBytes() { return netRxTotalBytes; } - + public Map getDiskReadTotalBytes() { return diskReadTotalBytes; } @@ -145,7 +145,7 @@ public class MockVmMetrics implements Runnable { public Map getDiskWriteTotalBytes() { return diskWriteTotalBytes; } - + public Double getNetTxKBps(String intf) { return netTxKBps.get(intf); } @@ -153,7 +153,7 @@ public class MockVmMetrics implements Runnable { public Double getNetRxKBps(String intf) { return netRxKBps.get(intf); } - + public Double getDiskWriteKBytesPerSec(String disk) { return diskWriteKBytesPerSec.get(disk); } @@ -161,7 +161,7 @@ public class MockVmMetrics implements Runnable { public Double getDiskReadKBytesPerSec(String disk) { return diskReadKBytesPerSec.get(disk); } - + public Long getNetTxTotalBytes(String intf) { return netTxTotalBytes.get(intf); } @@ -169,7 +169,7 @@ public class MockVmMetrics implements Runnable { public Long getNetRxTotalBytes(String intf) { return netRxTotalBytes.get(intf); } - + public Long getDiskReadTotalBytes(String disk) { return diskReadTotalBytes.get(disk); } @@ -177,7 +177,7 @@ public class MockVmMetrics implements Runnable { public Long getDiskWriteTotalBytes(String disk) { return diskWriteTotalBytes.get(disk); } - + public Double getCpuSeconds() { return cpuSeconds; } @@ -189,7 +189,7 @@ public class MockVmMetrics implements Runnable { public Float getCpuPercent() { return cpuPercent; } - + public void setFuture(ScheduledFuture sf) { this.future = sf; } @@ -197,9 +197,8 @@ public class MockVmMetrics implements Runnable { public ScheduledFuture getFuture() { return future; } - + public void stop() { this.stopped = true; } } - diff --git a/agent-simulator/src/com/cloud/agent/MultiCaster.java b/plugins/hypervisors/simulator/src/com/cloud/agent/MultiCaster.java similarity index 94% rename from agent-simulator/src/com/cloud/agent/MultiCaster.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/MultiCaster.java index 9c98ef651be..7d38baf0e68 100644 --- a/agent-simulator/src/com/cloud/agent/MultiCaster.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/MultiCaster.java @@ -30,49 +30,49 @@ import org.apache.log4j.Logger; public class MultiCaster implements Runnable { private static final Logger s_logger = Logger.getLogger(MultiCaster.class); - + public final int MAX_PACKET_SIZE = 8096; - + private List listeners; private DatagramSocket socket; private byte[] recvBuffer; - + private Thread driver; private volatile boolean stopRequested = false; - + public MultiCaster() { listeners = new ArrayList(); recvBuffer = new byte[MAX_PACKET_SIZE]; } - + public void addListener(MultiCasterListener listener) { synchronized(listeners) { listeners.add(listener); } } - + public void removeListener(MultiCasterListener listener) { synchronized(listeners) { listeners.remove(listener); } } - - public void cast(byte[] buf, int off, int len, + + public void cast(byte[] buf, int off, int len, InetAddress toAddress, int nToPort) throws IOException { - + if(socket == null) throw new IOException("multi caster is not started"); - + if(len >= MAX_PACKET_SIZE) throw new IOException("packet size exceeds limit of " + MAX_PACKET_SIZE); - - DatagramPacket packet = new DatagramPacket(buf, off, + + DatagramPacket packet = new DatagramPacket(buf, off, len, toAddress, nToPort); socket.send(packet); } - - public void start(String strOutboundAddress, + + public void start(String strOutboundAddress, String strClusterAddress, int nPort) throws SocketException { assert(socket == null); @@ -82,22 +82,22 @@ public class MultiCaster implements Runnable { } catch(IOException e) { s_logger.error("Unexpected exception " , e); } - + if(addr != null && addr.isMulticastAddress()) { try { socket = new MulticastSocket(nPort); socket.setReuseAddress(true); - + if(s_logger.isInfoEnabled()) s_logger.info("Join multicast group : " + addr); - + ((MulticastSocket)socket).joinGroup(addr); ((MulticastSocket)socket).setTimeToLive(1); - + if(strOutboundAddress != null) { if(s_logger.isInfoEnabled()) s_logger.info("set outgoing interface to : " + strOutboundAddress); - + InetAddress ia = InetAddress.getByName(strOutboundAddress); NetworkInterface ni = NetworkInterface.getByInetAddress(ia); ((MulticastSocket)socket).setNetworkInterface(ni); @@ -109,16 +109,16 @@ public class MultiCaster implements Runnable { socket = new DatagramSocket(nPort); socket.setReuseAddress(true); } - + driver = new Thread(this, "Multi-caster"); driver.setDaemon(true); driver.start(); } - + public void stop() { if(socket != null) { stopRequested = true; - + socket.close(); if(driver != null) { try { @@ -128,17 +128,17 @@ public class MultiCaster implements Runnable { driver = null; } } - + socket = null; stopRequested = false; } - + public void run() { while(!stopRequested) { try { DatagramPacket packet = new DatagramPacket(recvBuffer, recvBuffer.length); socket.receive(packet); - + for(Object listener : listeners.toArray()) { ((MultiCasterListener)listener).onMultiCasting(packet.getData(), packet.getOffset(), packet.getLength(), packet.getAddress()); diff --git a/agent-simulator/src/com/cloud/agent/MultiCasterListener.java b/plugins/hypervisors/simulator/src/com/cloud/agent/MultiCasterListener.java similarity index 100% rename from agent-simulator/src/com/cloud/agent/MultiCasterListener.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/MultiCasterListener.java diff --git a/agent-simulator/src/com/cloud/agent/SimulatorCmd.java b/plugins/hypervisors/simulator/src/com/cloud/agent/SimulatorCmd.java similarity index 96% rename from agent-simulator/src/com/cloud/agent/SimulatorCmd.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/SimulatorCmd.java index 342bfd2491e..caed518dd78 100644 --- a/agent-simulator/src/com/cloud/agent/SimulatorCmd.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/SimulatorCmd.java @@ -20,17 +20,17 @@ import java.io.Serializable; public class SimulatorCmd implements Serializable { private static final long serialVersionUID = 1L; - + private String testCase = "DEFAULT"; - + public SimulatorCmd(String testCase) { - this.testCase = testCase; + this.testCase = testCase; } - + public String getTestCase() { return testCase; } - + public void setTestCase(String testCase) { this.testCase = testCase; } diff --git a/agent-simulator/src/com/cloud/agent/SimulatorMigrateVmCmd.java b/plugins/hypervisors/simulator/src/com/cloud/agent/SimulatorMigrateVmCmd.java similarity index 99% rename from agent-simulator/src/com/cloud/agent/SimulatorMigrateVmCmd.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/SimulatorMigrateVmCmd.java index f86b16ee7d4..6a2190d696a 100644 --- a/agent-simulator/src/com/cloud/agent/SimulatorMigrateVmCmd.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/SimulatorMigrateVmCmd.java @@ -21,12 +21,12 @@ public class SimulatorMigrateVmCmd extends SimulatorCmd { private static final long serialVersionUID = 1L; private String destIp; - + private String vmName; private long ramSize; private int cpuCount; private int utilization; - + public SimulatorMigrateVmCmd(String testCase) { super(testCase); } @@ -38,7 +38,7 @@ public class SimulatorMigrateVmCmd extends SimulatorCmd { public void setDestIp(String destIp) { this.destIp = destIp; } - + public String getVmName() { return vmName; } @@ -70,14 +70,14 @@ public class SimulatorMigrateVmCmd extends SimulatorCmd { public void setUtilization(int utilization) { this.utilization = utilization; } - + public String toString() { StringBuffer sb = new StringBuffer(); sb.append("SimulatorMigrateVmCmd {").append("vm: ").append(getVmName()); sb.append(", destIp: ").append(getDestIp()).append(", ramSize: ").append(getRamSize()); sb.append(", cpuCount: ").append(getCpuCount()).append(", utilization: ").append(getUtilization()); sb.append("}"); - + return sb.toString(); } } diff --git a/agent-simulator/src/com/cloud/agent/manager/MockAgentManager.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManager.java similarity index 97% rename from agent-simulator/src/com/cloud/agent/manager/MockAgentManager.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManager.java index 7db5b20f55c..2bb1205b115 100644 --- a/agent-simulator/src/com/cloud/agent/manager/MockAgentManager.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManager.java @@ -56,8 +56,6 @@ public interface MockAgentManager extends Manager { Answer pingTest(PingTestCommand cmd); - Answer prepareForMigrate(PrepareForMigrationCommand cmd); - MockHost getHost(String guid); Answer maintain(MaintainCommand cmd); diff --git a/agent-simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java similarity index 98% rename from agent-simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java index cb992979e07..f6bc8fc7fee 100755 --- a/agent-simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java @@ -429,15 +429,6 @@ public class MockAgentManagerImpl implements MockAgentManager { return new Answer(cmd); } - @Override - public PrepareForMigrationAnswer prepareForMigrate(PrepareForMigrationCommand cmd) { - VirtualMachineTO vm = cmd.getVirtualMachine(); - if (s_logger.isDebugEnabled()) { - s_logger.debug("Preparing host for migrating " + vm); - } - return new PrepareForMigrationAnswer(cmd); - } - @Override public boolean start() { return true; diff --git a/agent-simulator/src/com/cloud/agent/manager/MockStorageManager.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManager.java similarity index 85% rename from agent-simulator/src/com/cloud/agent/manager/MockStorageManager.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManager.java index 3b7a286c5e1..ff26d185d76 100644 --- a/agent-simulator/src/com/cloud/agent/manager/MockStorageManager.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManager.java @@ -35,35 +35,26 @@ import com.cloud.agent.api.ModifyStoragePoolCommand; import com.cloud.agent.api.SecStorageSetupCommand; import com.cloud.agent.api.SecStorageVMSetupCommand; import com.cloud.agent.api.StoragePoolInfo; -import com.cloud.agent.api.storage.CopyVolumeAnswer; -import com.cloud.agent.api.storage.CopyVolumeCommand; -import com.cloud.agent.api.storage.CreateAnswer; -import com.cloud.agent.api.storage.CreateCommand; -import com.cloud.agent.api.storage.DeleteTemplateCommand; -import com.cloud.agent.api.storage.DestroyCommand; -import com.cloud.agent.api.storage.DownloadCommand; -import com.cloud.agent.api.storage.DownloadProgressCommand; -import com.cloud.agent.api.storage.ListTemplateCommand; -import com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer; -import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand; +import com.cloud.agent.api.storage.*; import com.cloud.utils.component.Manager; public interface MockStorageManager extends Manager { public static final long DEFAULT_HOST_STORAGE_SIZE = 1 * 1024 * 1024 * 1024 * 1024L; //1T public static final long DEFAULT_TEMPLATE_SIZE = 1 * 1000 * 1000 * 1000L; //1G - + public PrimaryStorageDownloadAnswer primaryStorageDownload(PrimaryStorageDownloadCommand cmd); - + public CreateAnswer createVolume(CreateCommand cmd); public AttachVolumeAnswer AttachVolume(AttachVolumeCommand cmd); public Answer AttachIso(AttachIsoCommand cmd); - + public Answer DeleteStoragePool(DeleteStoragePoolCommand cmd); public Answer ModifyStoragePool(ModifyStoragePoolCommand cmd); public Answer CreateStoragePool(CreateStoragePoolCommand cmd); - + public Answer SecStorageSetup(SecStorageSetupCommand cmd); public Answer ListTemplates(ListTemplateCommand cmd); + public Answer ListVolumes(ListVolumeCommand cmd); public Answer Destroy(DestroyCommand cmd); public Answer Download(DownloadCommand cmd); public Answer DownloadProcess(DownloadProgressCommand cmd); @@ -74,7 +65,7 @@ public interface MockStorageManager extends Manager { public Answer CreateVolumeFromSnapshot(CreateVolumeFromSnapshotCommand cmd); public Answer DeleteTemplate(DeleteTemplateCommand cmd); public Answer SecStorageVMSetup(SecStorageVMSetupCommand cmd); - + public void preinstallTemplates(String url, long zoneId); StoragePoolInfo getLocalStorage(String hostGuid); diff --git a/agent-simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java similarity index 95% rename from agent-simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java index cc15b206738..1076089dcd6 100644 --- a/agent-simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java @@ -30,6 +30,7 @@ import java.util.UUID; import javax.ejb.Local; import javax.naming.ConfigurationException; +import com.cloud.agent.api.storage.*; import org.apache.log4j.Logger; import com.cloud.agent.api.Answer; @@ -56,20 +57,6 @@ import com.cloud.agent.api.SecStorageSetupAnswer; import com.cloud.agent.api.SecStorageSetupCommand; import com.cloud.agent.api.SecStorageVMSetupCommand; import com.cloud.agent.api.StoragePoolInfo; -import com.cloud.agent.api.storage.CopyVolumeAnswer; -import com.cloud.agent.api.storage.CopyVolumeCommand; -import com.cloud.agent.api.storage.CreateAnswer; -import com.cloud.agent.api.storage.CreateCommand; -import com.cloud.agent.api.storage.CreatePrivateTemplateAnswer; -import com.cloud.agent.api.storage.DeleteTemplateCommand; -import com.cloud.agent.api.storage.DestroyCommand; -import com.cloud.agent.api.storage.DownloadAnswer; -import com.cloud.agent.api.storage.DownloadCommand; -import com.cloud.agent.api.storage.DownloadProgressCommand; -import com.cloud.agent.api.storage.ListTemplateAnswer; -import com.cloud.agent.api.storage.ListTemplateCommand; -import com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer; -import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand; import com.cloud.agent.api.to.StorageFilerTO; import com.cloud.agent.api.to.VolumeTO; import com.cloud.simulator.MockHost; @@ -139,8 +126,8 @@ public class MockStorageManagerImpl implements MockStorageManager { @Override public PrimaryStorageDownloadAnswer primaryStorageDownload(PrimaryStorageDownloadCommand cmd) { - MockVolumeVO template = findVolumeFromSecondary(cmd.getUrl(), cmd.getSecondaryStorageUrl(), - MockVolumeType.TEMPLATE); + MockVolumeVO template = findVolumeFromSecondary(cmd.getUrl(), cmd.getSecondaryStorageUrl(), + MockVolumeType.TEMPLATE); if (template == null) { return new PrimaryStorageDownloadAnswer("Can't find primary storage"); } @@ -421,6 +408,49 @@ public class MockStorageManagerImpl implements MockStorageManager { return new SecStorageSetupAnswer(storage.getMountPoint()); } + @Override + public Answer ListVolumes(ListVolumeCommand cmd) { + Transaction txn = Transaction.open(Transaction.SIMULATOR_DB); + MockSecStorageVO storage = null; + try { + txn.start(); + storage = _mockSecStorageDao.findByUrl(cmd.getSecUrl()); + if (storage == null) { + return new Answer(cmd, false, "Failed to get secondary storage"); + } + txn.commit(); + } catch (Exception ex) { + txn.rollback(); + throw new CloudRuntimeException("Error when finding sec storage " + cmd.getSecUrl(), ex); + } finally { + txn.close(); + txn = Transaction.open(Transaction.CLOUD_DB); + txn.close(); + } + + txn = Transaction.open(Transaction.SIMULATOR_DB); + try { + txn.start(); + List volumes = _mockVolumeDao.findByStorageIdAndType(storage.getId(), + MockVolumeType.VOLUME); + + Map templateInfos = new HashMap(); + for (MockVolumeVO volume : volumes) { + templateInfos.put(volume.getId(), new TemplateInfo(volume.getName(), volume.getPath() + .replaceAll(storage.getMountPoint(), ""), volume.getSize(), volume.getSize(), true, false)); + } + txn.commit(); + return new ListVolumeAnswer(cmd.getSecUrl(), templateInfos); + } catch (Exception ex) { + txn.rollback(); + throw new CloudRuntimeException("Error when finding template on sec storage " + storage.getId(), ex); + } finally { + txn.close(); + txn = Transaction.open(Transaction.CLOUD_DB); + txn.close(); + } + } + @Override public Answer ListTemplates(ListTemplateCommand cmd) { Transaction txn = Transaction.open(Transaction.SIMULATOR_DB); @@ -703,7 +733,7 @@ public class MockStorageManagerImpl implements MockStorageManager { txn = Transaction.open(Transaction.CLOUD_DB); txn.close(); } - + MockVolumeVO newsnapshot = new MockVolumeVO(); String name = UUID.randomUUID().toString(); newsnapshot.setName(name); @@ -907,7 +937,7 @@ public class MockStorageManagerImpl implements MockStorageManager { long defaultTemplateSize = 2 * 1024 * 1024 * 1024L; MockVolumeVO template = new MockVolumeVO(); template.setName("simulator-domR"); - template.setPath(storage.getMountPoint() + "template/tmpl/1/9/" + UUID.randomUUID().toString()); + template.setPath(storage.getMountPoint() + "template/tmpl/1/10/" + UUID.randomUUID().toString()); template.setPoolId(storage.getId()); template.setSize(defaultTemplateSize); template.setType(MockVolumeType.TEMPLATE); @@ -928,7 +958,7 @@ public class MockStorageManagerImpl implements MockStorageManager { template = new MockVolumeVO(); template.setName("simulator-Centos"); - template.setPath(storage.getMountPoint() + "template/tmpl/1/10/" + UUID.randomUUID().toString()); + template.setPath(storage.getMountPoint() + "template/tmpl/1/11/" + UUID.randomUUID().toString()); template.setPoolId(storage.getId()); template.setSize(defaultTemplateSize); template.setType(MockVolumeType.TEMPLATE); @@ -953,7 +983,7 @@ public class MockStorageManagerImpl implements MockStorageManager { @Override public StoragePoolInfo getLocalStorage(String hostGuid) { Transaction txn = Transaction.open(Transaction.SIMULATOR_DB); - MockHost host = null; + MockHost host = null; MockStoragePoolVO storagePool = null; try { txn.start(); @@ -968,7 +998,7 @@ public class MockStorageManagerImpl implements MockStorageManager { txn = Transaction.open(Transaction.CLOUD_DB); txn.close(); } - + if (storagePool == null) { String uuid = UUID.randomUUID().toString(); storagePool = new MockStoragePoolVO(); @@ -998,7 +1028,7 @@ public class MockStorageManagerImpl implements MockStorageManager { @Override public StoragePoolInfo getLocalStorage(String hostGuid, Long storageSize) { Transaction txn = Transaction.open(Transaction.SIMULATOR_DB); - MockHost host = null; + MockHost host = null; try { txn.start(); host = _mockHostDao.findByGuid(hostGuid); diff --git a/agent-simulator/src/com/cloud/agent/manager/MockVmManager.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManager.java similarity index 97% rename from agent-simulator/src/com/cloud/agent/manager/MockVmManager.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManager.java index 07cf584883e..117e2f6374f 100644 --- a/agent-simulator/src/com/cloud/agent/manager/MockVmManager.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManager.java @@ -40,7 +40,7 @@ import com.cloud.vm.VirtualMachine.State; public interface MockVmManager extends Manager { public Answer stopVM(StopCommand cmd); public Answer rebootVM(RebootCommand cmd); - + public Answer checkVmState(CheckVirtualMachineCommand cmd); public Map getVmStates(String hostGuid); public Answer getVncPort(GetVncPortCommand cmd); @@ -49,31 +49,32 @@ public interface MockVmManager extends Manager { Answer getVmStats(GetVmStatsCommand cmd); public CheckSshAnswer checkSshCommand(CheckSshCommand cmd); - + Answer SetStaticNatRules(SetStaticNatRulesCommand cmd); - + Answer SetPortForwardingRules(SetPortForwardingRulesCommand cmd); Answer SetFirewallRules(SetFirewallRulesCommand cmd); - + Answer getNetworkUsage(NetworkUsageCommand cmd); - + Answer IpAssoc(IpAssocCommand cmd); Answer LoadBalancerConfig(LoadBalancerConfigCommand cmd); - + Answer AddDhcpEntry(DhcpEntryCommand cmd); - + Answer setVmData(VmDataCommand cmd); Answer CleanupNetworkRules(CleanupNetworkRulesCmd cmd, SimulatorInfo info); - + Answer CheckConsoleProxyLoad(CheckConsoleProxyLoadCommand cmd); Answer WatchConsoleProxyLoad(WatchConsoleProxyLoadCommand cmd); - + Answer SavePassword(SavePasswordCommand cmd); HashMap> syncNetworkGroups(SimulatorInfo info); SecurityGroupRuleAnswer AddSecurityGroupRules(SecurityGroupRulesCmd cmd, SimulatorInfo info); MigrateAnswer Migrate(MigrateCommand cmd, SimulatorInfo info); + PrepareForMigrationAnswer prepareForMigrate(PrepareForMigrationCommand cmd); GetDomRVersionAnswer getDomRVersion(GetDomRVersionCmd cmd); Map getVms(String hostGuid); diff --git a/agent-simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java similarity index 88% rename from agent-simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java index 78881f2fc3a..40cd80acf8e 100644 --- a/agent-simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java @@ -60,20 +60,20 @@ public class MockVmManagerImpl implements MockVmManager { @Inject MockHostDao _mockHostDao = null; @Inject MockSecurityRulesDao _mockSecurityDao = null; private Map>> _securityRules = new ConcurrentHashMap>>(); - + public MockVmManagerImpl() { } - + @Override public boolean configure(String name, Map params) throws ConfigurationException { - + return true; } - + public String startVM(String vmName, NicTO[] nics, - int cpuHz, long ramSize, - String bootArgs, String hostGuid) { + int cpuHz, long ramSize, + String bootArgs, String hostGuid) { Transaction txn = Transaction.open(Transaction.SIMULATOR_DB); MockHost host = null; @@ -95,7 +95,7 @@ public class MockVmManagerImpl implements MockVmManager { txn = Transaction.open(Transaction.CLOUD_DB); txn.close(); } - + if(vm == null) { int vncPort = 0; if(vncPort < 0) @@ -107,14 +107,15 @@ public class MockVmManagerImpl implements MockVmManager { vm.setName(vmName); vm.setVncPort(vncPort); vm.setHostId(host.getId()); + vm.setBootargs(bootArgs); if(vmName.startsWith("s-")) { - vm.setType("SecondaryStorageVm"); + vm.setType("SecondaryStorageVm"); } else if (vmName.startsWith("v-")) { - vm.setType("ConsoleProxy"); + vm.setType("ConsoleProxy"); } else if (vmName.startsWith("r-")) { - vm.setType("DomainRouter"); + vm.setType("DomainRouter"); } else if (vmName.startsWith("i-")) { - vm.setType("User"); + vm.setType("User"); } txn = Transaction.open(Transaction.SIMULATOR_DB); try { @@ -133,18 +134,18 @@ public class MockVmManagerImpl implements MockVmManager { if(vm.getState() == State.Stopped) { vm.setState(State.Running); txn = Transaction.open(Transaction.SIMULATOR_DB); - try { - txn.start(); - _mockVmDao.update(vm.getId(), (MockVMVO)vm); - txn.commit(); - } catch (Exception ex) { - txn.rollback(); - throw new CloudRuntimeException("unable to update vm " + vm.getName(), ex); - } finally { - txn.close(); + try { + txn.start(); + _mockVmDao.update(vm.getId(), (MockVMVO)vm); + txn.commit(); + } catch (Exception ex) { + txn.rollback(); + throw new CloudRuntimeException("unable to update vm " + vm.getName(), ex); + } finally { + txn.close(); txn = Transaction.open(Transaction.CLOUD_DB); txn.close(); - } + } } } @@ -212,7 +213,7 @@ public class MockVmManagerImpl implements MockVmManager { } return true; } - + @Override public Map getVms(String hostGuid) { Transaction txn = Transaction.open(Transaction.SIMULATOR_DB); @@ -238,15 +239,16 @@ public class MockVmManagerImpl implements MockVmManager { @Override public CheckRouterAnswer checkRouter(CheckRouterCommand cmd) { String router_name = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME); - int router_id = Integer.parseInt(router_name.split("-")[1]); - if (router_id % 2 == 0) { - s_logger.debug("Found even routerId, making it MASTER in RvR"); + MockVm vm = _mockVmDao.findByVmName(router_name); + String args = vm.getBootargs(); + if (args.indexOf("router_pr=100") > 0) { + s_logger.debug("Router priority is for MASTER"); CheckRouterAnswer ans = new CheckRouterAnswer(cmd, "Status: MASTER & Bumped: NO", true); ans.setState(VirtualRouter.RedundantState.MASTER); return ans; } else { - s_logger.debug("Found odd routerId, making it BACKUP in RvR"); - CheckRouterAnswer ans = new CheckRouterAnswer(cmd, "Status: MASTER & Bumped: NO", true); + s_logger.debug("Router priority is for BACKUP"); + CheckRouterAnswer ans = new CheckRouterAnswer(cmd, "Status: BACKUP & Bumped: NO", true); ans.setState(VirtualRouter.RedundantState.BACKUP); return ans; } @@ -255,13 +257,13 @@ public class MockVmManagerImpl implements MockVmManager { @Override public Answer bumpPriority(BumpUpPriorityCommand cmd) { String router_name = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME); - int router_id = Integer.parseInt(router_name.split("-")[1]); - if (router_id % 2 == 0) { - return new Answer(cmd, true, "Status: MASTER & Bumped: YES"); - } else { + MockVm vm = _mockVmDao.findByVmName(router_name); + String args = vm.getBootargs(); + if (args.indexOf("router_pr=100") > 0) { return new Answer(cmd, true, "Status: BACKUP & Bumped: YES"); + } else { + return new Answer(cmd, true, "Status: MASTER & Bumped: YES"); } - } @Override @@ -303,8 +305,8 @@ public class MockVmManagerImpl implements MockVmManager { @Override public String getName() { return this.getClass().getSimpleName(); - } - + } + @Override public Answer getVmStats(GetVmStatsCommand cmd) { HashMap vmStatsNameMap = new HashMap(); @@ -370,9 +372,9 @@ public class MockVmManagerImpl implements MockVmManager { @Override public Answer SetFirewallRules(SetFirewallRulesCommand cmd) { - return new Answer(cmd); + return new Answer(cmd); } - + @Override public NetworkUsageAnswer getNetworkUsage(NetworkUsageCommand cmd) { @@ -388,8 +390,12 @@ public class MockVmManagerImpl implements MockVmManager { String destGuid = cmd.getHostGuid(); MockVMVO vm = _mockVmDao.findByVmNameAndHost(vmName, info.getHostUuid()); if (vm == null) { - return new MigrateAnswer(cmd, false, "can;t find vm:" + vmName + " on host:" + info.getHostUuid(), null); - } + return new MigrateAnswer(cmd, false, "can't find vm:" + vmName + " on host:" + info.getHostUuid(), null); + } else { + if (vm.getState() == State.Migrating) { + vm.setState(State.Running); + } + } MockHost destHost = _mockHostDao.findByGuid(destGuid); if (destHost == null) { @@ -409,6 +415,27 @@ public class MockVmManagerImpl implements MockVmManager { } } + @Override + public PrepareForMigrationAnswer prepareForMigrate(PrepareForMigrationCommand cmd) { + Transaction txn = Transaction.open(Transaction.SIMULATOR_DB); + VirtualMachineTO vmTo = cmd.getVirtualMachine(); + try { + txn.start(); + MockVMVO vm = _mockVmDao.findById(vmTo.getId()); + vm.setState(State.Migrating); + _mockVmDao.update(vm.getId(), vm); + txn.commit(); + } catch (Exception ex) { + txn.rollback(); + throw new CloudRuntimeException("unable to find vm " + vmTo.getName(), ex); + } finally { + txn.close(); + txn = Transaction.open(Transaction.CLOUD_DB); + txn.close(); + return new PrepareForMigrationAnswer(cmd); + } + } + @Override public Answer IpAssoc(IpAssocCommand cmd) { return new Answer(cmd); @@ -516,20 +543,20 @@ public class MockVmManagerImpl implements MockVmManager { public Answer WatchConsoleProxyLoad(WatchConsoleProxyLoadCommand cmd) { return Answer.createUnsupportedCommandAnswer(cmd); } - + @Override public GetDomRVersionAnswer getDomRVersion(GetDomRVersionCmd cmd) { - return new GetDomRVersionAnswer(cmd, null, null, null); + return new GetDomRVersionAnswer(cmd, null, null, null); } @Override public SecurityGroupRuleAnswer AddSecurityGroupRules(SecurityGroupRulesCmd cmd, SimulatorInfo info) { if (!info.isEnabled()) { - return new SecurityGroupRuleAnswer(cmd, false, "Disabled", SecurityGroupRuleAnswer.FailureReason.CANNOT_BRIDGE_FIREWALL); + return new SecurityGroupRuleAnswer(cmd, false, "Disabled", SecurityGroupRuleAnswer.FailureReason.CANNOT_BRIDGE_FIREWALL); } - + Map> rules = _securityRules.get(info.getHostUuid()); - + if (rules == null) { logSecurityGroupAction(cmd, null); rules = new ConcurrentHashMap>(); @@ -539,10 +566,10 @@ public class MockVmManagerImpl implements MockVmManager { logSecurityGroupAction(cmd, rules.get(cmd.getVmName())); rules.put(cmd.getVmName(), new Ternary(cmd.getSignature(), cmd.getVmId(), cmd.getSeqNum())); } - + return new SecurityGroupRuleAnswer(cmd); } - + private boolean logSecurityGroupAction(SecurityGroupRulesCmd cmd, Ternary rule) { String action = ", do nothing"; String reason = ", reason="; @@ -554,13 +581,13 @@ public class MockVmManagerImpl implements MockVmManager { s_logger.info("New seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum); updateSeqnoAndSig = true; if (!cmd.getSignature().equals(currSig)) { - s_logger.info("New seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum + s_logger.info("New seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum + " new signature received:" + cmd.getSignature() + " curr=" + currSig + ", updated iptables"); action = ", updated iptables"; reason = reason + "seqno_increased_sig_changed"; } else { - s_logger.info("New seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum - + " no change in signature:" + cmd.getSignature() + ", do nothing"); + s_logger.info("New seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum + + " no change in signature:" + cmd.getSignature() + ", do nothing"); reason = reason + "seqno_increased_sig_same"; } } else if (cmd.getSeqNum() < currSeqnum) { @@ -568,14 +595,14 @@ public class MockVmManagerImpl implements MockVmManager { reason = reason + "seqno_decreased"; } else { if (!cmd.getSignature().equals(currSig)) { - s_logger.info("Identical seqno received: " + cmd.getSeqNum() + s_logger.info("Identical seqno received: " + cmd.getSeqNum() + " new signature received:" + cmd.getSignature() + " curr=" + currSig + ", updated iptables"); action = ", updated iptables"; reason = reason + "seqno_same_sig_changed"; updateSeqnoAndSig = true; } else { - s_logger.info("Identical seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum - + " no change in signature:" + cmd.getSignature() + ", do nothing"); + s_logger.info("Identical seqno received: " + cmd.getSeqNum() + " curr=" + currSeqnum + + " no change in signature:" + cmd.getSignature() + ", do nothing"); reason = reason + "seqno_same_sig_same"; } } @@ -585,8 +612,8 @@ public class MockVmManagerImpl implements MockVmManager { action = ", updated iptables"; reason = ", seqno_new"; } - s_logger.info("Programmed network rules for vm " + cmd.getVmName() + " seqno=" + cmd.getSeqNum() - + " signature=" + cmd.getSignature() + s_logger.info("Programmed network rules for vm " + cmd.getVmName() + " seqno=" + cmd.getSeqNum() + + " signature=" + cmd.getSignature() + " guestIp=" + cmd.getGuestIp() + ", numIngressRules=" + cmd.getIngressRuleSet().length + ", numEgressRules=" + cmd.getEgressRuleSet().length + " total cidrs=" + cmd.getTotalNumCidrs() + action + reason); @@ -595,13 +622,13 @@ public class MockVmManagerImpl implements MockVmManager { @Override public Answer SavePassword(SavePasswordCommand cmd) { - return new Answer(cmd); + return new Answer(cmd); } - + @Override public HashMap> syncNetworkGroups(SimulatorInfo info) { HashMap> maps = new HashMap>(); - + Map> rules = _securityRules.get(info.getHostUuid()); if (rules == null) { return maps; diff --git a/agent-simulator/src/com/cloud/agent/manager/SimulatorInfo.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorInfo.java similarity index 98% rename from agent-simulator/src/com/cloud/agent/manager/SimulatorInfo.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorInfo.java index dafd33abb51..c084730c6bb 100644 --- a/agent-simulator/src/com/cloud/agent/manager/SimulatorInfo.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorInfo.java @@ -20,39 +20,39 @@ public class SimulatorInfo { private boolean enabled; private int timeout; private String hostUuid; - + public SimulatorInfo(boolean enabled, int timeout, String hostUuid) { this.enabled = enabled; this.timeout = timeout; this.hostUuid = hostUuid; } - + public SimulatorInfo() { this.enabled = true; this.timeout = -1; this.hostUuid = null; } - + public boolean isEnabled() { return this.enabled; } - + public int getTimeout() { return this.timeout; } - + public String getHostUuid() { return this.hostUuid; } - + public void setEnabled(boolean enabled) { this.enabled = enabled; } - + public void setTimeout(int timeout) { this.timeout = timeout; } - + public void setHostUuid(String hostUuid) { this.hostUuid = hostUuid; } diff --git a/agent-simulator/src/com/cloud/agent/manager/SimulatorManager.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManager.java similarity index 97% rename from agent-simulator/src/com/cloud/agent/manager/SimulatorManager.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManager.java index 2b31b14d32f..ff8c32ce185 100755 --- a/agent-simulator/src/com/cloud/agent/manager/SimulatorManager.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManager.java @@ -23,7 +23,6 @@ import java.util.Map; import com.cloud.agent.api.Answer; import com.cloud.agent.api.Command; import com.cloud.agent.api.StoragePoolInfo; -import com.cloud.agent.mockvm.MockVm; import com.cloud.simulator.MockVMVO; import com.cloud.utils.Pair; import com.cloud.utils.component.Manager; @@ -31,10 +30,10 @@ import com.cloud.vm.VirtualMachine.State; public interface SimulatorManager extends Manager { public static final String Name = "simulator manager"; - + public enum AgentType { Computing(0), // not used anymore - Routing(1), + Routing(1), Storage(2); int value; @@ -56,7 +55,7 @@ public interface SimulatorManager extends Manager { Answer simulate(Command cmd, String hostGuid); StoragePoolInfo getLocalStorage(String hostGuid); - + boolean configureSimulator(Long zoneId, Long podId, Long clusterId, Long hostId, String command, String values); public HashMap> syncNetworkGroups(String hostGuid); diff --git a/agent-simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java similarity index 81% rename from agent-simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java index 9a81ea6edaa..4f70ee5bae7 100644 --- a/agent-simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java @@ -16,8 +16,6 @@ // under the License. package com.cloud.agent.manager; -import java.sql.Connection; -import java.sql.SQLException; import java.util.HashMap; import java.util.Map; @@ -25,6 +23,7 @@ import javax.ejb.Local; import javax.naming.ConfigurationException; import com.cloud.agent.api.*; +import com.cloud.agent.api.storage.*; import org.apache.log4j.Logger; import com.cloud.agent.api.check.CheckSshCommand; @@ -38,14 +37,6 @@ import com.cloud.agent.api.routing.SetFirewallRulesCommand; import com.cloud.agent.api.routing.SetPortForwardingRulesCommand; import com.cloud.agent.api.routing.SetStaticNatRulesCommand; import com.cloud.agent.api.routing.VmDataCommand; -import com.cloud.agent.api.storage.CopyVolumeCommand; -import com.cloud.agent.api.storage.CreateCommand; -import com.cloud.agent.api.storage.DeleteTemplateCommand; -import com.cloud.agent.api.storage.DestroyCommand; -import com.cloud.agent.api.storage.DownloadCommand; -import com.cloud.agent.api.storage.DownloadProgressCommand; -import com.cloud.agent.api.storage.ListTemplateCommand; -import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand; import com.cloud.simulator.MockConfigurationVO; import com.cloud.simulator.MockHost; import com.cloud.simulator.MockVMVO; @@ -58,6 +49,7 @@ import com.cloud.utils.db.DB; import com.cloud.utils.db.Transaction; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.vm.VirtualMachine.State; + @Local(value = { SimulatorManager.class }) public class SimulatorManagerImpl implements SimulatorManager { private static final Logger s_logger = Logger.getLogger(SimulatorManagerImpl.class); @@ -121,83 +113,83 @@ public class SimulatorManagerImpl implements SimulatorManager { public Answer simulate(Command cmd, String hostGuid) { Transaction txn = Transaction.open(Transaction.SIMULATOR_DB); // txn.transitToUserManagedConnection(_concierge.conn()); - + try { MockHost host = _mockHost.findByGuid(hostGuid); String cmdName = cmd.toString(); int index = cmdName.lastIndexOf("."); if (index != -1) { - cmdName = cmdName.substring(index + 1); + cmdName = cmdName.substring(index + 1); } MockConfigurationVO config = _mockConfigDao.findByNameBottomUP(host.getDataCenterId(), host.getPodId(), host.getClusterId(), host.getId(), cmdName); - + SimulatorInfo info = new SimulatorInfo(); info.setHostUuid(hostGuid); - + if (config != null) { Map configParameters = config.getParameters(); for (Map.Entry entry : configParameters.entrySet()) { - if (entry.getKey().equalsIgnoreCase("enabled")) { - info.setEnabled(Boolean.parseBoolean(entry.getValue())); - } else if (entry.getKey().equalsIgnoreCase("timeout")) { - try { - info.setTimeout(Integer.valueOf(entry.getValue())); - } catch (NumberFormatException e) { - s_logger.debug("invalid timeout parameter: " + e.toString()); - } - } else if (entry.getKey().equalsIgnoreCase("wait")) { - try { - int wait = Integer.valueOf(entry.getValue()); - Thread.sleep(wait * 1000); - } catch (NumberFormatException e) { - s_logger.debug("invalid timeout parameter: " + e.toString()); - } catch (InterruptedException e) { - s_logger.debug("thread is interrupted: " + e.toString()); - } - } + if (entry.getKey().equalsIgnoreCase("enabled")) { + info.setEnabled(Boolean.parseBoolean(entry.getValue())); + } else if (entry.getKey().equalsIgnoreCase("timeout")) { + try { + info.setTimeout(Integer.valueOf(entry.getValue())); + } catch (NumberFormatException e) { + s_logger.debug("invalid timeout parameter: " + e.toString()); + } + } else if (entry.getKey().equalsIgnoreCase("wait")) { + try { + int wait = Integer.valueOf(entry.getValue()); + Thread.sleep(wait * 1000); + } catch (NumberFormatException e) { + s_logger.debug("invalid timeout parameter: " + e.toString()); + } catch (InterruptedException e) { + s_logger.debug("thread is interrupted: " + e.toString()); + } + } } } - + if (cmd instanceof GetHostStatsCommand) { - return _mockAgentMgr.getHostStatistic((GetHostStatsCommand)cmd); + return _mockAgentMgr.getHostStatistic((GetHostStatsCommand) cmd); } else if (cmd instanceof CheckHealthCommand) { - return _mockAgentMgr.checkHealth((CheckHealthCommand)cmd); + return _mockAgentMgr.checkHealth((CheckHealthCommand) cmd); } else if (cmd instanceof PingTestCommand) { - return _mockAgentMgr.pingTest((PingTestCommand)cmd); + return _mockAgentMgr.pingTest((PingTestCommand) cmd); } else if (cmd instanceof PrepareForMigrationCommand) { - return _mockAgentMgr.prepareForMigrate((PrepareForMigrationCommand)cmd); + return _mockVmMgr.prepareForMigrate((PrepareForMigrationCommand) cmd); } else if (cmd instanceof MigrateCommand) { - return _mockVmMgr.Migrate((MigrateCommand)cmd, info); + return _mockVmMgr.Migrate((MigrateCommand) cmd, info); } else if (cmd instanceof StartCommand) { - return _mockVmMgr.startVM((StartCommand)cmd, info); + return _mockVmMgr.startVM((StartCommand) cmd, info); } else if (cmd instanceof CheckSshCommand) { - return _mockVmMgr.checkSshCommand((CheckSshCommand)cmd); + return _mockVmMgr.checkSshCommand((CheckSshCommand) cmd); } else if (cmd instanceof CheckVirtualMachineCommand) { - return _mockVmMgr.checkVmState((CheckVirtualMachineCommand)cmd); + return _mockVmMgr.checkVmState((CheckVirtualMachineCommand) cmd); } else if (cmd instanceof SetStaticNatRulesCommand) { - return _mockVmMgr.SetStaticNatRules((SetStaticNatRulesCommand)cmd); + return _mockVmMgr.SetStaticNatRules((SetStaticNatRulesCommand) cmd); } else if (cmd instanceof SetFirewallRulesCommand) { - return _mockVmMgr.SetFirewallRules((SetFirewallRulesCommand)cmd); + return _mockVmMgr.SetFirewallRules((SetFirewallRulesCommand) cmd); } else if (cmd instanceof SetPortForwardingRulesCommand) { - return _mockVmMgr.SetPortForwardingRules((SetPortForwardingRulesCommand)cmd); + return _mockVmMgr.SetPortForwardingRules((SetPortForwardingRulesCommand) cmd); } else if (cmd instanceof NetworkUsageCommand) { - return _mockVmMgr.getNetworkUsage((NetworkUsageCommand)cmd); + return _mockVmMgr.getNetworkUsage((NetworkUsageCommand) cmd); } else if (cmd instanceof IpAssocCommand) { - return _mockVmMgr.IpAssoc((IpAssocCommand)cmd); + return _mockVmMgr.IpAssoc((IpAssocCommand) cmd); } else if (cmd instanceof LoadBalancerConfigCommand) { - return _mockVmMgr.LoadBalancerConfig((LoadBalancerConfigCommand)cmd); + return _mockVmMgr.LoadBalancerConfig((LoadBalancerConfigCommand) cmd); } else if (cmd instanceof DhcpEntryCommand) { - return _mockVmMgr.AddDhcpEntry((DhcpEntryCommand)cmd); + return _mockVmMgr.AddDhcpEntry((DhcpEntryCommand) cmd); } else if (cmd instanceof VmDataCommand) { - return _mockVmMgr.setVmData((VmDataCommand)cmd); + return _mockVmMgr.setVmData((VmDataCommand) cmd); } else if (cmd instanceof CleanupNetworkRulesCmd) { - return _mockVmMgr.CleanupNetworkRules((CleanupNetworkRulesCmd)cmd, info); + return _mockVmMgr.CleanupNetworkRules((CleanupNetworkRulesCmd) cmd, info); } else if (cmd instanceof CheckNetworkCommand) { - return _mockAgentMgr.checkNetworkCommand((CheckNetworkCommand) cmd); + return _mockAgentMgr.checkNetworkCommand((CheckNetworkCommand) cmd); }else if (cmd instanceof StopCommand) { return _mockVmMgr.stopVM((StopCommand)cmd); } else if (cmd instanceof RebootCommand) { - return _mockVmMgr.rebootVM((RebootCommand)cmd); + return _mockVmMgr.rebootVM((RebootCommand) cmd); } else if (cmd instanceof GetVncPortCommand) { return _mockVmMgr.getVncPort((GetVncPortCommand)cmd); } else if (cmd instanceof CheckConsoleProxyLoadCommand) { @@ -226,6 +218,8 @@ public class SimulatorManagerImpl implements SimulatorManager { return _mockStorageMgr.SecStorageSetup((SecStorageSetupCommand)cmd); } else if (cmd instanceof ListTemplateCommand) { return _mockStorageMgr.ListTemplates((ListTemplateCommand)cmd); + } else if (cmd instanceof ListVolumeCommand) { + return _mockStorageMgr.ListVolumes((ListVolumeCommand)cmd); } else if (cmd instanceof DestroyCommand) { return _mockStorageMgr.Destroy((DestroyCommand)cmd); } else if (cmd instanceof DownloadProgressCommand) { @@ -261,12 +255,11 @@ public class SimulatorManagerImpl implements SimulatorManager { } else if (cmd instanceof BumpUpPriorityCommand) { return _mockVmMgr.bumpPriority((BumpUpPriorityCommand) cmd); } else if (cmd instanceof GetDomRVersionCmd) { - return _mockVmMgr.getDomRVersion((GetDomRVersionCmd) cmd); + return _mockVmMgr.getDomRVersion((GetDomRVersionCmd) cmd); } else if (cmd instanceof ClusterSyncCommand) { - return new Answer(cmd); - //return new ClusterSyncAnswer(((ClusterSyncCommand) cmd).getClusterId(), this.getVmStates(hostGuid)); + return new Answer(cmd); } else if (cmd instanceof CopyVolumeCommand) { - return _mockStorageMgr.CopyVolume((CopyVolumeCommand) cmd); + return _mockStorageMgr.CopyVolume((CopyVolumeCommand) cmd); } else { return Answer.createUnsupportedCommandAnswer(cmd); } @@ -288,19 +281,19 @@ public class SimulatorManagerImpl implements SimulatorManager { @Override public Map getVmStates(String hostGuid) { - return _mockVmMgr.getVmStates(hostGuid); + return _mockVmMgr.getVmStates(hostGuid); } - + @Override public Map getVms(String hostGuid) { - return _mockVmMgr.getVms(hostGuid); + return _mockVmMgr.getVms(hostGuid); } - + @Override public HashMap> syncNetworkGroups(String hostGuid) { - SimulatorInfo info = new SimulatorInfo(); - info.setHostUuid(hostGuid); - return _mockVmMgr.syncNetworkGroups(info); + SimulatorInfo info = new SimulatorInfo(); + info.setHostUuid(hostGuid); + return _mockVmMgr.syncNetworkGroups(info); } @Override diff --git a/agent-simulator/src/com/cloud/api/commands/ConfigureSimulator.java b/plugins/hypervisors/simulator/src/com/cloud/api/commands/ConfigureSimulator.java similarity index 98% rename from agent-simulator/src/com/cloud/api/commands/ConfigureSimulator.java rename to plugins/hypervisors/simulator/src/com/cloud/api/commands/ConfigureSimulator.java index 4147e3aae1f..60ce82e2c05 100755 --- a/agent-simulator/src/com/cloud/api/commands/ConfigureSimulator.java +++ b/plugins/hypervisors/simulator/src/com/cloud/api/commands/ConfigureSimulator.java @@ -37,25 +37,25 @@ import com.cloud.utils.component.ComponentLocator; public class ConfigureSimulator extends BaseCmd { public static final Logger s_logger = Logger.getLogger(ConfigureSimulator.class.getName()); private static final String s_name = "configuresimulatorresponse"; - + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="configure range: in a zone") private Long zoneId; - + @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="configure range: in a pod") private Long podId; - + @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="configure range: in a cluster") private Long clusterId; - + @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="configure range: in a host") private Long hostId; - + @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="which command needs to be configured") private String command; - + @Parameter(name=ApiConstants.VALUE, type=CommandType.STRING, required=true, description="configuration options for this command, which is seperated by ;") private String values; - + @Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name); @@ -64,7 +64,7 @@ public class ConfigureSimulator extends BaseCmd { if (!result) { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to configure simulator"); } - + SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } diff --git a/agent-simulator/src/com/cloud/configuration/SimulatorComponentLibrary.java b/plugins/hypervisors/simulator/src/com/cloud/configuration/SimulatorComponentLibrary.java similarity index 100% rename from agent-simulator/src/com/cloud/configuration/SimulatorComponentLibrary.java rename to plugins/hypervisors/simulator/src/com/cloud/configuration/SimulatorComponentLibrary.java diff --git a/agent-simulator/src/com/cloud/resource/AgentResourceBase.java b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentResourceBase.java similarity index 98% rename from agent-simulator/src/com/cloud/resource/AgentResourceBase.java rename to plugins/hypervisors/simulator/src/com/cloud/resource/AgentResourceBase.java index 6261158ee11..808ca070d4d 100644 --- a/agent-simulator/src/com/cloud/resource/AgentResourceBase.java +++ b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentResourceBase.java @@ -52,7 +52,7 @@ public class AgentResourceBase implements ServerResource { protected String _name; private List _warnings = new LinkedList(); private List _errors = new LinkedList(); - + private transient IAgentControl _agentControl; protected long _instanceId; @@ -64,36 +64,36 @@ public class AgentResourceBase implements ServerResource { protected MockHost agentHost = null; protected boolean stopped = false; protected String hostGuid = null; - + public AgentResourceBase(long instanceId, AgentType agentType, SimulatorManager simMgr, String hostGuid) { - _instanceId = instanceId; - + _instanceId = instanceId; + if(s_logger.isDebugEnabled()) { s_logger.info("New Routing host instantiated with guid:" + hostGuid); } - + if (agentType == AgentType.Routing) { _type = Host.Type.Routing; } else { _type = Host.Type.Storage; } - + this.hostGuid = hostGuid; } - + protected MockVmManager getVmMgr() { return _simMgr.getVmMgr(); } - + protected MockStorageManager getStorageMgr() { return _simMgr.getStorageMgr(); } - + protected MockAgentManager getAgentMgr() { return _simMgr.getAgentMgr(); } - + protected long getInstanceId() { return _instanceId; } @@ -102,7 +102,7 @@ public class AgentResourceBase implements ServerResource { if(s_logger.isDebugEnabled()) { s_logger.debug("Deserializing simulated agent on reconnect"); } - + } @Override @@ -113,18 +113,18 @@ public class AgentResourceBase implements ServerResource { public void setName(String name) { _name = name; } - + @Override public boolean configure(String name, Map params) throws ConfigurationException { hostGuid = (String)params.get("guid"); _locator = ComponentLocator.getLocator("management-server"); _simMgr = _locator.getManager(SimulatorManager.class); - + agentHost = getAgentMgr().getHost(hostGuid); return true; } - + private void reconnect(MockHost host) { if(s_logger.isDebugEnabled()) { @@ -244,7 +244,7 @@ public class AgentResourceBase implements ServerResource { } return file.getAbsolutePath(); } - + @Override public Answer executeRequest(Command cmd) { @@ -264,20 +264,20 @@ public class AgentResourceBase implements ServerResource { public void setType(Host.Type _type) { this._type = _type; } - + @Override public StartupCommand[] initialize() { return null; } - + public SimulatorManager getSimulatorManager() { return _simMgr; - } - - public void setSimulatorManager(SimulatorManager simMgr) { - _simMgr = simMgr; } - + + public void setSimulatorManager(SimulatorManager simMgr) { + _simMgr = simMgr; + } + public boolean isStopped() { return this.stopped; } diff --git a/agent-simulator/src/com/cloud/resource/AgentRoutingResource.java b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentRoutingResource.java similarity index 96% rename from agent-simulator/src/com/cloud/resource/AgentRoutingResource.java rename to plugins/hypervisors/simulator/src/com/cloud/resource/AgentRoutingResource.java index f10713d126c..f35e4325b38 100644 --- a/agent-simulator/src/com/cloud/resource/AgentRoutingResource.java +++ b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentRoutingResource.java @@ -91,7 +91,7 @@ public class AgentRoutingResource extends AgentStorageResource { } else if (cmd instanceof ReadyCommand) { return new ReadyAnswer((ReadyCommand)cmd); } else if (cmd instanceof ShutdownCommand) { - return execute((ShutdownCommand)cmd); + return execute((ShutdownCommand)cmd); } else { return _simMgr.simulate(cmd, hostGuid); } @@ -99,7 +99,7 @@ public class AgentRoutingResource extends AgentStorageResource { return new Answer(cmd, false, e.getMessage()); } } - + @Override public Type getType() { return Host.Type.Routing; @@ -111,10 +111,10 @@ public class AgentRoutingResource extends AgentStorageResource { return null; } synchronized (_vms) { - if (_vms.size() == 0) { - //load vms state from database - _vms.putAll(_simMgr.getVmStates(hostGuid)); - } + if (_vms.size() == 0) { + //load vms state from database + _vms.putAll(_simMgr.getVmStates(hostGuid)); + } } final HashMap newStates = sync(); HashMap> nwGrpStates = _simMgr.syncNetworkGroups(hostGuid); @@ -131,18 +131,18 @@ public class AgentRoutingResource extends AgentStorageResource { totalCpu = agentHost.getCpuCount() * agentHost.getCpuSpeed(); totalMem = agentHost.getMemorySize(); for (Map.Entry entry : vmsMaps.entrySet()) { - MockVMVO vm = entry.getValue(); - usedCpu += vm.getCpu(); - usedMem += vm.getMemory(); - _runningVms.put(entry.getKey(), new Pair(Long.valueOf(vm.getCpu()), vm.getMemory())); + MockVMVO vm = entry.getValue(); + usedCpu += vm.getCpu(); + usedMem += vm.getMemory(); + _runningVms.put(entry.getKey(), new Pair(Long.valueOf(vm.getCpu()), vm.getMemory())); } - + List info = getHostInfo(); StartupRoutingCommand cmd = new StartupRoutingCommand((Integer) info.get(0), (Long) info.get(1), (Long) info.get(2), (Long) info.get(4), (String) info.get(3), HypervisorType.Simulator, RouterPrivateIpStrategy.HostLocal); cmd.setStateChanges(changes); - + Map hostDetails = new HashMap(); hostDetails.put(RouterPrivateIpStrategy.class.getCanonicalName(), RouterPrivateIpStrategy.DcGlobal.toString()); @@ -167,13 +167,13 @@ public class AgentRoutingResource extends AgentStorageResource { cmd.setCluster(String.valueOf(agentHost.getClusterId())); StartupStorageCommand ssCmd = initializeLocalSR(); - + return new StartupCommand[] { cmd, ssCmd }; } private StartupStorageCommand initializeLocalSR() { Map tInfo = new HashMap(); - + StoragePoolInfo poolInfo = _simMgr.getLocalStorage(hostGuid); StartupStorageCommand cmd = new StartupStorageCommand(poolInfo.getHostPath(), poolInfo.getPoolType(), poolInfo.getCapacityBytes(), tInfo); @@ -183,14 +183,14 @@ public class AgentRoutingResource extends AgentStorageResource { cmd.setResourceType(StorageResourceType.STORAGE_POOL); return cmd; } - + protected synchronized Answer execute(StartCommand cmd) throws IllegalArgumentException { VirtualMachineTO vmSpec = cmd.getVirtualMachine(); String vmName = vmSpec.getName(); if (this.totalCpu < (vmSpec.getCpus() * vmSpec.getSpeed() + this.usedCpu) || this.totalMem < (vmSpec.getMaxRam() + this.usedMem)) { - return new StartAnswer(cmd, "Not enough resource to start the vm"); + return new StartAnswer(cmd, "Not enough resource to start the vm"); } State state = State.Stopped; synchronized (_vms) { @@ -202,7 +202,7 @@ public class AgentRoutingResource extends AgentStorageResource { if (!result.getResult()) { return new StartAnswer(cmd, result.getDetails()); } - + this.usedCpu += vmSpec.getCpus() * vmSpec.getSpeed(); this.usedMem += vmSpec.getMaxRam(); _runningVms.put(vmName, new Pair(Long.valueOf(vmSpec.getCpus() * vmSpec.getSpeed()), vmSpec.getMaxRam())); @@ -217,7 +217,7 @@ public class AgentRoutingResource extends AgentStorageResource { return new StartAnswer(cmd); } - + protected synchronized StopAnswer execute(StopCommand cmd) { StopAnswer answer = null; @@ -230,11 +230,11 @@ public class AgentRoutingResource extends AgentStorageResource { } try { Answer result = _simMgr.simulate(cmd, hostGuid); - + if (!result.getResult()) { return new StopAnswer(cmd, result.getDetails(), false); } - + answer = new StopAnswer(cmd, null, 0, true); Pair data = _runningVms.get(vmName); if (data != null) { @@ -242,16 +242,16 @@ public class AgentRoutingResource extends AgentStorageResource { this.usedMem -= data.second(); } state = State.Stopped; - + } finally { synchronized (_vms) { _vms.put(vmName, state); } } - + return answer; } - + protected CheckVirtualMachineAnswer execute(final CheckVirtualMachineCommand cmd) { final String vmName = cmd.getVmName(); CheckVirtualMachineAnswer result = (CheckVirtualMachineAnswer)_simMgr.simulate(cmd, hostGuid); @@ -346,7 +346,7 @@ public class AgentRoutingResource extends AgentStorageResource { return changes; } - + private Answer execute(ShutdownCommand cmd) { this.stopped = true; return new Answer(cmd); diff --git a/agent-simulator/src/com/cloud/resource/AgentStorageResource.java b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentStorageResource.java similarity index 93% rename from agent-simulator/src/com/cloud/resource/AgentStorageResource.java rename to plugins/hypervisors/simulator/src/com/cloud/resource/AgentStorageResource.java index 2751b875eb6..1125eeb7847 100644 --- a/agent-simulator/src/com/cloud/resource/AgentStorageResource.java +++ b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentStorageResource.java @@ -62,7 +62,7 @@ public class AgentStorageResource extends AgentResourceBase implements Secondary return _simMgr.simulate(cmd, hostGuid); } } - + @Override public PingCommand getCurrentStatus(long id) { if (isStopped()) { @@ -73,14 +73,14 @@ public class AgentStorageResource extends AgentResourceBase implements Secondary @Override public Type getType() { - if(SecondaryStorageVm.Role.templateProcessor.toString().equals(_role)) - return Host.Type.SecondaryStorage; - return Host.Type.SecondaryStorageCmdExecutor; + if(SecondaryStorageVm.Role.templateProcessor.toString().equals(_role)) + return Host.Type.SecondaryStorage; + return Host.Type.SecondaryStorageCmdExecutor; } @Override public StartupCommand[] initialize() { - StartupSecondaryStorageCommand cmd = new StartupSecondaryStorageCommand(); + StartupSecondaryStorageCommand cmd = new StartupSecondaryStorageCommand(); cmd.setPrivateIpAddress(agentHost.getPrivateIpAddress()); cmd.setPrivateNetmask(agentHost.getPrivateNetMask()); @@ -97,15 +97,15 @@ public class AgentStorageResource extends AgentResourceBase implements Secondary cmd.setPod(String.valueOf(agentHost.getPodId())); cmd.setGuid(agentHost.getGuid()); return new StartupCommand[] { cmd }; - } - + } + @Override public boolean configure(String name, Map params) throws ConfigurationException { if (!super.configure(name, params)) { s_logger.warn("Base class was unable to configure"); return false; } - + return true; } diff --git a/agent-simulator/src/com/cloud/resource/SimulatorDiscoverer.java b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java similarity index 94% rename from agent-simulator/src/com/cloud/resource/SimulatorDiscoverer.java rename to plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java index 729d4b0fd23..b6d40d49589 100755 --- a/agent-simulator/src/com/cloud/resource/SimulatorDiscoverer.java +++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java @@ -60,7 +60,7 @@ import com.cloud.utils.component.Inject; public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter { private static final Logger s_logger = Logger .getLogger(SimulatorDiscoverer.class); - + @Inject HostDao _hostDao; @Inject VMTemplateDao _vmTemplateDao; @Inject VMTemplateHostDao _vmTemplateHostDao; @@ -70,10 +70,10 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L @Inject MockAgentManager _mockAgentMgr = null; @Inject MockStorageManager _mockStorageMgr = null; @Inject ResourceManager _resourceMgr; - + /** * Finds ServerResources of an in-process simulator - * + * * @see com.cloud.resource.Discoverer#find(long, java.lang.Long, * java.lang.Long, java.net.URI, java.lang.String, java.lang.String) */ @@ -88,7 +88,7 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L String scheme = uri.getScheme(); String host = uri.getAuthority(); String commands = URLDecoder.decode(uri.getPath()); - + long cpuSpeed = _mockAgentMgr.DEFAULT_HOST_SPEED_MHZ; long cpuCores = _mockAgentMgr.DEFAULT_HOST_CPU_CORES; long memory = _mockAgentMgr.DEFAULT_HOST_MEM_SIZE; @@ -145,7 +145,7 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L if (s_logger.isInfoEnabled()) s_logger.info("invalid cluster id or cluster is not for Simulator hypervisors"); return null; - } + } cluster = Long.toString(clusterId); if(clu.getGuid() == null) { clu.setGuid(UUID.randomUUID().toString()); @@ -205,23 +205,23 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L for (HostVO h : hosts) { associateTemplatesToZone(h.getId(), h.getDataCenterId()); } - } + } private void associateTemplatesToZone(long hostId, long dcId){ - VMTemplateZoneVO tmpltZone; + VMTemplateZoneVO tmpltZone; - List allTemplates = _vmTemplateDao.listAll(); - for (VMTemplateVO vt: allTemplates){ - if (vt.isCrossZones()) { - tmpltZone = _vmTemplateZoneDao.findByZoneTemplate(dcId, vt.getId()); - if (tmpltZone == null) { - VMTemplateZoneVO vmTemplateZone = new VMTemplateZoneVO(dcId, vt.getId(), new Date()); - _vmTemplateZoneDao.persist(vmTemplateZone); - } - } - } + List allTemplates = _vmTemplateDao.listAll(); + for (VMTemplateVO vt: allTemplates){ + if (vt.isCrossZones()) { + tmpltZone = _vmTemplateZoneDao.findByZoneTemplate(dcId, vt.getId()); + if (tmpltZone == null) { + VMTemplateZoneVO vmTemplateZone = new VMTemplateZoneVO(dcId, vt.getId(), new Date()); + _vmTemplateZoneDao.persist(vmTemplateZone); + } + } + } } - + @Override public HypervisorType getHypervisorType() { return HypervisorType.Simulator; @@ -231,7 +231,7 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L public boolean matchHypervisor(String hypervisor) { return hypervisor.equalsIgnoreCase(HypervisorType.Simulator.toString()); } - + @Override public boolean configure(String name, Map params) throws ConfigurationException { super.configure(name, params); @@ -257,9 +257,9 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L @Override public void processConnect(HostVO host, StartupCommand cmd, boolean forRebalance) throws ConnectionException { - + /*if(forRebalance) - return; + return; if ( Host.Type.SecondaryStorage == host.getType() ) { List tmplts = _vmTemplateDao.listAll(); for( VMTemplateVO tmplt : tmplts ) { @@ -275,7 +275,7 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L } } }*/ - + } @Override @@ -312,12 +312,12 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L if (!(firstCmd instanceof StartupRoutingCommand)) { return null; } - + StartupRoutingCommand ssCmd = ((StartupRoutingCommand) firstCmd); if (ssCmd.getHypervisorType() != HypervisorType.Simulator) { return null; } - + return _resourceMgr.fillRoutingHostVO(host, ssCmd, HypervisorType.Simulator, details, hostTags); } @@ -326,11 +326,11 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L boolean isForceDeleteStorage) throws UnableDeleteHostException { return null; } - + @Override public boolean stop() { - _resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName()); + _resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName()); return super.stop(); } - + } diff --git a/agent-simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java similarity index 75% rename from agent-simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java rename to plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java index f828bc822ca..3f7cea5b6b1 100644 --- a/agent-simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java +++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java @@ -16,6 +16,7 @@ // under the License. package com.cloud.resource; +import java.net.URI; import java.util.List; import java.util.Map; @@ -39,24 +40,50 @@ import com.cloud.storage.dao.SnapshotDao; import com.cloud.storage.secondary.SecondaryStorageDiscoverer; import com.cloud.utils.component.Inject; import com.cloud.utils.exception.CloudRuntimeException; +import org.apache.log4j.Logger; + @Local(value=Discoverer.class) public class SimulatorSecondaryDiscoverer extends SecondaryStorageDiscoverer implements ResourceStateAdapter, Listener { + private static final Logger s_logger = Logger.getLogger(SimulatorSecondaryDiscoverer.class); @Inject MockStorageManager _mockStorageMgr = null; @Inject AgentManager _agentMgr; @Inject ResourceManager _resourceMgr; @Inject SnapshotDao _snapshotDao; - + @Override public boolean configure(String name, Map params) throws ConfigurationException { - _agentMgr.registerForHostEvents(this, true, false, false); + _agentMgr.registerForHostEvents(this, true, false, false); _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this); return super.configure(name, params); } - + + @Override + public Map> find(long dcId, Long podId, Long clusterId, URI uri, String username, String password, List hostTags) { + if (!uri.getScheme().equalsIgnoreCase("nfs") && !uri.getScheme().equalsIgnoreCase("file") + && !uri.getScheme().equalsIgnoreCase("iso") && !uri.getScheme().equalsIgnoreCase("dummy")) { + s_logger.debug("It's not NFS or file or ISO, so not a secondary storage server: " + uri.toString()); + return null; + } + + if (uri.getScheme().equalsIgnoreCase("nfs") || uri.getScheme().equalsIgnoreCase("iso")) { + return createNfsSecondaryStorageResource(dcId, podId, uri); + } else if (uri.getScheme().equalsIgnoreCase("file")) { + return createLocalSecondaryStorageResource(dcId, podId, uri); + } else if (uri.getScheme().equalsIgnoreCase("dummy")) { + return createDummySecondaryStorageResource(dcId, podId, uri); + } else { + return null; + } + } + + @Override public void postDiscovery(List hosts, long msId) { super.postDiscovery(hosts, msId); for (HostVO host: hosts) { + if(s_logger.isDebugEnabled()) { + s_logger.debug("Preinstalling simulator templates"); + } _mockStorageMgr.preinstallTemplates(host.getStorageUrl(), host.getDataCenterId()); } } @@ -74,9 +101,9 @@ public class SimulatorSecondaryDiscoverer extends SecondaryStorageDiscoverer imp //for detecting SSVM dispatch StartupCommand firstCmd = startup[0]; if (!(firstCmd instanceof StartupSecondaryStorageCommand)) { - return null; + return null; } - + host.setType(com.cloud.host.Host.Type.SecondaryStorageVM); return host; } @@ -103,7 +130,7 @@ public class SimulatorSecondaryDiscoverer extends SecondaryStorageDiscoverer imp @Override public boolean stop() { - _resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName()); + _resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName()); return true; } @@ -130,7 +157,7 @@ public class SimulatorSecondaryDiscoverer extends SecondaryStorageDiscoverer imp @Override public void processConnect(HostVO host, StartupCommand cmd, boolean forRebalance) throws ConnectionException { - + } @Override diff --git a/agent-simulator/src/com/cloud/server/ManagementServerSimulatorImpl.java b/plugins/hypervisors/simulator/src/com/cloud/server/ManagementServerSimulatorImpl.java similarity index 99% rename from agent-simulator/src/com/cloud/server/ManagementServerSimulatorImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/server/ManagementServerSimulatorImpl.java index 1c69b543aa8..35aa3010005 100644 --- a/agent-simulator/src/com/cloud/server/ManagementServerSimulatorImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/server/ManagementServerSimulatorImpl.java @@ -25,7 +25,7 @@ public class ManagementServerSimulatorImpl extends ManagementServerExtImpl { for (int i = 0; i < apis.length; i++) { newapis[i] = apis[i]; } - + newapis[apis.length] = "commands-simulator.properties"; return newapis; } diff --git a/agent-simulator/src/com/cloud/simulator/MockConfigurationVO.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockConfigurationVO.java similarity index 96% rename from agent-simulator/src/com/cloud/simulator/MockConfigurationVO.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/MockConfigurationVO.java index dfea2279e9e..3ed862bb69f 100644 --- a/agent-simulator/src/com/cloud/simulator/MockConfigurationVO.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockConfigurationVO.java @@ -33,79 +33,79 @@ public class MockConfigurationVO { @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="data_center_id", nullable=false) private Long dataCenterId; - + @Column(name="pod_id") private Long podId; - + @Column(name="cluster_id") private Long clusterId; - + @Column(name="host_id") private Long hostId; - + @Column(name="name") private String name; - + @Column(name="values") private String values; - + public long getId() { return this.id; } - + public Long getDataCenterId() { return this.dataCenterId; } - + public void setDataCenterId(Long dcId) { this.dataCenterId = dcId; } - + public Long getPodId() { return this.podId; } - + public void setPodId(Long podId) { this.podId = podId; } - + public Long getClusterId() { return this.clusterId; } - + public void setClusterId(Long clusterId) { this.clusterId = clusterId; } - + public Long getHostId() { return this.hostId; } - + public void setHostId(Long hostId) { this.hostId = hostId; } - + public String getName() { return this.name; } - + public void setName(String name) { this.name = name; } - + public String getValues() { return this.values; } - + public Map getParameters() { Map maps = new HashMap(); if (this.values == null) { return maps; } - + String[] vals = this.values.split("\\|"); for (String val : vals) { String[] paras = val.split(":"); @@ -113,9 +113,8 @@ public class MockConfigurationVO { } return maps; } - + public void setValues(String values) { this.values = values; } } - diff --git a/agent-simulator/src/com/cloud/simulator/MockHost.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockHost.java similarity index 93% rename from agent-simulator/src/com/cloud/simulator/MockHost.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/MockHost.java index d20e8259267..5ca90177189 100644 --- a/agent-simulator/src/com/cloud/simulator/MockHost.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockHost.java @@ -19,44 +19,44 @@ package com.cloud.simulator; public interface MockHost { public long getCpuSpeed(); public long getCpuCount(); - - + + public long getMemorySize(); - + public String getCapabilities(); - + public long getId(); - + public String getName(); - + public String getGuid(); - - + + public String getVersion(); - + public Long getDataCenterId(); - + public Long getPodId(); - + public Long getClusterId(); - + public String getPrivateIpAddress(); - + public String getPrivateNetMask(); - + public String getPrivateMacAddress(); - - + + public String getPublicIpAddress(); - + public String getPublicNetMask(); - + public String getPublicMacAddress(); - + public String getStorageIpAddress(); - + public String getStorageNetMask(); - + public String getStorageMacAddress(); - + } diff --git a/agent-simulator/src/com/cloud/simulator/MockHostVO.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockHostVO.java similarity index 94% rename from agent-simulator/src/com/cloud/simulator/MockHostVO.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/MockHostVO.java index 59b7e8d0788..c86dfa6a2bf 100644 --- a/agent-simulator/src/com/cloud/simulator/MockHostVO.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockHostVO.java @@ -31,245 +31,245 @@ public class MockHostVO implements MockHost { @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="name", nullable=false) private String name = null; - + @Column(name="private_ip_address", nullable=false) private String privateIpAddress; - + @Column(name="private_mac_address", nullable=false) private String privateMacAddress; - + @Column(name="private_netmask", nullable=false) private String privateNetmask; - + @Column(name="public_netmask") private String publicNetmask; - + @Column(name="public_ip_address") private String publicIpAddress; - + @Column(name="public_mac_address") private String publicMacAddress; - + @Column(name="storage_ip_address") private String storageIpAddress; - + @Column(name="storage_mac_address") private String storageMacAddress; - + @Column(name="storage_netmask") private String storageNetMask; - + @Column(name="guid") private String guid; - + @Column(name="version") private String version; - + @Column(name="data_center_id", nullable=false) private long dataCenterId; - + @Column(name="pod_id") private Long podId; - + @Column(name="cluster_id") private Long clusterId; - + @Column(name="speed") private long cpuSpeed; - + @Column(name="cpus") private long cpuCount; - + @Column(name="ram") private long memorySize; - + @Column(name="capabilities") private String capabilities; - + @Column(name="vm_id") private long vmId; - + @Column(name="resource") private String resource; - - - + + + public MockHostVO() { - + } - - + + public long getVmId() { return vmId; } - + public void setVmId(long vmId) { this.vmId = vmId; } - + public String getResource() { return this.resource; } - + public void setResource(String resource) { this.resource = resource; } - + public long getCpuSpeed() { return this.cpuSpeed; } - + public void setCpuSpeed(long cpuSpeed) { this.cpuSpeed = cpuSpeed; } - + public long getCpuCount() { return this.cpuCount; } - + public void setCpuCount(long cpuCount) { this.cpuCount = cpuCount; } - + public long getMemorySize() { return this.memorySize; } - + public void setMemorySize(long memorySize) { this.memorySize = memorySize; } - + public String getCapabilities() { return this.capabilities; } - + public void setCapabilities(String capabilities) { this.capabilities = capabilities; } - + public long getId() { return id; } - + public String getName() { return name; } - + public void setName(String name) { this.name = name; } - + public String getGuid() { return this.guid; } - + public void setGuid(String guid) { this.guid = guid; } - + public String getVersion() { return this.version; } - + public void setVersion(String version) { this.version = version; } - + public Long getDataCenterId() { return this.dataCenterId; } - + public void setDataCenterId(Long dataCenterId) { this.dataCenterId = dataCenterId; } - + public Long getPodId() { return this.podId; } - + public void setPodId(long podId) { this.podId = podId; } - + public Long getClusterId() { return this.clusterId; } - + public void setClusterId(Long clusterId) { this.clusterId = clusterId; } - + public String getPrivateIpAddress() { return privateIpAddress; } - + public void setPrivateIpAddress(String privateIpAddress) { this.privateIpAddress = privateIpAddress; } - + public String getPrivateNetMask() { return this.privateNetmask; } - + public void setPrivateNetMask(String privateNetmask) { this.privateNetmask = privateNetmask; } - + public String getPrivateMacAddress() { return this.privateMacAddress; } - + public void setPrivateMacAddress(String privateMacAddress) { this.privateMacAddress = privateMacAddress; } - + public String getPublicIpAddress() { return this.publicIpAddress; } - + public void setPublicIpAddress(String publicIpAddress) { this.publicIpAddress = publicIpAddress; } - + public String getPublicNetMask() { return this.publicNetmask; } - + public void setPublicNetMask(String publicNetMask) { this.publicNetmask = publicNetMask; } - + public String getPublicMacAddress() { return this.publicMacAddress; } - + public void setPublicMacAddress(String publicMacAddress) { this.publicMacAddress = publicMacAddress; } - + public String getStorageIpAddress() { return this.storageIpAddress; } - + public void setStorageIpAddress(String storageIpAddress) { this.storageIpAddress = storageIpAddress; } - + public String getStorageNetMask() { return this.storageNetMask; } - + public void setStorageNetMask(String storageNetMask) { this.storageNetMask = storageNetMask; } - + public String getStorageMacAddress() { return this.storageMacAddress; } - + public void setStorageMacAddress(String storageMacAddress) { this.storageMacAddress = storageMacAddress; } diff --git a/agent-simulator/src/com/cloud/simulator/MockSecStorageVO.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockSecStorageVO.java similarity index 96% rename from agent-simulator/src/com/cloud/simulator/MockSecStorageVO.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/MockSecStorageVO.java index c503cc260be..59a81c79abe 100644 --- a/agent-simulator/src/com/cloud/simulator/MockSecStorageVO.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockSecStorageVO.java @@ -31,45 +31,45 @@ public class MockSecStorageVO { @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="url") private String url; - + @Column(name="capacity") private long capacity; - + @Column(name="mount_point") private String mountPoint; - - + + public MockSecStorageVO() { - + } - + public long getId() { return this.id; } - + public String getMountPoint() { return this.mountPoint; } - + public void setMountPoint(String mountPoint) { this.mountPoint = mountPoint; } - + public String getUrl() { return url; } - + public void setUrl(String url) { this.url = url; } - + public long getCapacity() { return this.capacity; } - + public void setCapacity(long capacity) { this.capacity = capacity; } diff --git a/agent-simulator/src/com/cloud/simulator/MockSecurityRulesVO.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockSecurityRulesVO.java similarity index 96% rename from agent-simulator/src/com/cloud/simulator/MockSecurityRulesVO.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/MockSecurityRulesVO.java index 3036ea98db2..df31fbf277b 100644 --- a/agent-simulator/src/com/cloud/simulator/MockSecurityRulesVO.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockSecurityRulesVO.java @@ -31,73 +31,73 @@ public class MockSecurityRulesVO { @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="vmid") private Long vmId; - + @Column(name="signature") private String signature; - + @Column(name="seqnum") private Long seqNum; - + @Column(name="ruleset") private String ruleSet; - + @Column(name="hostid") private String hostId; - + @Column(name="vmname") public String vmName; - + public String getVmName() { return this.vmName; } - + public void setVmName(String vmName) { this.vmName = vmName; } - + public String getHostId() { return this.hostId; } - + public void setHostId(String hostId) { this.hostId = hostId; } - + public long getId() { return this.id; } - + public Long getVmId() { return this.vmId; } - + public void setVmId(Long vmId) { this.vmId = vmId; } - + public String getSignature() { return this.signature; } - + public void setSignature(String sig) { this.signature = sig; } - + public Long getSeqNum() { return this.seqNum; } - + public void setSeqNum(Long seqNum) { this.seqNum = seqNum; } - + public String getRuleSet() { return this.ruleSet; } - + public void setRuleSet(String ruleset) { this.ruleSet = ruleset; } diff --git a/agent-simulator/src/com/cloud/simulator/MockStoragePoolVO.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockStoragePoolVO.java similarity index 96% rename from agent-simulator/src/com/cloud/simulator/MockStoragePoolVO.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/MockStoragePoolVO.java index 81f0432247d..9c6e84d2714 100644 --- a/agent-simulator/src/com/cloud/simulator/MockStoragePoolVO.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockStoragePoolVO.java @@ -35,67 +35,67 @@ public class MockStoragePoolVO { @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="guid") private String uuid; - + @Column(name="mount_point") private String mountPoint; - + @Column(name="capacity") private long capacity; - + @Column(name="hostguid") private String hostGuid; - + @Column(name="pool_type") @Enumerated(value=EnumType.STRING) private StoragePoolType poolType; - + public MockStoragePoolVO() { - + } - + public String getHostGuid() { return this.hostGuid; } - + public void setHostGuid(String hostGuid) { this.hostGuid = hostGuid; } - + public long getId() { return this.id; } - + public StoragePoolType getPoolType() { return this.poolType; } - + public void setStorageType(StoragePoolType poolType) { this.poolType = poolType; } - + public String getUuid() { return this.uuid; } - + public void setUuid(String uuid) { this.uuid = uuid; } - + public String getMountPoint() { return this.mountPoint; } - + public void setMountPoint(String mountPoint) { this.mountPoint = mountPoint; } - + public long getCapacity() { return this.capacity; } - + public void setCapacity(long capacity) { this.capacity = capacity; } diff --git a/agent-simulator/src/com/cloud/simulator/MockVMVO.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockVMVO.java similarity index 90% rename from agent-simulator/src/com/cloud/simulator/MockVMVO.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/MockVMVO.java index c1b391e37f6..3a5aa3d4c10 100644 --- a/agent-simulator/src/com/cloud/simulator/MockVMVO.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockVMVO.java @@ -33,98 +33,108 @@ public class MockVMVO implements MockVm{ @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="name") private String name; - + @Column(name="host_id") private long hostId; - + @Column(name="type") private String vmType; - + @Column(name="state") private State state; - + @Column(name="vnc_port") private int vncPort; - + @Column(name="memory") private long memory; - + @Column(name="cpu") private int cpu; - + + @Column(name="bootargs") + private String bootargs; + public MockVMVO() { - + } - + public long getId() { return this.id; } - + public String getName() { return this.name; } - + public void setName(String name) { this.name = name; } - + public long getHostId() { return this.hostId; } - + public void setHostId(long hostId) { this.hostId = hostId; } - + public String getVmType() { return this.vmType; } - + public void setVmType(String vmType) { this.vmType = vmType; } - + public State getState() { return this.state; } - + public String getType() { - return this.vmType; + return this.vmType; } - + public void setState(State state) { this.state = state; } - + public int getVncPort() { return this.vncPort; } - + public void setVncPort(int vncPort) { this.vncPort = vncPort; } - + public long getMemory() { return this.memory; } - + public void setMemory(long memory) { this.memory = memory; } - + public int getCpu() { return this.cpu; } - + public void setCpu(int cpu) { this.cpu = cpu; } - + public void setType(String type) { - this.vmType = type; + this.vmType = type; } + public String getBootargs() { + return bootargs; + } + + public void setBootargs(String bootargs) { + this.bootargs = bootargs; + } } diff --git a/agent-simulator/src/com/cloud/simulator/MockVm.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockVm.java similarity index 94% rename from agent-simulator/src/com/cloud/simulator/MockVm.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/MockVm.java index 250ca7bedf4..e46b6a0cf99 100644 --- a/agent-simulator/src/com/cloud/simulator/MockVm.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockVm.java @@ -20,26 +20,28 @@ import com.cloud.vm.VirtualMachine.State; // As storage is mapped from storage device, can virtually treat that VM here does public interface MockVm { - - + + public String getName(); - + public State getState(); - + public void setState(State state); - + public void setHostId(long hostId); public long getMemory(); - + public int getCpu(); public String getType(); public int getVncPort(); - + public void setName(String name); public void setMemory(long memory); public void setCpu(int cpu); public void setType(String type); public void setVncPort(int vncPort); public long getId(); -} + public String getBootargs(); + public void setBootargs(String bootargs); +} diff --git a/agent-simulator/src/com/cloud/simulator/MockVolumeVO.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockVolumeVO.java similarity index 96% rename from agent-simulator/src/com/cloud/simulator/MockVolumeVO.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/MockVolumeVO.java index 94908d7efd4..48a12f8ee93 100644 --- a/agent-simulator/src/com/cloud/simulator/MockVolumeVO.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/MockVolumeVO.java @@ -43,76 +43,76 @@ public class MockVolumeVO { @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="name") private String name; - + @Column(name="size") private long size; - + @Column(name="path") private String path; - + @Column(name="pool_id") private long poolId; - + @Column(name="type") @Enumerated(value=EnumType.STRING) private MockVolumeType type; - + @Column(name="status") @Enumerated(value=EnumType.STRING) private VMTemplateStorageResourceAssoc.Status status; - + public long getId() { return id; } public String getName() { return this.name; } - + public void setName(String name) { this.name = name; } - + public long getSize() { return this.size; } - + public void setSize(long size) { this.size = size; } - + public String getPath() { return this.path; } - + public void setPath(String path) { this.path = path; } - + public long getPoolId() { return this.poolId; } - + public void setPoolId(long poolId) { this.poolId = poolId; } - + public MockVolumeType getType() { return this.type; } - + public void setType(MockVolumeType type) { this.type = type; } - + public Status getStatus() { return this.status; } - + public void setStatus(Status status) { this.status = status; } - + } diff --git a/agent-simulator/src/com/cloud/simulator/SimulatorGuru.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java similarity index 98% rename from agent-simulator/src/com/cloud/simulator/SimulatorGuru.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java index 20457e4db56..b9c404b66a1 100644 --- a/agent-simulator/src/com/cloud/simulator/SimulatorGuru.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorGuru.java @@ -35,7 +35,7 @@ public class SimulatorGuru extends HypervisorGuruBase implements HypervisorGuru protected SimulatorGuru() { super(); } - + @Override public HypervisorType getHypervisorType() { return HypervisorType.Simulator; @@ -44,11 +44,11 @@ public class SimulatorGuru extends HypervisorGuruBase implements HypervisorGuru @Override public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); - + // Determine the VM's OS description GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId()); to.setOs(guestOS.getDisplayName()); - + return to; } diff --git a/agent-simulator/src/com/cloud/simulator/SimulatorRuntimeException.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorRuntimeException.java similarity index 98% rename from agent-simulator/src/com/cloud/simulator/SimulatorRuntimeException.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorRuntimeException.java index ce962a2d296..9891bc82556 100644 --- a/agent-simulator/src/com/cloud/simulator/SimulatorRuntimeException.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/SimulatorRuntimeException.java @@ -26,15 +26,15 @@ import com.cloud.utils.exception.RuntimeCloudException; public class SimulatorRuntimeException extends RuntimeCloudException { private static final long serialVersionUID = SerialVersionUID.CloudRuntimeException; - + public SimulatorRuntimeException(String message) { super(message); } - + public SimulatorRuntimeException(String message, Throwable th) { super(message, th); } - + protected SimulatorRuntimeException() { super(); } diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockConfigurationDao.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockConfigurationDao.java similarity index 100% rename from agent-simulator/src/com/cloud/simulator/dao/MockConfigurationDao.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockConfigurationDao.java diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java similarity index 88% rename from agent-simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java index a65a4a77c55..bd1b48dfde8 100644 --- a/agent-simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockConfigurationDaoImpl.java @@ -35,8 +35,8 @@ public class MockConfigurationDaoImpl extends GenericDaoBase _searchByDcIDPodIdClusterIdName; private SearchBuilder _searchByDcIDPodIdClusterIdHostIdName; private SearchBuilder _searchByGlobalName; - - + + public MockConfigurationDaoImpl() { _searchByGlobalName = createSearchBuilder(); _searchByGlobalName.and("dcId", _searchByGlobalName.entity().getDataCenterId(), SearchCriteria.Op.NULL); @@ -45,7 +45,7 @@ public class MockConfigurationDaoImpl extends GenericDaoBase sc = _searchByGlobalName.create(); sc.setParameters("name", name); @@ -113,19 +113,19 @@ public class MockConfigurationDaoImpl extends GenericDaoBase implements MockHostDao { - protected final SearchBuilder GuidSearch; + protected final SearchBuilder GuidSearch; public MockHostDaoImpl() { GuidSearch = createSearchBuilder(); GuidSearch.and("guid", GuidSearch.entity().getGuid(), SearchCriteria.Op.EQ); diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockSecStorageDao.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecStorageDao.java similarity index 100% rename from agent-simulator/src/com/cloud/simulator/dao/MockSecStorageDao.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecStorageDao.java diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java similarity index 95% rename from agent-simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java index fd8d1d3a90b..65a375f5843 100644 --- a/agent-simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecStorageDaoImpl.java @@ -25,14 +25,14 @@ import com.cloud.utils.db.SearchCriteria; @Local(value={MockSecStorageDao.class}) public class MockSecStorageDaoImpl extends GenericDaoBase implements MockSecStorageDao { - protected final SearchBuilder urlSearch; + protected final SearchBuilder urlSearch; @Override public MockSecStorageVO findByUrl(String url) { SearchCriteria sc = urlSearch.create(); sc.setParameters("url", url); return findOneBy(sc); } - + public MockSecStorageDaoImpl() { urlSearch = createSearchBuilder(); urlSearch.and("url", urlSearch.entity().getUrl(), SearchCriteria.Op.EQ); diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockSecurityRulesDao.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecurityRulesDao.java similarity index 100% rename from agent-simulator/src/com/cloud/simulator/dao/MockSecurityRulesDao.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecurityRulesDao.java diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java similarity index 96% rename from agent-simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java index 43a1da6c8fb..8831efef2ec 100644 --- a/agent-simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockSecurityRulesDaoImpl.java @@ -29,7 +29,7 @@ import com.cloud.utils.db.SearchCriteria; @Local(value={MockSecurityRulesDao.class}) public class MockSecurityRulesDaoImpl extends GenericDaoBase implements MockSecurityRulesDao { protected SearchBuilder vmIdSearch; - protected SearchBuilder hostSearch; + protected SearchBuilder hostSearch; @Override public MockSecurityRulesVO findByVmId(Long vmId) { SearchCriteria sc = vmIdSearch.create(); @@ -43,18 +43,18 @@ public class MockSecurityRulesDaoImpl extends GenericDaoBase params) throws ConfigurationException { vmIdSearch = createSearchBuilder(); vmIdSearch.and("vmId", vmIdSearch.entity().getVmId(), SearchCriteria.Op.EQ); vmIdSearch.done(); - + hostSearch = createSearchBuilder(); hostSearch.and("host", hostSearch.entity().getHostId(), SearchCriteria.Op.EQ); hostSearch.done(); - + return true; } - + } diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockStoragePoolDao.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockStoragePoolDao.java similarity index 100% rename from agent-simulator/src/com/cloud/simulator/dao/MockStoragePoolDao.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockStoragePoolDao.java diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java similarity index 99% rename from agent-simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java index e35b5372946..3a64d27e30d 100644 --- a/agent-simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockStoragePoolDaoImpl.java @@ -34,12 +34,12 @@ public class MockStoragePoolDaoImpl extends GenericDaoBase implements MockVMDao { - protected SearchBuilder GuidSearch; + protected SearchBuilder GuidSearch; protected SearchBuilder vmNameSearch; protected SearchBuilder vmhostSearch; @Inject MockHostDao _mockHostDao; @@ -57,7 +57,7 @@ public class MockVMDaoImpl extends GenericDaoBase implements Moc sc.setParameters("state", VirtualMachine.State.Running); return listBy(sc); } - + @Override public MockVMVO findByVmNameAndHost(String vmName, String hostGuid) { SearchCriteria sc = vmhostSearch.create(); @@ -65,28 +65,28 @@ public class MockVMDaoImpl extends GenericDaoBase implements Moc sc.setParameters("name", vmName); return findOneBy(sc); } - + @Override public boolean configure(String name, Map params) throws ConfigurationException { SearchBuilder host = _mockHostDao.createSearchBuilder(); host.and("guid", host.entity().getGuid(), SearchCriteria.Op.EQ); - + GuidSearch = createSearchBuilder(); GuidSearch.join("host", host, host.entity().getId(), GuidSearch.entity().getHostId(), JoinBuilder.JoinType.INNER); GuidSearch.and("state", GuidSearch.entity().getState(), SearchCriteria.Op.EQ); GuidSearch.done(); - + vmNameSearch = createSearchBuilder(); vmNameSearch.and("name", vmNameSearch.entity().getName(), SearchCriteria.Op.EQ); vmNameSearch.done(); - + SearchBuilder newhost = _mockHostDao.createSearchBuilder(); newhost.and("guid", newhost.entity().getGuid(), SearchCriteria.Op.EQ); vmhostSearch = createSearchBuilder(); vmhostSearch.and("name", vmhostSearch.entity().getName(), SearchCriteria.Op.EQ); vmhostSearch.join("host", newhost, newhost.entity().getId(), vmhostSearch.entity().getHostId(), JoinBuilder.JoinType.INNER); vmhostSearch.done(); - + return true; } } diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockVolumeDao.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVolumeDao.java similarity index 100% rename from agent-simulator/src/com/cloud/simulator/dao/MockVolumeDao.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVolumeDao.java diff --git a/agent-simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java similarity index 96% rename from agent-simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java rename to plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java index 87b54f196c1..a3a35179337 100644 --- a/agent-simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/simulator/dao/MockVolumeDaoImpl.java @@ -42,11 +42,11 @@ public class MockVolumeDaoImpl extends GenericDaoBase implem sc.setParameters("type", type); return listBy(sc); } - + @Override public Long findTotalStorageId(long id) { SearchCriteria sc = totalSearch.create(); - + sc.setParameters("poolId", id); return customSearch(sc, null).get(0); } @@ -57,20 +57,20 @@ public class MockVolumeDaoImpl extends GenericDaoBase implem sc.setParameters("path", "%" + path + "%"); return findOneBy(sc); } - + @Override public MockVolumeVO findByNameAndPool(String volumeName, String poolUUID) { SearchCriteria sc = namePoolSearch.create(); sc.setParameters("name", volumeName); sc.setParameters("poolUuid", poolUUID); - return findOneBy(sc); + return findOneBy(sc); } @Override public MockVolumeVO findByName(String volumeName) { SearchCriteria sc = nameSearch.create(); sc.setParameters("name", volumeName); - return findOneBy(sc); + return findOneBy(sc); } public MockVolumeDaoImpl() { @@ -78,24 +78,24 @@ public class MockVolumeDaoImpl extends GenericDaoBase implem idTypeSearch.and("storageId", idTypeSearch.entity().getPoolId(), SearchCriteria.Op.EQ); idTypeSearch.and("type", idTypeSearch.entity().getType(), SearchCriteria.Op.EQ); idTypeSearch.done(); - + pathTypeSearch = createSearchBuilder(); pathTypeSearch.and("path", pathTypeSearch.entity().getPath(), SearchCriteria.Op.LIKE); pathTypeSearch.done(); - + namePoolSearch = createSearchBuilder(); namePoolSearch.and("name", namePoolSearch.entity().getName(), SearchCriteria.Op.EQ); namePoolSearch.and("poolUuid", namePoolSearch.entity().getPoolId(), SearchCriteria.Op.EQ); namePoolSearch.done(); - + nameSearch = createSearchBuilder(); nameSearch.and("name", nameSearch.entity().getName(), SearchCriteria.Op.EQ); nameSearch.done(); - + totalSearch = createSearchBuilder(Long.class); totalSearch.select(null, Func.SUM, totalSearch.entity().getSize()); totalSearch.and("poolId", totalSearch.entity().getPoolId(), SearchCriteria.Op.EQ); totalSearch.done(); - - } + + } } diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 313703c0a82..36a12b1b4fa 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -4333,8 +4333,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } XsLocalNetwork storageNic1 = null; storageNic1 = getNetworkByName(conn, _storageNetworkName1); - _host.storageNetwork1 = storageNic1.getNetworkRecord(conn).uuid; - _host.storagePif1 = storageNic1.getPifRecord(conn).uuid; + if (storageNic1 == null) { + s_logger.warn("Unable to find storage network " + _storageNetworkName1 + " for host " + _host.ip); + throw new IllegalArgumentException("Unable to find storage network " + _storageNetworkName1 + " for host " + _host.ip); + } else { + _host.storageNetwork1 = storageNic1.getNetworkRecord(conn).uuid; + _host.storagePif1 = storageNic1.getPifRecord(conn).uuid; + } XsLocalNetwork storageNic2 = null; if (_storageNetworkName2 != null) { diff --git a/plugins/pom.xml b/plugins/pom.xml index d71bd45aa29..820e76fc0e9 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -38,6 +38,7 @@ hypervisors/ovm hypervisors/xen hypervisors/kvm + hypervisors/simulator network-elements/elastic-loadbalancer network-elements/ovs network-elements/nicira-nvp @@ -124,6 +125,17 @@ hypervisors/vmware + + simulator + + + simulator + + + + hypervisors/simulator + + diff --git a/pom.xml b/pom.xml index 4d31cded68c..f3740326024 100644 --- a/pom.xml +++ b/pom.xml @@ -384,7 +384,5 @@ vmware-base - - diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java index cdd5339665c..012075c2e49 100755 --- a/server/src/com/cloud/api/ApiDBUtils.java +++ b/server/src/com/cloud/api/ApiDBUtils.java @@ -469,6 +469,10 @@ public class ApiDBUtils { public static DomainVO findDomainByIdIncludingRemoved(Long domainId) { return _domainDao.findByIdIncludingRemoved(domainId); } + + public static boolean isChildDomain(long parentId, long childId) { + return _domainDao.isChildDomain(parentId, childId); + } public static DomainRouterVO findDomainRouterById(Long routerId) { return _domainRouterDao.findByIdIncludingRemoved(routerId); diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index a5747101215..8f9837f54a5 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -423,6 +423,7 @@ public class ApiResponseHelper implements ResponseGenerator { @Override public UserResponse createUserResponse(UserAccount user) { + Account account = UserContext.current().getCaller(); UserResponse userResponse = new UserResponse(); userResponse.setAccountName(user.getAccountName()); userResponse.setAccountType(user.getType()); @@ -439,8 +440,8 @@ public class ApiResponseHelper implements ResponseGenerator { userResponse.setApiKey(user.getApiKey()); userResponse.setSecretKey(user.getSecretKey()); userResponse.setAccountId((user.getAccountId())); + userResponse.setIsCallerChildDomain(ApiDBUtils.isChildDomain(account.getDomainId(), user.getDomainId())); userResponse.setObjectName("user"); - return userResponse; } diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 208bd9b7647..966c32de6c2 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -1409,15 +1409,31 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian offeringId = _offering.getId(); } - PublicIp sourceNatIp = null; - if (publicNetwork) { - sourceNatIp = _networkMgr.assignSourceNatIpAddressToGuestNetwork(owner, guestNetwork); - } - // 3) deploy virtual router(s) int count = routerCount - routers.size(); DeploymentPlan plan = planAndRouters.first(); for (int i = 0; i < count; i++) { + PublicIp sourceNatIp = null; + if (publicNetwork) { + int failCount = 0; + // Generate different MAC for VR + while (sourceNatIp == null) { + sourceNatIp = _networkMgr.assignSourceNatIpAddressToGuestNetwork(owner, guestNetwork); + NicVO nic = _nicDao.findByMacAddress(sourceNatIp.getMacAddress()); + // We got duplicate MAC here, so regenerate the mac + if (nic != null) { + s_logger.debug("Failed to find a different mac for redundant router. Try again. The current mac is " + sourceNatIp.getMacAddress()); + sourceNatIp = null; + failCount ++; + } + //Prevent infinite loop + if (failCount > 3) { + s_logger.error("Failed to find a different mac for redundant router! Abort operation!"); + throw new InsufficientAddressCapacityException("Failed to find a different mac for redundant router", null, offeringId); + } + } + } + List> networks = createRouterNetworks(owner, isRedundant, plan, guestNetwork, new Pair(publicNetwork, sourceNatIp)); //don't start the router as we are holding the network lock that needs to be released at the end of router allocation @@ -2674,6 +2690,12 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian } } + //After start network, check if it's already running + router = _routerDao.findById(routerId); + if (router.getState() == State.Running) { + return router; + } + UserVO user = _userDao.findById(UserContext.current().getCallerUserId()); Map params = new HashMap(); if (reprogramNetwork) { diff --git a/server/src/com/cloud/vm/dao/NicDao.java b/server/src/com/cloud/vm/dao/NicDao.java index 762048b65bf..af3c7b379c1 100644 --- a/server/src/com/cloud/vm/dao/NicDao.java +++ b/server/src/com/cloud/vm/dao/NicDao.java @@ -58,4 +58,6 @@ public interface NicDao extends GenericDao { NicVO findByNetworkIdInstanceIdAndBroadcastUri(long networkId, long instanceId, String broadcastUri); NicVO findByIp4AddressAndNetworkIdAndInstanceId(long networkId, long instanceId, String ip4Address); + + NicVO findByMacAddress(String macAddress); } diff --git a/server/src/com/cloud/vm/dao/NicDaoImpl.java b/server/src/com/cloud/vm/dao/NicDaoImpl.java index 3cd7fa6b488..00da2eb96a4 100644 --- a/server/src/com/cloud/vm/dao/NicDaoImpl.java +++ b/server/src/com/cloud/vm/dao/NicDaoImpl.java @@ -50,6 +50,7 @@ public class NicDaoImpl extends GenericDaoBase implements NicDao { AllFieldsSearch.and("address", AllFieldsSearch.entity().getIp4Address(), Op.EQ); AllFieldsSearch.and("isDefault", AllFieldsSearch.entity().isDefaultNic(), Op.EQ); AllFieldsSearch.and("broadcastUri", AllFieldsSearch.entity().getBroadcastUri(), Op.EQ); + AllFieldsSearch.and("macAddress", AllFieldsSearch.entity().getMacAddress(), Op.EQ); AllFieldsSearch.done(); IpSearch = createSearchBuilder(String.class); @@ -199,4 +200,11 @@ public class NicDaoImpl extends GenericDaoBase implements NicDao { sc.setParameters("address", ip4Address); return findOneBy(sc); } + + @Override + public NicVO findByMacAddress(String macAddress) { + SearchCriteria sc = AllFieldsSearch.create(); + sc.setParameters("macAddress", macAddress); + return findOneBy(sc); + } } diff --git a/setup/db/create-schema-simulator.sql b/setup/db/create-schema-simulator.sql index 1ab838b1e73..facfefc5e75 100644 --- a/setup/db/create-schema-simulator.sql +++ b/setup/db/create-schema-simulator.sql @@ -14,6 +14,7 @@ -- KIND, either express or implied. See the License for the -- specific language governing permissions and limitations -- under the License. +use simulator; DROP TABLE IF EXISTS `simulator`.`mockhost`; DROP TABLE IF EXISTS `simulator`.`mocksecstorage`; @@ -76,6 +77,7 @@ CREATE TABLE `simulator`.`mockvm` ( `vnc_port` bigint unsigned, `memory` bigint unsigned, `cpu` bigint unsigned, + `bootargs` varchar(255), PRIMARY KEY (`id`), INDEX `i_mockvm__host_id`(`host_id`), INDEX `i_mockvm__state`(`state`), diff --git a/setup/db/templates.simulator.sql b/setup/db/templates.simulator.sql index 2a140a4b21f..7e712f54177 100755 --- a/setup/db/templates.simulator.sql +++ b/setup/db/templates.simulator.sql @@ -17,439 +17,6 @@ INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (1, 'routing-1', 'SystemVM Template (XenServer)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/routing/debian/latest/systemvm.vhd.bz2', 'c33dfaf0937b35c25ef6a0fdd98f24d3', 0, 'SystemVM Template (XenServer)', 'VHD', 15, 0, 1, 'XenServer'); + VALUES (10, 'simulator-domR', 'SystemVM Template (simulator)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/routing/debian/latest/systemvm.vhd.bz2', '', 0, 'SystemVM Template (simulator)', 'VHD', 15, 0, 1, 'Simulator'); INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (2, 'centos53-x86_64', 'CentOS 5.3(64-bit) no GUI (XenServer)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/centos53-x86_64/latest/f59f18fb-ae94-4f97-afd2-f84755767aca.vhd.bz2', 'b63d854a9560c013142567bbae8d98cf', 0, 'CentOS 5.3(64-bit) no GUI (XenServer)', 'VHD', 11, 1, 1, 'XenServer'); - -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (3, 'routing-3', 'SystemVM Template (KVM)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/kvm/eec2209b-9875-3c8d-92be-c001bd8a0faf.qcow2.bz2', 'fe80a229e3bf38a702e836236ed07f57', 0, 'SystemVM Template (KVM)', 'QCOW2', 15, 0, 1, 'KVM'); - -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, display_text, enable_password, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (4, 'centos55-x86_64', 'CentOS 5.5(64-bit) no GUI (KVM)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://download.cloud.com/templates/builtin/eec2209b-9875-3c8d-92be-c001bd8a0faf.qcow2.bz2', '1da20ae69b54f761f3f733dce97adcc0', 'CentOS 5.5(64-bit) no GUI (KVM)', 0, 'QCOW2', 112, 1, 1, 'KVM'); - -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (7, 'centos53-x64', 'CentOS 5.3(64-bit) no GUI (vSphere)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://download.cloud.com/releases/2.2.0/CentOS5.3-x86_64.ova', 'f6f881b7f2292948d8494db837fe0f47', 0, 'CentOS 5.3(64-bit) no GUI (vSphere)', 'OVA', 12, 1, 1, 'VMware'); - -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (8, 'routing-8', 'SystemVM Template (vSphere)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/releases/2.2.0/systemvm.ova', 'ee3dc55e94e23a0490310bb78cf8cc76', 0, 'SystemVM Template (vSphere)', 'OVA', 15, 0, 1, 'VMware'); - -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (9, 'simulator-domR', 'SystemVM Template (simulator)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/routing/debian/latest/systemvm.vhd.bz2', '', 0, 'SystemVM Template (simulator)', 'VHD', 15, 0, 1, 'Simulator'); -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (10, 'simulator-Centos', 'CentOS 5.3(64-bit) no GUI (Simulator)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/centos53-x86_64/latest/f59f18fb-ae94-4f97-afd2-f84755767aca.vhd.bz2', '', 0, 'CentOS 5.3(64-bit) no GUI (Simulator)', 'VHD', 11, 1, 1, 'Simulator'); - -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (1, 'CentOS'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (2, 'Debian'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (3, 'Oracle'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (4, 'RedHat'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (5, 'SUSE'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (6, 'Windows'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (7, 'Other'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (8, 'Novel'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (9, 'Unix'); -INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (10, 'Ubuntu'); - - -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (1, 1, 'CentOS 4.5 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (2, 1, 'CentOS 4.6 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (3, 1, 'CentOS 4.7 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (4, 1, 'CentOS 4.8 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (5, 1, 'CentOS 5.0 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (6, 1, 'CentOS 5.0 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (7, 1, 'CentOS 5.1 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (8, 1, 'CentOS 5.1 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (9, 1, 'CentOS 5.2 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (10, 1, 'CentOS 5.2 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (11, 1, 'CentOS 5.3 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (12, 1, 'CentOS 5.3 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (13, 1, 'CentOS 5.4 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (14, 1, 'CentOS 5.4 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (15, 2, 'Debian GNU/Linux 5.0 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (16, 3, 'Oracle Enterprise Linux 5.0 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (17, 3, 'Oracle Enterprise Linux 5.0 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (18, 3, 'Oracle Enterprise Linux 5.1 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (19, 3, 'Oracle Enterprise Linux 5.1 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (20, 3, 'Oracle Enterprise Linux 5.2 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (21, 3, 'Oracle Enterprise Linux 5.2 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (22, 3, 'Oracle Enterprise Linux 5.3 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (23, 3, 'Oracle Enterprise Linux 5.3 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (24, 3, 'Oracle Enterprise Linux 5.4 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (25, 3, 'Oracle Enterprise Linux 5.4 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (26, 4, 'Red Hat Enterprise Linux 4.5 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (27, 4, 'Red Hat Enterprise Linux 4.6 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (28, 4, 'Red Hat Enterprise Linux 4.7 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (29, 4, 'Red Hat Enterprise Linux 4.8 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (30, 4, 'Red Hat Enterprise Linux 5.0 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (31, 4, 'Red Hat Enterprise Linux 5.0 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (32, 4, 'Red Hat Enterprise Linux 5.1 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (33, 4, 'Red Hat Enterprise Linux 5.1 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (34, 4, 'Red Hat Enterprise Linux 5.2 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (35, 4, 'Red Hat Enterprise Linux 5.2 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (36, 4, 'Red Hat Enterprise Linux 5.3 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (37, 4, 'Red Hat Enterprise Linux 5.3 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (38, 4, 'Red Hat Enterprise Linux 5.4 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (39, 4, 'Red Hat Enterprise Linux 5.4 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (40, 5, 'SUSE Linux Enterprise Server 9 SP4 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (41, 5, 'SUSE Linux Enterprise Server 10 SP1 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (42, 5, 'SUSE Linux Enterprise Server 10 SP1 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (43, 5, 'SUSE Linux Enterprise Server 10 SP2 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (44, 5, 'SUSE Linux Enterprise Server 10 SP2 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (45, 5, 'SUSE Linux Enterprise Server 10 SP3 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (46, 5, 'SUSE Linux Enterprise Server 11 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (47, 5, 'SUSE Linux Enterprise Server 11 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (48, 6, 'Windows 7 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (49, 6, 'Windows 7 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (50, 6, 'Windows Server 2003 Enterprise Edition(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (51, 6, 'Windows Server 2003 Enterprise Edition(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (52, 6, 'Windows Server 2008 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (53, 6, 'Windows Server 2008 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (54, 6, 'Windows Server 2008 R2 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (55, 6, 'Windows 2000 Server SP4 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (56, 6, 'Windows Vista (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (57, 6, 'Windows XP SP2 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (58, 6, 'Windows XP SP3 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (59, 10, 'Other Ubuntu (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (60, 7, 'Other (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (61, 6, 'Windows 2000 Server'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (62, 6, 'Windows 98'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (63, 6, 'Windows 95'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (64, 6, 'Windows NT 4'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (65, 6, 'Windows 3.1'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (66, 4, 'Red Hat Enterprise Linux 3(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (67, 4, 'Red Hat Enterprise Linux 3(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (68, 7, 'Open Enterprise Server'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (69, 7, 'Asianux 3(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (70, 7, 'Asianux 3(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (72, 2, 'Debian GNU/Linux 5(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (73, 2, 'Debian GNU/Linux 4(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (74, 2, 'Debian GNU/Linux 4(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (75, 7, 'Other 2.6x Linux (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (76, 7, 'Other 2.6x Linux (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (77, 8, 'Novell Netware 6.x'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (78, 8, 'Novell Netware 5.1'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (79, 9, 'Sun Solaris 10(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (80, 9, 'Sun Solaris 10(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (81, 9, 'Sun Solaris 9(Experimental)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (82, 9, 'Sun Solaris 8(Experimental)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (83, 9, 'FreeBSD (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (84, 9, 'FreeBSD (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (85, 9, 'SCO OpenServer 5'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (86, 9, 'SCO UnixWare 7'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (87, 6, 'Windows Server 2003 DataCenter Edition(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (88, 6, 'Windows Server 2003 DataCenter Edition(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (89, 6, 'Windows Server 2003 Standard Edition(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (90, 6, 'Windows Server 2003 Standard Edition(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (91, 6, 'Windows Server 2003 Web Edition'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (92, 6, 'Microsoft Small Bussiness Server 2003'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (93, 6, 'Windows XP (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (94, 6, 'Windows XP (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (95, 6, 'Windows 2000 Advanced Server'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (96, 5, 'SUSE Linux Enterprise 8(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (97, 5, 'SUSE Linux Enterprise 8(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (98, 7, 'Other Linux (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (99, 7, 'Other Linux (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (100, 10, 'Other Ubuntu (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (101, 6, 'Windows Vista (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (102, 6, 'DOS'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (103, 7, 'Other (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (104, 7, 'OS/2'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (105, 6, 'Windows 2000 Professional'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (106, 4, 'Red Hat Enterprise Linux 4(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (107, 5, 'SUSE Linux Enterprise 9(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (108, 5, 'SUSE Linux Enterprise 9(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (109, 5, 'SUSE Linux Enterprise 10(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (110, 5, 'SUSE Linux Enterprise 10(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (111, 1, 'CentOS 5.5 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (112, 1, 'CentOS 5.5 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (113, 4, 'Red Hat Enterprise Linux 5.5 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (114, 4, 'Red Hat Enterprise Linux 5.5 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (115, 4, 'Fedora 13'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (116, 4, 'Fedora 12'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (117, 4, 'Fedora 11'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (118, 4, 'Fedora 10'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (119, 4, 'Fedora 9'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (120, 4, 'Fedora 8'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (121, 10, 'Ubuntu 10.04 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (122, 10, 'Ubuntu 9.10 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (123, 10, 'Ubuntu 9.04 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (124, 10, 'Ubuntu 8.10 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (125, 10, 'Ubuntu 8.04 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (126, 10, 'Ubuntu 10.04 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (127, 10, 'Ubuntu 9.10 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (128, 10, 'Ubuntu 9.04 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (129, 10, 'Ubuntu 8.10 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (130, 10, 'Ubuntu 8.04 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (131, 4, 'Red Hat Enterprise Linux 2'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (132, 2, 'Debian GNU/Linux 6(32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (133, 2, 'Debian GNU/Linux 6(64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (134, 3, 'Oracle Enterprise Linux 5.5 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (135, 3, 'Oracle Enterprise Linux 5.5 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (136, 4, 'Red Hat Enterprise Linux 6.0 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (137, 4, 'Red Hat Enterprise Linux 6.0 (64-bit)'); - - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.5 (32-bit)', 1); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.6 (32-bit)', 2); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.7 (32-bit)', 3); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 4.8 (32-bit)', 4); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.0 (32-bit)', 5); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.0 (64-bit)', 6); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.1 (32-bit)', 7); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.1 (32-bit)', 8); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.2 (32-bit)', 9); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.2 (64-bit)', 10); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.3 (32-bit)', 11); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.3 (64-bit)', 12); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.4 (32-bit)', 13); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'CentOS 5.4 (64-bit)', 14); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Debian Lenny 5.0 (32-bit)', 15); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.0 (32-bit)', 16); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.0 (64-bit)', 17); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.1 (32-bit)', 18); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.1 (64-bit)', 19); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.2 (32-bit)', 20); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.2 (64-bit)', 21); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.3 (32-bit)', 22); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.3 (64-bit)', 23); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.4 (32-bit)', 24); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Oracle Enterprise Linux 5.4 (64-bit)', 25); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.5 (32-bit)', 26); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.6 (32-bit)', 27); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.7 (32-bit)', 28); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 4.8 (32-bit)', 29); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.0 (32-bit)', 30); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.0 (64-bit)', 31); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.1 (32-bit)', 32); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.1 (64-bit)', 33); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.2 (32-bit)', 34); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.2 (64-bit)', 35); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.3 (32-bit)', 36); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.3 (64-bit)', 37); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.4 (32-bit)', 38); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Red Hat Enterprise Linux 5.4 (64-bit)', 39); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 9 SP4 (32-bit)', 40); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP1 (32-bit)', 41); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP1 (64-bit)', 42); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP2 (32-bit)', 43); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP2 (64-bit)', 44); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 10 SP3 (64-bit)', 45); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 11 (32-bit)', 46); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'SUSE Linux Enterprise Server 11 (64-bit)', 47); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows 7 (32-bit)', 48); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows 7 (64-bit)', 49); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2003 (32-bit)', 50); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2003 (64-bit)', 51); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2008 (32-bit)', 52); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2008 (64-bit)', 53); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Server 2008 R2 (64-bit)', 54); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows 2000 SP4 (32-bit)', 55); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows Vista (32-bit)', 56); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows XP SP2 (32-bit)', 57); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Windows XP SP3 (32-bit)', 58); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 59); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 100); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 60); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("XenServer", 'Other install media', 103); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 121); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 126); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 122); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 127); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 123); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 128); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 124); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 129); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 125); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('XenServer', 'Other install media', 130); - - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 7(32-bit)', 48); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 7(64-bit)', 49); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2008 R2(64-bit)', 54); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2008(32-bit)', 52); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2008(64-bit)', 53); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Enterprise Edition (32-bit)', 50); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Enterprise Edition (64-bit)', 51); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Datacenter Edition (32-bit)', 87); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Datacenter Edition (64-bit)', 88); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (32-bit)', 89); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Standard Edition (64-bit)', 90); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Server 2003, Web Edition', 91); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Small Bussiness Server 2003', 92); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (32-bit)', 56); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows Vista (64-bit)', 101); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 93); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 57); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (32-bit)', 58); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows XP Professional (64-bit)', 94); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Advanced Server', 95); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Server', 61); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Professional', 105); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 2000 Server', 55); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 98', 62); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 95', 63); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows NT 4', 64); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 3.1', 65); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 30); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 32); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 34); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 36); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(32-bit)', 38); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 31); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 33); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 35); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 37); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5(64-bit)', 39); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 26); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 27); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 28); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(32-bit)', 29); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 4(64-bit)', 106); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 3(32-bit)', 66); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 3(64-bit)', 67); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 2', 131); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 11(32-bit)', 46); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 11(64-bit)', 47); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(32-bit)', 41); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(32-bit)', 43); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 42); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 44); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 45); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(32-bit)', 109); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 10(64-bit)', 110); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(32-bit)', 40); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(32-bit)', 96); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(64-bit)', 97); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(32-bit)', 107); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Suse Linux Enterprise 8/9(64-bit)', 108); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Open Enterprise Server', 68); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Asianux 3(32-bit)', 69); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Asianux 3(64-bit)', 70); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 5(32-bit)', 15); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 5(64-bit)', 72); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 4(32-bit)', 73); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Debian GNU/Linux 4(64-bit)', 74); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 59); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 121); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 122); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 123); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 124); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (32-bit)', 125); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 100); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 126); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 127); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 128); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 129); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Ubuntu Linux (64-bit)', 130); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other 2.6x Linux (32-bit)', 75); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other 2.6x Linux (64-bit)', 76); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Linux (32-bit)', 98); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other Linux (64-bit)', 99); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Novell Netware 6.x', 77); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Novell Netware 5.1', 78); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 10(32-bit)', 79); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 10(64-bit)', 80); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 9(Experimental)', 81); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Sun Solaris 8(Experimental)', 82); - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'FreeBSD (32-bit)', 83); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'FreeBSD (64-bit)', 84); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'OS/2', 104); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'SCO OpenServer 5', 85); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'SCO UnixWare 7', 86); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'DOS', 102); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other (32-bit)', 60); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Other (64-bit)', 103); - - - -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.5', 1); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.6', 2); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.7', 3); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.8', 4); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.0', 5); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.0', 6); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.1', 7); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.1', 8); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.2', 9); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.2', 10); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.3', 11); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.3', 12); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.4', 13); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.4', 14); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.5', 111); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 5.5', 112); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.5', 26); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.6', 27); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.7', 28); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4.8', 29); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.0', 30); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.0', 31); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.1', 32); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.1', 33); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.2', 34); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.2', 35); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.3', 36); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.3', 37); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.4', 38); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.4', 39); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.5', 113); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 5.5', 114); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 4', 106); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 3', 66); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 3', 67); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Red Hat Enterprise Linux 2', 131); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 13', 115); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 12', 116); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 11', 117); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 10', 118); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 9', 119); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Fedora 8', 120); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 10.04', 121); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 10.04', 126); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.10', 122); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.10', 127); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.04', 123); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 9.04', 128); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.10', 124); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.10', 129); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.04', 125); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Ubuntu 8.04', 130); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 5', 15); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 5', 72); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 4', 73); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Debian GNU/Linux 4', 74); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux 2.6x', 75); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux 2.6x', 76); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Ubuntu', 59); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Ubuntu', 100); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux', 98); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other Linux', 99); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 7', 48); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 7', 49); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 50); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 51); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 87); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 88); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 89); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 90); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 91); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2003', 92); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2008', 52); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Server 2008', 53); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 2000', 55); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 2000', 61); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 2000', 95); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows 98', 62); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Vista', 56); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows Vista', 101); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP SP2', 57); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP SP3', 58); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP ', 93); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Windows XP ', 94); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'DOS', 102); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other', 60); -INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'Other', 103); - + VALUES (11, 'simulator-Centos', 'CentOS 5.3(64-bit) no GUI (Simulator)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/centos53-x86_64/latest/f59f18fb-ae94-4f97-afd2-f84755767aca.vhd.bz2', '', 0, 'CentOS 5.3(64-bit) no GUI (Simulator)', 'VHD', 11, 1, 1, 'Simulator'); diff --git a/tools/cli/cloudmonkey/cloudmonkey.py b/tools/cli/cloudmonkey/cloudmonkey.py index e4fe76ff26f..edb62ccc801 100644 --- a/tools/cli/cloudmonkey/cloudmonkey.py +++ b/tools/cli/cloudmonkey/cloudmonkey.py @@ -26,7 +26,6 @@ try: import logging import os import pdb - import sets import shlex import sys import time @@ -332,8 +331,8 @@ class CloudMonkeyShell(cmd.Cmd, object): setattr(api_cmd, attribute, args_dict[attribute]) command = api_cmd() - missing_args = list(sets.Set(command.required).difference( - sets.Set(args_dict.keys()))) + missing_args = filter(lambda x: x not in args_dict.keys(), + command.required) if len(missing_args) > 0: self.print_shell("Missing arguments:", ' '.join(missing_args)) diff --git a/tools/marvin/marvin/jsonHelper.py b/tools/marvin/marvin/jsonHelper.py index b2e7d2ff7dc..652cce0bf9e 100644 --- a/tools/marvin/marvin/jsonHelper.py +++ b/tools/marvin/marvin/jsonHelper.py @@ -121,7 +121,7 @@ def getResultObj(returnObj, responsecls=None): if len(returnObj) == 0: return None - responseName = returnObj.keys()[0] + responseName = filter(lambda a: a!=u'cloudstack-version', returnObj.keys())[0] response = returnObj[responseName] if len(response) == 0: diff --git a/tools/marvin/marvin/sandbox/demo/simulator/simulator.cfg b/tools/marvin/marvin/sandbox/demo/simulator/simulator.cfg index 219c4dbbff5..7c733ade256 100644 --- a/tools/marvin/marvin/sandbox/demo/simulator/simulator.cfg +++ b/tools/marvin/marvin/sandbox/demo/simulator/simulator.cfg @@ -148,10 +148,6 @@ "name": "workers", "value": "10" }, - { - "name": "use.user.concentrated.pod.allocation", - "value": "false" - }, { "name": "account.cleanup.interval", "value": "600" diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 23353cecc37..3ac73dd8a54 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -441,13 +441,20 @@ body.login { div.list-view table tbody td span { display: block; float: left; - max-width: 210px; + max-width: 160px; word-wrap: break-word; text-indent: 0; margin-left: 12px; line-height: 15px; - overflow: auto; + overflow: hidden; overflow-x: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +div.list-view table tbody td span:hover { + overflow: auto; + margin-top: 4px; } div.list-view div.toolbar div.section-switcher div.section-select label { @@ -3427,7 +3434,6 @@ Dialogs*/ display: inline; padding: 0; float: right; - text-decoration: underline; color: #516374; /*+text-shadow:0px -1px 1px #FFFFFF;*/ -moz-text-shadow: 0px -1px 1px #FFFFFF; @@ -3524,6 +3530,11 @@ Dialogs*/ -webkit-text-shadow: 0px -1px 1px #495968; -o-text-shadow: 0px -1px 1px #495968; text-shadow: 0px -1px 1px #495968; + background: url(../images/icons.png) no-repeat 0px -255px; +} + +.notice .ui-dialog-title { + background-position: 0px -288px; } .ui-dialog.confirm .ui-dialog-title { @@ -7466,11 +7477,12 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t } .multi-edit .data .data-body .data-item > table tbody tr td span { - overflow-x: auto; - overflow-y: hidden; - max-width: 88px; + overflow: hidden; + max-width: 78px; display: block; float: left; + text-overflow: ellipsis; + white-space: nowrap; } .multi-edit .data .data-body .data-item table tbody tr td.blank { @@ -8790,6 +8802,7 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t .project-selector .listing .data ul li { padding: 10px 0 10px 7px; cursor: pointer; + font-size: 12px; } .project-selector .listing .data ul li.odd { @@ -8813,8 +8826,8 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t text-shadow: 0px 1px 1px #FFFFFF; text-align: left; color: #4F6171; - font-size: 12px; - padding: 2px 2px 3px 7px; + font-size: 11px; + padding: 3px 2px 3px 7px; border-bottom: 1px solid #FFFFFF; position: absolute; left: 0; @@ -8827,17 +8840,14 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t border-radius: 4px 4px 4px 4px; font-size: 13px; font-weight: bold; + padding: 8px 20px; float: none; cursor: pointer; color: #838181; - /*+placement:shift 488px 9px;*/ - position: relative; - left: 488px; - top: 9px; left: 170px; top: -8px; - margin: 19px 0 0 0px; width: 54px; + margin: auto auto 17px; } .project-selector .button.cancel:hover { @@ -9202,9 +9212,9 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t } .info-boxes .info-box ul li .date { - font-size: 13px; + font-size: 11px; text-align: center; - margin: 0; + margin: 1px 0 0; } .info-boxes .info-box ul li .date span { @@ -9223,7 +9233,10 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t top: 8px; display: inline-block; padding-bottom: 13px; - max-width: 171px; + max-width: 153px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .info-boxes .info-box ul li .total span { diff --git a/ui/images/icons.png b/ui/images/icons.png index 63c10b02631..ea1a39cdf7f 100644 Binary files a/ui/images/icons.png and b/ui/images/icons.png differ diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 324c5f56988..ba741a4f063 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -1248,22 +1248,20 @@ if (jsonObj.state == 'Destroyed') return []; if(isAdmin()) { - allowedActions.push("edit"); //updating networkdomain is allowed on any account, including system-generated default admin account - if(!(jsonObj.domain == "ROOT" && jsonObj.name == "admin" && jsonObj.accounttype == 1)) { //if not system-generated default admin account - if(jsonObj.state == "enabled") { - allowedActions.push("disable"); - allowedActions.push("lock"); + allowedActions.push("edit"); //updating networkdomain is allowed on any account, including system-generated default admin account + if(!(jsonObj.domain == "ROOT" && jsonObj.name == "admin" && jsonObj.accounttype == 1)) { //if not system-generated default admin account + if(jsonObj.state == "enabled") { + allowedActions.push("disable"); + allowedActions.push("lock"); + } else if(jsonObj.state == "disabled" || jsonObj.state == "locked") { + allowedActions.push("enable"); + } + allowedActions.push("remove"); } - else if(jsonObj.state == "disabled" || jsonObj.state == "locked") { - allowedActions.push("enable"); - } - allowedActions.push("remove"); - } - allowedActions.push("updateResourceCount"); - } - else if(isDomainAdmin()) { - allowedActions.push("updateResourceCount"); - } + allowedActions.push("updateResourceCount"); + } else if(isDomainAdmin()) { + allowedActions.push("updateResourceCount"); + } return allowedActions; } @@ -1281,6 +1279,10 @@ allowedActions.push("enable"); allowedActions.push("remove"); } + } else { + if(isSelfOrChildDomainUser(jsonObj.username, jsonObj.accounttype, jsonObj.domainid, jsonObj.iscallerchilddomain)) { + allowedActions.push("changePassword"); + } } return allowedActions; } diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 961c97387a4..eb78ad15da0 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -158,6 +158,22 @@ function isUser() { return (g_role == 0); } +function isSelfOrChildDomainUser(username, useraccounttype, userdomainid, iscallerchilddomain) { + if(username == g_username) { //is self + return true; + } else if(isDomainAdmin() + && iscallerchilddomain + && (useraccounttype == 0)) { //domain admin to user + return true; + } else if(isDomainAdmin() + && iscallerchilddomain + && (userdomainid != g_domainid) ) { //domain admin to subdomain admin and user + return true; + } else { + return false; + } +} + // FUNCTION: Handles AJAX error callbacks. You can pass in an optional function to // handle errors that are not already handled by this method. function handleError(XMLHttpResponse, handleErrorCallback) { diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js index 60f8e02c041..85523ea5e7a 100644 --- a/ui/scripts/ui/widgets/listView.js +++ b/ui/scripts/ui/widgets/listView.js @@ -914,6 +914,8 @@ $('').html(_s(content)) ); } + + $td.attr('title', _s(content)); }); $tr.find('td:first').addClass('first'); diff --git a/utils/conf/db.properties b/utils/conf/db.properties index 8c8833f7e94..18bf54c2b61 100644 --- a/utils/conf/db.properties +++ b/utils/conf/db.properties @@ -57,3 +57,14 @@ db.usage.autoReconnect=true # awsapi database settings db.awsapi.name=cloudbridge + +# Simulator database settings +db.simulator.username=cloud +db.simulator.password=cloud +db.simulator.host=localhost +db.simulator.port=3306 +db.simulator.name=simulator +db.simulator.maxActive=250 +db.simulator.maxIdle=30 +db.simulator.maxWait=10000 +db.simulator.autoReconnect=true