/** * Initializes a new instance of the Role class. * */ public Role() { this.setConfigurationSets(new LazyArrayList<ConfigurationSet>()); this.setDataVirtualHardDisks(new LazyArrayList<DataVirtualHardDisk>()); this.setResourceExtensionReferences(new LazyArrayList<ResourceExtensionReference>()); } }
private ArrayList<Role> createRoleList(VMInstance a, VM vm,String storageAccountName, String storageContainer) throws Exception { ArrayList<Role> roleList = new ArrayList<Role>(); Role role = new Role(); String roleName = a.getName(); //required role.setRoleName(roleName); role.setRoleType(VirtualMachineRoleType.PersistentVMRole.toString()); String size=VirtualMachineRoleSize.SMALL; if(!vm.getProviderSpecificTypeName().equals("")) size=vm.getProviderSpecificTypeName(); role.setRoleSize(size);//TODO: size with mincore role.setProvisionGuestAgent(true); ArrayList<ConfigurationSet> configurationSets = new ArrayList<ConfigurationSet>(); role.setConfigurationSets(configurationSets); role.setOSVirtualHardDisk(createOSVHD(vm,storageAccountName,storageContainer)); roleList.add(role); configurationSets.add(createConfigOS(a.getName(),vm)); configurationSets.add(createConfigNetwork()); return roleList; }