Package com.vmware.aurora.composition

Examples of com.vmware.aurora.composition.VmSchema


      return VcResourceUtils.findHost(node.getHostName());
   }

   private CreateVmSP getReplacementVmSp(ClusterCreate clusterSpec,
         String groupName, NodeEntity node, List<DiskSpec> fullDiskSet) {
      VmSchema createSchema =
            VcVmUtil.getVmSchema(clusterSpec, groupName, fullDiskSet,
                  clusteringService.getTemplateVmId(),
                  Constants.ROOT_SNAPSTHOT_NAME);

      List<NetworkAdd> networkAdds = clusterSpec.getNetworkings();
View Full Code Here


         nodeMap.put(vNode.getVmName(), vNode);
         vNode.setSuccess(false);
         vNode.setFinished(false);
         // generate create spec for fast clone
         VmCreateSpec spec = new VmCreateSpec();
         VmSchema createSchema = getVmSchema(vNode);
         spec.setSchema(createSchema);
         String defaultPgName = null;
         GuestMachineIdSpec machineIdSpec =
               new GuestMachineIdSpec(networkAdds,
                     vNode.fetchPortGroupToIpV4Map(),
                     vNode.getPrimaryMgtPgName());
         logger.info("machine id of vm " + vNode.getVmName() + ":\n"
               + machineIdSpec.toString());
         spec.setBootupConfigs(machineIdSpec.toGuestVariable());
         // timeout is 10 mintues
         StartVmPostPowerOn query =
               new StartVmPostPowerOn(vNode.getNics().keySet(),
                     Constants.VM_POWER_ON_WAITING_SEC);
         spec.setPostPowerOn(query);
         spec.setPrePowerOn(getPrePowerOnFunc(vNode, reserveRawDisks));
         spec.setLinkedClone(false);
         spec.setTargetDs(getVcDatastore(vNode));
         spec.setTargetFolder(folders.get(vNode.getGroupName()));
         spec.setTargetHost(VcResourceUtils.findHost(vNode.getTargetHost()));
         spec.setTargetRp(getVcResourcePool(vNode, clusterRpName));
         spec.setVmName(vNode.getVmName());
         specs.add(spec);
      }

      BaseProgressCallback callback = new BaseProgressCallback(statusUpdator);

      logger.info("ClusteringService, start to clone template.");
      AuAssert.check(specs.size() > 0);
      VmSchema vmSchema = specs.get(0).getSchema();
      VcVmUtil.checkAndCreateSnapshot(vmSchema);

      // call clone service to copy templates
      List<VmCreateResult<?>> results =
            cloneService.createCopies(sourceSpec, cloneConcurrency, specs,
View Full Code Here

               vNode.getTargetVcCluster(), vNode.getTargetRp());
      }
   }

   private VmSchema getVmSchema(BaseNode vNode) {
      VmSchema schema = vNode.getVmSchema();
      schema.diskSchema.setParent(getTemplateVmId());
      schema.diskSchema.setParentSnap(Constants.ROOT_SNAPSTHOT_NAME);
      return schema;
   }
View Full Code Here

      List<NetworkAdd> networkAdds = createNetworkAdd();
      List<BaseNode> vNodes = new ArrayList<BaseNode>();
      BaseNode node = new BaseNode("test-master-0");
      ClusterCreate spec = createClusterSpec();
      node.setCluster(spec);
      VmSchema vmSchema = createVmSchema();
      node.setVmSchema(vmSchema);
      vNodes.add(node);
      MockTmScheduler.setFlag(VmOperation.CREATE_FOLDER, false);
      try {
         service.createVcVms(networkAdds, vNodes, null, false, null);
View Full Code Here

      List<NetworkAdd> networkAdds = createNetworkAdd();
      List<BaseNode> vNodes = new ArrayList<BaseNode>();
      BaseNode node = new BaseNode("test-master-0");
      ClusterCreate spec = createClusterSpec();
      node.setCluster(spec);
      VmSchema vmSchema = createVmSchema();
      node.setVmSchema(vmSchema);
      vNodes.add(node);
      MockTmScheduler.setFlag(VmOperation.CREATE_FOLDER, true);
      MockTmScheduler.setResultIsNull(true);
      try {
View Full Code Here

      node.setNodeGroup(spec.getNodeGroup("master"));
      node.setTargetVcCluster("cluster-ws");
      node.setVmMobId("test-vm");
      vNodes.add(node);
      // create vm schema
      VmSchema vmSchema = createVmSchema();
      node.setVmSchema(vmSchema);

      // mock a clusterEntityMgr and node group entity
      ClusterEntity clusterEntity = Mockito.mock(ClusterEntity.class);
      Mockito.when(clusterEntity.getIoShares()).thenReturn(Priority.HIGH);
View Full Code Here

      networkAdds.add(networkAdd);
      return networkAdds;
   }

   private VmSchema createVmSchema() {
      VmSchema vmSchema = new VmSchema();
      vmSchema.diskSchema = new DiskSchema();
      vmSchema.networkSchema = new NetworkSchema();
      vmSchema.networkSchema.networks = new ArrayList<Network>();
      vmSchema.resourceSchema = new ResourceSchema();
      return vmSchema;
View Full Code Here

      node.setCluster(spec);
      node.setNodeGroup(spec.getNodeGroup("master"));
      node.setTargetVcCluster("cluster-ws");
      vNodes.add(node);
      // create vm schema
      VmSchema vmSchema = createVmSchema();
      node.setVmSchema(vmSchema);

      // mock a clusterEntityMgr and node group entity
      NodeGroupEntity nodeGroup = Mockito.mock(NodeGroupEntity.class);
      ClusterEntity clusterEntity = Mockito.mock(ClusterEntity.class);
View Full Code Here

         ClusterCreate cluster) {
      super();
      this.vmName = vmName;
      this.nodeGroup = nodeGroup;
      this.cluster = cluster;
      this.vmSchema = new VmSchema();
      initNics(cluster);
   }
View Full Code Here

   @Test
   public void testGetVmSchema() {
      ClusterCreate spec = getClusterSpec();
      List<DiskSpec> diskSet = getDiskSpec();
      VmSchema schema =
            VcVmUtil.getVmSchema(spec, "master", diskSet, "vm-101", "snap-102");
      Assert.assertTrue(schema.resourceSchema.numCPUs == 2,
            "Excepted cpu number is 2, but got "
                  + schema.resourceSchema.numCPUs);
      List<Disk> disks = schema.diskSchema.getDisks();
View Full Code Here

TOP

Related Classes of com.vmware.aurora.composition.VmSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.