Updated Branches:
  refs/heads/vpc 12ee8810f -> 6420ecbd6

Merge branch 'master' into vpc

Conflicts:
        server/src/com/cloud/server/ManagementServerImpl.java


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6420ecbd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6420ecbd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6420ecbd

Branch: refs/heads/vpc
Commit: 6420ecbd6f5c2e37053b41ab37f3e777f4a3beaf
Parents: 119e4e7 71fddd0
Author: Alena Prokharchyk <[email protected]>
Authored: Tue Jul 24 16:13:06 2012 -0700
Committer: Alena Prokharchyk <[email protected]>
Committed: Tue Jul 24 16:13:06 2012 -0700

----------------------------------------------------------------------
 agent/conf/environment.properties.in               |    1 +
 .../centos/SYSCONFDIR/rc.d/init.d/cloud-agent.in   |   27 +-
 .../fedora/SYSCONFDIR/rc.d/init.d/cloud-agent.in   |   27 +-
 .../opensuse/sles/SYSCONFDIR/init.d/cloud-agent.in |   49 ++-
 .../rhel/SYSCONFDIR/rc.d/init.d/cloud-agent.in     |   27 +-
 agent/distro/sles/SYSCONFDIR/init.d/cloud-agent.in |   49 ++-
 .../distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in |   38 ++-
 agent/libexec/agent-runner.in                      |   88 ----
 agent/src/com/cloud/agent/AgentShell.java          |   39 +-
 .../deploy/production/server/conf/log4j-cloud.xml  |   50 ++-
 build/package.xml                                  |    2 +-
 .../WEB-INF/classes/resources/messages.properties  |    2 +-
 client/tomcatconf/components.xml.in                |    2 +-
 cloud-cli/cloudapis/cloud.py                       |    2 +-
 cloud.spec                                         |    2 +
 daemonize/daemonize.c                              |  351 ---------------
 debian/cloud-agent-deps.install                    |    2 +-
 debian/control                                     |    4 +-
 deps/.classpath                                    |    2 +-
 deps/cloud-libvirt-0.4.5.jar                       |  Bin 68899 -> 0 bytes
 deps/libvirt-0.4.8.jar                             |  Bin 0 -> 70122 bytes
 .../hypervisor/vmware/resource/VmwareResource.java |    4 +
 .../api/commands/AddExternalLoadBalancerCmd.java   |   31 +-
 .../cloud/api/commands/AddF5LoadBalancerCmd.java   |   31 +-
 .../api/commands/ConfigureF5LoadBalancerCmd.java   |   29 +-
 .../commands/DeleteExternalLoadBalancerCmd.java    |   29 +-
 .../api/commands/DeleteF5LoadBalancerCmd.java      |   29 +-
 .../api/commands/ListExternalLoadBalancersCmd.java |   29 +-
 .../commands/ListF5LoadBalancerNetworksCmd.java    |   29 +-
 .../cloud/api/commands/ListF5LoadBalancersCmd.java |   29 +-
 .../src/com/cloud/server/ManagementServerImpl.java |   20 -
 .../com/cloud/user/MockAccountManagerImpl.java     |    9 +
 .../distro/ubuntu/SYSCONFDIR/init.d/cloud-usage.in |   28 +-
 usage/libexec/usage-runner.in                      |   37 --
 usage/src/com/cloud/usage/UsageServer.java         |   19 +-
 35 files changed, 417 insertions(+), 700 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6420ecbd/client/tomcatconf/components.xml.in
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6420ecbd/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --cc 
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 8d7b37c,685a321..4a398cf
--- 
a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ 
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@@ -2375,97 -2375,101 +2375,101 @@@ public class VmwareResource implements 
          try {
                // We will leave datastore cleanup management to vCenter. Since 
for cluster VMFS datastore, it will always
                // be mounted by vCenter.
 -              
 -            // VmwareHypervisorHost hyperHost = 
this.getHyperHost(getServiceContext());
 -            // hyperHost.unmountDatastore(pool.getUuid());
 -            Answer answer = new Answer(cmd, true, "success");
 -            return answer;
 -        } catch (Throwable e) {
 -            if (e instanceof RemoteException) {
 -                s_logger.warn("Encounter remote exception to vCenter, 
invalidate VMware session context");
 -                invalidateServiceContext();
 -            }
 -
 -            String msg = "DeleteStoragePoolCommand (pool: " + pool.getHost() 
+ ", path: " + pool.getPath() + ") failed due to " + 
VmwareHelper.getExceptionMessage(e);
 -            return new Answer(cmd, false, msg);
 -        }
 -    }
 -
 -    protected Answer execute(AttachVolumeCommand cmd) {
 -        if (s_logger.isInfoEnabled()) {
 -            s_logger.info("Executing resource AttachVolumeCommand: " + 
_gson.toJson(cmd));
 -        }
 -
 -        /*
 -         * AttachVolumeCommand { 
"attach":true,"vmName":"i-2-1-KY","pooltype":"NetworkFilesystem",
 -         * "volumeFolder":"/export/home/kelven/vmware-test/primary", 
"volumePath":"uuid",
 -         * "volumeName":"volume name","deviceId":1 }
 -         */
 -        try {
 -            VmwareHypervisorHost hyperHost = 
getHyperHost(getServiceContext());
 -            VirtualMachineMO vmMo = 
hyperHost.findVmOnHyperHost(cmd.getVmName());
 -            if (vmMo == null) {
 -                String msg = "Unable to find the VM to execute 
AttachVolumeCommand, vmName: " + cmd.getVmName();
 -                s_logger.error(msg);
 -                throw new Exception(msg);
 -            }
 -
 -            ManagedObjectReference morDs = 
HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, 
cmd.getPoolUuid());
 -            if (morDs == null) {
 -                String msg = "Unable to find the mounted datastore to execute 
AttachVolumeCommand, vmName: " + cmd.getVmName();
 -                s_logger.error(msg);
 -                throw new Exception(msg);
 -            }
 -
 -            DatastoreMO dsMo = new DatastoreMO(getServiceContext(), morDs);
 -            String datastoreVolumePath = String.format("[%s] %s.vmdk", 
dsMo.getName(), cmd.getVolumePath());
 -
 -            AttachVolumeAnswer answer = new AttachVolumeAnswer(cmd, 
cmd.getDeviceId());
 -            if (cmd.getAttach()) {
 -                vmMo.attachDisk(new String[] { datastoreVolumePath }, morDs);
 -            } else {
 -              vmMo.removeAllSnapshots();
 -                vmMo.detachDisk(datastoreVolumePath, false);
 -            }
 -
 -            return answer;
 -        } catch (Throwable e) {
 -            if (e instanceof RemoteException) {
 -                s_logger.warn("Encounter remote exception to vCenter, 
invalidate VMware session context");
 -                invalidateServiceContext();
 -            }
 -
 -            String msg = "AttachVolumeCommand failed due to " + 
VmwareHelper.getExceptionMessage(e);
 -            s_logger.error(msg, e);
 -            return new AttachVolumeAnswer(cmd, msg);
 -        }
 -    }
 -
 -    protected Answer execute(AttachIsoCommand cmd) {
 -        if (s_logger.isInfoEnabled()) {
 -            s_logger.info("Executing resource AttachIsoCommand: " + 
_gson.toJson(cmd));
 -        }
 -
 -        try {
 -            VmwareHypervisorHost hyperHost = 
getHyperHost(getServiceContext());
 -            VirtualMachineMO vmMo = 
hyperHost.findVmOnHyperHost(cmd.getVmName());
 -            if (vmMo == null) {
 -                String msg = "Unable to find VM in vSphere to execute 
AttachIsoCommand, vmName: " + cmd.getVmName();
 -                s_logger.error(msg);
 -                throw new Exception(msg);
 -            }
 -
 -            String storeUrl = cmd.getStoreUrl();
 -            if (storeUrl == null) {
 -                if (!cmd.getIsoPath().equalsIgnoreCase("vmware-tools.iso")) {
 -                    String msg = "ISO store root url is not found in 
AttachIsoCommand";
 -                    s_logger.error(msg);
 -                    throw new Exception(msg);
 -                } else {
 -                    if (cmd.isAttach()) {
 -                        vmMo.mountToolsInstaller();
 +              
 +            // VmwareHypervisorHost hyperHost = 
this.getHyperHost(getServiceContext());
 +            // hyperHost.unmountDatastore(pool.getUuid());
 +            Answer answer = new Answer(cmd, true, "success");
 +            return answer;
 +        } catch (Throwable e) {
 +            if (e instanceof RemoteException) {
 +                s_logger.warn("Encounter remote exception to vCenter, 
invalidate VMware session context");
 +                invalidateServiceContext();
 +            }
 +
 +            String msg = "DeleteStoragePoolCommand (pool: " + pool.getHost() 
+ ", path: " + pool.getPath() + ") failed due to " + 
VmwareHelper.getExceptionMessage(e);
 +            return new Answer(cmd, false, msg);
 +        }
 +    }
 +
 +    protected Answer execute(AttachVolumeCommand cmd) {
 +        if (s_logger.isInfoEnabled()) {
 +            s_logger.info("Executing resource AttachVolumeCommand: " + 
_gson.toJson(cmd));
 +        }
 +
 +        /*
 +         * AttachVolumeCommand { 
"attach":true,"vmName":"i-2-1-KY","pooltype":"NetworkFilesystem",
 +         * "volumeFolder":"/export/home/kelven/vmware-test/primary", 
"volumePath":"uuid",
 +         * "volumeName":"volume name","deviceId":1 }
 +         */
 +        try {
 +            VmwareHypervisorHost hyperHost = 
getHyperHost(getServiceContext());
 +            VirtualMachineMO vmMo = 
hyperHost.findVmOnHyperHost(cmd.getVmName());
 +            if (vmMo == null) {
 +                String msg = "Unable to find the VM to execute 
AttachVolumeCommand, vmName: " + cmd.getVmName();
 +                s_logger.error(msg);
 +                throw new Exception(msg);
 +            }
 +
 +            ManagedObjectReference morDs = 
HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, 
cmd.getPoolUuid());
 +            if (morDs == null) {
 +                String msg = "Unable to find the mounted datastore to execute 
AttachVolumeCommand, vmName: " + cmd.getVmName();
 +                s_logger.error(msg);
 +                throw new Exception(msg);
 +            }
 +
 +            DatastoreMO dsMo = new DatastoreMO(getServiceContext(), morDs);
 +            String datastoreVolumePath = String.format("[%s] %s.vmdk", 
dsMo.getName(), cmd.getVolumePath());
 +
 +            AttachVolumeAnswer answer = new AttachVolumeAnswer(cmd, 
cmd.getDeviceId());
 +            if (cmd.getAttach()) {
 +                vmMo.attachDisk(new String[] { datastoreVolumePath }, morDs);
 +            } else {
 +              vmMo.removeAllSnapshots();
 +                vmMo.detachDisk(datastoreVolumePath, false);
 +            }
 +
 +            return answer;
 +        } catch (Throwable e) {
 +            if (e instanceof RemoteException) {
 +                s_logger.warn("Encounter remote exception to vCenter, 
invalidate VMware session context");
 +                invalidateServiceContext();
 +            }
 +
 +            String msg = "AttachVolumeCommand failed due to " + 
VmwareHelper.getExceptionMessage(e);
 +            s_logger.error(msg, e);
 +            return new AttachVolumeAnswer(cmd, msg);
 +        }
 +    }
 +
 +    protected Answer execute(AttachIsoCommand cmd) {
 +        if (s_logger.isInfoEnabled()) {
 +            s_logger.info("Executing resource AttachIsoCommand: " + 
_gson.toJson(cmd));
 +        }
 +
 +        try {
 +            VmwareHypervisorHost hyperHost = 
getHyperHost(getServiceContext());
 +            VirtualMachineMO vmMo = 
hyperHost.findVmOnHyperHost(cmd.getVmName());
 +            if (vmMo == null) {
 +                String msg = "Unable to find VM in vSphere to execute 
AttachIsoCommand, vmName: " + cmd.getVmName();
 +                s_logger.error(msg);
 +                throw new Exception(msg);
 +            }
 +
 +            String storeUrl = cmd.getStoreUrl();
 +            if (storeUrl == null) {
 +                if (!cmd.getIsoPath().equalsIgnoreCase("vmware-tools.iso")) {
 +                    String msg = "ISO store root url is not found in 
AttachIsoCommand";
 +                    s_logger.error(msg);
 +                    throw new Exception(msg);
 +                } else {
 +                    if (cmd.isAttach()) {
 +                        vmMo.mountToolsInstaller();
                      } else {
+                         try{
 -                            vmMo.unmountToolsInstaller();
 +                        vmMo.unmountToolsInstaller();
+                         }catch(Throwable e){
+                             vmMo.detachIso(null);
+                         }
                      }
  
                      return new Answer(cmd);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6420ecbd/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/server/ManagementServerImpl.java
index f0e8afa,bcdafa9..95fc0de
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@@ -1789,24 -1765,9 +1788,9 @@@ public class ManagementServerImpl imple
              vlanType = VlanType.VirtualNetwork;
          }
  
-         // don't show SSVM/CPVM ips
-         boolean omitSystemVmIps = false;
-         if (vlanType == VlanType.VirtualNetwork && (allocatedOnly) && vpcId 
== null) {
-             
-             SearchBuilder<NicVO> nonSystemVmSearch = 
_nicDao.createSearchBuilder();
-             nonSystemVmSearch.and().op("vmTypeNnull", 
nonSystemVmSearch.entity().getVmType(), Op.NULL);
-             nonSystemVmSearch.or("vmType", 
nonSystemVmSearch.entity().getVmType(), Op.NOTIN);
-             nonSystemVmSearch.cp();
-             sb.join("nonSystemVms", nonSystemVmSearch, 
sb.entity().getAddress(), 
-                     nonSystemVmSearch.entity().getIp4Address(), 
JoinType.LEFTOUTER);
- //            sb.and().join("nonSystemVms", nonSystemVmSearch, 
sb.entity().getSourceNetworkId(), 
- //                    nonSystemVmSearch.entity().getNetworkId(), 
JoinType.INNER);
-             omitSystemVmIps = true;
-         }
- 
          SearchCriteria<IPAddressVO> sc = sb.create();
          if (isAllocated) {
 -          _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, 
permittedAccounts, listProjectResourcesCriteria);
 +        _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, 
permittedAccounts, listProjectResourcesCriteria);
          }
  
          sc.setJoinParameters("vlanSearch", "vlanType", vlanType);

Reply via email to