com.vmware.vim25.CustomizationSpec Java Examples

The following examples show how to use com.vmware.vim25.CustomizationSpec. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VmwarePooledUpdateInstanceTaskTest.java    From teamcity-vmware-plugin with Apache License 2.0 6 votes vote down vote up
@BeforeMethod
@Override
protected void setUp() throws Exception {
  super.setUp();
  myIdxStorage = createTempDir();
  FakeModel.instance().addDatacenter("dc");
  FakeModel.instance().addFolder("cf").setParent("dc", Datacenter.class);
  FakeModel.instance().addResourcePool("rp").setParentFolder("cf");
  FakeModel.instance().addVM("image1").setParentFolder("cf");
  FakeModel.instance().addVM("image2").setParentFolder("cf");
  FakeModel.instance().addVM("image_template").setParentFolder("cf");
  FakeModel.instance().addVMSnapshot("image2", "snap");
  FakeModel.instance().getCustomizationSpecs().put("someCustomization", new CustomizationSpec());
  FakeModel.instance().getCustomizationSpecs().put("linux", new CustomizationSpec());
  myFakeApiConnector = new FakeApiConnector(TEST_SERVER_UUID, PROFILE_ID, null);
  setInternalProperty("teamcity.vsphere.instance.status.update.delay.ms", "250");
  myTaskManager = new MyExposingVmwareUpdateTaskManager();
}
 
Example #2
Source File: GuestServiceTest.java    From cs-actions with Apache License 2.0 5 votes vote down vote up
@Test
public void customizeLinuxVMException() throws Exception {
    whenNew(MorObjectHandler.class).withNoArguments().thenReturn(morObjectHandlerMock);
    when(httpInputsMock.isCloseSession()).thenReturn(true);
    when(morObjectHandlerMock.getMor(any(ConnectionResources.class), anyString(), anyString())).thenReturn(vmMorMock);
    whenNew(GuestConfigSpecs.class).withNoArguments().thenReturn(guestConfigSpecsMock);
    when(guestConfigSpecsMock.getLinuxCustomizationSpec(any(GuestInputs.class))).thenReturn(customizationSpecMock);
    doNothing().when(vimPortMock).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    when(vimPortMock.customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class))).thenReturn(null);
    whenNew(ResponseHelper.class).withArguments(any(ConnectionResources.class), any(ManagedObjectReference.class))
            .thenReturn(getResponseHelper(connectionResourcesMock, taskMock, true));

    VmInputs vmInputs = new VmInputs.VmInputsBuilder().withVirtualMachineName("testLinuxVMName").build();
    GuestInputs guestInputs = new GuestInputs.GuestInputsBuilder().build();

    Map<String, String> results = guestService.customizeVM(httpInputsMock, vmInputs, guestInputs, false);

    verify(connectionResourcesMock, times(1)).getConnection();
    verify(connectionMock, times(1)).disconnect();
    verify(morObjectHandlerMock, times(1)).getMor(any(ConnectionResources.class), anyString(), anyString());
    verify(connectionResourcesMock, times(2)).getVimPortType();
    verify(guestConfigSpecsMock, times(1)).getLinuxCustomizationSpec(any(GuestInputs.class));
    verify(vimPortMock, times(1)).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(vimPortMock, times(1)).customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(taskMock, never()).getValue();

    assertNotNull(results);
    assertEquals(-1, Integer.parseInt(results.get("returnCode")));
    assertEquals("java.lang.NullPointerException", results.get("returnResult"));
}
 
Example #3
Source File: GuestServiceTest.java    From cs-actions with Apache License 2.0 5 votes vote down vote up
@Test
public void customizeLinuxVMNotFound() throws Exception {
    whenNew(MorObjectHandler.class).withNoArguments().thenReturn(morObjectHandlerMock);
    when(httpInputsMock.isCloseSession()).thenReturn(true);
    when(morObjectHandlerMock.getMor(any(ConnectionResources.class), anyString(), anyString())).thenReturn(null);
    whenNew(GuestConfigSpecs.class).withNoArguments().thenReturn(guestConfigSpecsMock);
    when(guestConfigSpecsMock.getLinuxCustomizationSpec(any(GuestInputs.class))).thenReturn(customizationSpecMock);
    doNothing().when(vimPortMock).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    when(vimPortMock.customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class))).thenReturn(taskMock);
    whenNew(ResponseHelper.class).withArguments(any(ConnectionResources.class), any(ManagedObjectReference.class))
            .thenReturn(getResponseHelper(connectionResourcesMock, taskMock, true));

    VmInputs vmInputs = new VmInputs.VmInputsBuilder().withVirtualMachineName("testLinuxVMName").build();
    GuestInputs guestInputs = new GuestInputs.GuestInputsBuilder().build();

    Map<String, String> results = guestService.customizeVM(httpInputsMock, vmInputs, guestInputs, false);

    verify(connectionResourcesMock, times(1)).getConnection();
    verify(connectionMock, times(1)).disconnect();
    verify(morObjectHandlerMock, times(1)).getMor(any(ConnectionResources.class), anyString(), anyString());
    verify(connectionResourcesMock, never()).getVimPortType();
    verify(guestConfigSpecsMock, never()).getLinuxCustomizationSpec(any(GuestInputs.class));
    verify(vimPortMock, never()).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(vimPortMock, never()).customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(taskMock, never()).getValue();

    assertNotNull(results);
    assertEquals(-1, Integer.parseInt(results.get("returnCode")));
    assertEquals("Could not find the [testLinuxVMName] VM.", results.get("returnResult"));
}
 
Example #4
Source File: GuestServiceTest.java    From cs-actions with Apache License 2.0 5 votes vote down vote up
@Test
public void customizeLinuxVMFailure() throws Exception {
    whenNew(MorObjectHandler.class).withNoArguments().thenReturn(morObjectHandlerMock);
    when(httpInputsMock.isCloseSession()).thenReturn(true);
    when(morObjectHandlerMock.getMor(any(ConnectionResources.class), anyString(), anyString())).thenReturn(vmMorMock);
    whenNew(GuestConfigSpecs.class).withNoArguments().thenReturn(guestConfigSpecsMock);
    when(guestConfigSpecsMock.getLinuxCustomizationSpec(any(GuestInputs.class))).thenReturn(customizationSpecMock);
    doNothing().when(vimPortMock).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    when(vimPortMock.customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class))).thenReturn(taskMock);
    whenNew(ResponseHelper.class).withArguments(any(ConnectionResources.class), any(ManagedObjectReference.class))
            .thenReturn(getResponseHelper(connectionResourcesMock, taskMock, false));

    VmInputs vmInputs = new VmInputs.VmInputsBuilder().withVirtualMachineName("testLinuxVMName").build();
    GuestInputs guestInputs = new GuestInputs.GuestInputsBuilder().build();

    Map<String, String> results = guestService.customizeVM(httpInputsMock, vmInputs, guestInputs, false);

    verifyConnection();
    verify(morObjectHandlerMock, times(1)).getMor(any(ConnectionResources.class), anyString(), anyString());
    verify(guestConfigSpecsMock, times(1)).getLinuxCustomizationSpec(any(GuestInputs.class));
    verify(vimPortMock, times(1)).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(vimPortMock, times(1)).customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(taskMock, times(1)).getValue();

    assertNotNull(results);
    assertEquals(-1, Integer.parseInt(results.get("returnCode")));
    assertEquals("Failure: The [testLinuxVMName] VM could not be customized.", results.get("returnResult"));
}
 
Example #5
Source File: GuestServiceTest.java    From cs-actions with Apache License 2.0 5 votes vote down vote up
@Test
public void customizeLinuxVMSuccess() throws Exception {
    whenNew(MorObjectHandler.class).withNoArguments().thenReturn(morObjectHandlerMock);
    when(httpInputsMock.isCloseSession()).thenReturn(true);
    when(morObjectHandlerMock.getMor(any(ConnectionResources.class), anyString(), anyString())).thenReturn(vmMorMock);
    whenNew(GuestConfigSpecs.class).withNoArguments().thenReturn(guestConfigSpecsMock);
    when(guestConfigSpecsMock.getLinuxCustomizationSpec(any(GuestInputs.class))).thenReturn(customizationSpecMock);
    doNothing().when(vimPortMock).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    when(vimPortMock.customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class))).thenReturn(taskMock);
    whenNew(ResponseHelper.class).withArguments(any(ConnectionResources.class), any(ManagedObjectReference.class))
            .thenReturn(getResponseHelper(connectionResourcesMock, taskMock, true));

    VmInputs vmInputs = new VmInputs.VmInputsBuilder().withVirtualMachineName("testLinuxVMName").build();
    GuestInputs guestInputs = new GuestInputs.GuestInputsBuilder().build();

    Map<String, String> results = guestService.customizeVM(httpInputsMock, vmInputs, guestInputs, false);

    verifyConnection();
    verify(morObjectHandlerMock, times(1)).getMor(any(ConnectionResources.class), anyString(), anyString());
    verify(guestConfigSpecsMock, times(1)).getLinuxCustomizationSpec(any(GuestInputs.class));
    verify(vimPortMock, times(1)).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(vimPortMock, times(1)).customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(taskMock, times(1)).getValue();

    assertNotNull(results);
    assertEquals(0, Integer.parseInt(results.get("returnCode")));
    assertEquals("Success: The [testLinuxVMName] VM was successfully customized. The taskId is: task-12345", results.get("returnResult"));
}
 
Example #6
Source File: GuestServiceTest.java    From cs-actions with Apache License 2.0 5 votes vote down vote up
@Test
public void customizeWinVMNotFound() throws Exception {
    whenNew(MorObjectHandler.class).withNoArguments().thenReturn(morObjectHandlerMock);
    when(httpInputsMock.isCloseSession()).thenReturn(true);
    when(morObjectHandlerMock.getMor(any(ConnectionResources.class), anyString(), anyString())).thenReturn(null);
    whenNew(GuestConfigSpecs.class).withNoArguments().thenReturn(guestConfigSpecsMock);
    when(guestConfigSpecsMock.getWinCustomizationSpec(any(GuestInputs.class))).thenReturn(customizationSpecMock);
    doNothing().when(vimPortMock).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    when(vimPortMock.customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class))).thenReturn(taskMock);
    whenNew(ResponseHelper.class).withArguments(any(ConnectionResources.class), any(ManagedObjectReference.class))
            .thenReturn(getResponseHelper(connectionResourcesMock, taskMock, true));

    VmInputs vmInputs = new VmInputs.VmInputsBuilder().withVirtualMachineName("testWinVMName").build();
    GuestInputs guestInputs = new GuestInputs.GuestInputsBuilder()
            .withRebootOption("noreboot").withLicenseDataMode("perServer").build();

    Map<String, String> results = guestService.customizeVM(httpInputsMock, vmInputs, guestInputs, true);

    verify(connectionResourcesMock, times(1)).getConnection();
    verify(connectionMock, times(1)).disconnect();
    verify(morObjectHandlerMock, times(1)).getMor(any(ConnectionResources.class), anyString(), anyString());
    verify(connectionResourcesMock, never()).getVimPortType();
    verify(guestConfigSpecsMock, never()).getWinCustomizationSpec(any(GuestInputs.class));
    verify(vimPortMock, never()).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(vimPortMock, never()).customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(taskMock, never()).getValue();

    assertNotNull(results);
    assertEquals(-1, Integer.parseInt(results.get("returnCode")));
    assertEquals("Could not find the [testWinVMName] VM.", results.get("returnResult"));
}
 
Example #7
Source File: GuestServiceTest.java    From cs-actions with Apache License 2.0 5 votes vote down vote up
@Test
public void customizeWinVMFailure() throws Exception {
    whenNew(MorObjectHandler.class).withNoArguments().thenReturn(morObjectHandlerMock);
    when(httpInputsMock.isCloseSession()).thenReturn(true);
    when(morObjectHandlerMock.getMor(any(ConnectionResources.class), anyString(), anyString())).thenReturn(vmMorMock);
    whenNew(GuestConfigSpecs.class).withNoArguments().thenReturn(guestConfigSpecsMock);
    when(guestConfigSpecsMock.getWinCustomizationSpec(any(GuestInputs.class))).thenReturn(customizationSpecMock);
    doNothing().when(vimPortMock).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    when(vimPortMock.customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class))).thenReturn(taskMock);
    whenNew(ResponseHelper.class).withArguments(any(ConnectionResources.class), any(ManagedObjectReference.class))
            .thenReturn(getResponseHelper(connectionResourcesMock, taskMock, false));

    VmInputs vmInputs = new VmInputs.VmInputsBuilder().withVirtualMachineName("testWinVMName").build();
    GuestInputs guestInputs = new GuestInputs.GuestInputsBuilder()
            .withRebootOption("noreboot").withLicenseDataMode("perServer").build();

    Map<String, String> results = guestService.customizeVM(httpInputsMock, vmInputs, guestInputs, true);

    verifyConnection();
    verify(morObjectHandlerMock, times(1)).getMor(any(ConnectionResources.class), anyString(), anyString());
    verify(guestConfigSpecsMock, times(1)).getWinCustomizationSpec(any(GuestInputs.class));
    verify(vimPortMock, times(1)).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(vimPortMock, times(1)).customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(taskMock, times(1)).getValue();

    assertNotNull(results);
    assertEquals(-1, Integer.parseInt(results.get("returnCode")));
    assertEquals("Failure: The [testWinVMName] VM could not be customized.", results.get("returnResult"));
}
 
Example #8
Source File: GuestServiceTest.java    From cs-actions with Apache License 2.0 5 votes vote down vote up
@Test
public void customizeWinVMSuccess() throws Exception {
    whenNew(MorObjectHandler.class).withNoArguments().thenReturn(morObjectHandlerMock);
    when(httpInputsMock.isCloseSession()).thenReturn(true);
    when(morObjectHandlerMock.getMor(any(ConnectionResources.class), anyString(), anyString())).thenReturn(vmMorMock);
    whenNew(GuestConfigSpecs.class).withNoArguments().thenReturn(guestConfigSpecsMock);
    when(guestConfigSpecsMock.getWinCustomizationSpec(any(GuestInputs.class))).thenReturn(customizationSpecMock);
    doNothing().when(vimPortMock).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    when(vimPortMock.customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class))).thenReturn(taskMock);
    whenNew(ResponseHelper.class).withArguments(any(ConnectionResources.class), any(ManagedObjectReference.class))
            .thenReturn(getResponseHelper(connectionResourcesMock, taskMock, true));

    VmInputs vmInputs = new VmInputs.VmInputsBuilder().withVirtualMachineName("testWinVMName").build();
    GuestInputs guestInputs = new GuestInputs.GuestInputsBuilder()
            .withRebootOption("noreboot").withLicenseDataMode("perServer").build();

    Map<String, String> results = guestService.customizeVM(httpInputsMock, vmInputs, guestInputs, true);

    verifyConnection();
    verify(morObjectHandlerMock, times(1)).getMor(any(ConnectionResources.class), anyString(), anyString());
    verify(guestConfigSpecsMock, times(1)).getWinCustomizationSpec(any(GuestInputs.class));
    verify(vimPortMock, times(1)).checkCustomizationSpec(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(vimPortMock, times(1)).customizeVMTask(any(ManagedObjectReference.class), any(CustomizationSpec.class));
    verify(taskMock, times(1)).getValue();

    assertNotNull(results);
    assertEquals(0, Integer.parseInt(results.get("returnCode")));
    assertEquals("Success: The [testWinVMName] VM was successfully customized. The taskId is: task-12345", results.get("returnResult"));
}
 
Example #9
Source File: GuestService.java    From cs-actions with Apache License 2.0 5 votes vote down vote up
/**
 * Method used to connect to specified data center and customize the windows OS based virtual machine identified
 * by the inputs provided.
 *
 * @param httpInputs  Object that has all the inputs necessary to made a connection to data center
 * @param vmInputs    Object that has all the specific inputs necessary to identify the targeted virtual machine
 * @param guestInputs Object that has all specific inputs necessary to customize specified virtual machine
 * @return Map with String as key and value that contains returnCode of the operation, success message with task id
 *         of the execution or failure message and the exception if there is one
 * @throws Exception
 */
public Map<String, String> customizeVM(HttpInputs httpInputs, VmInputs vmInputs, GuestInputs guestInputs, boolean isWin)
        throws Exception {
    ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
    try {
        ManagedObjectReference vmMor = new MorObjectHandler()
                .getMor(connectionResources, ManagedObjectType.VIRTUAL_MACHINE.getValue(), vmInputs.getVirtualMachineName());
        if (vmMor != null) {
            CustomizationSpec customizationSpec = isWin ? new GuestConfigSpecs().getWinCustomizationSpec(guestInputs)
                    : new GuestConfigSpecs().getLinuxCustomizationSpec(guestInputs);

            connectionResources.getVimPortType().checkCustomizationSpec(vmMor, customizationSpec);
            ManagedObjectReference task = connectionResources.getVimPortType().customizeVMTask(vmMor, customizationSpec);

            return new ResponseHelper(connectionResources, task)
                    .getResultsMap("Success: The [" +
                    vmInputs.getVirtualMachineName() + "] VM was successfully customized. The taskId is: " +
                    task.getValue(), "Failure: The [" + vmInputs.getVirtualMachineName() + "] VM could not be customized.");
        } else {
            return ResponseUtils.getVmNotFoundResultsMap(vmInputs);
        }
    } catch (Exception ex) {
        return ResponseUtils.getResultsMap(ex.toString(), Outputs.RETURN_CODE_FAILURE);
    } finally {
        if (httpInputs.isCloseSession()) {
            connectionResources.getConnection().disconnect();
            clearConnectionFromContext(httpInputs.getGlobalSessionObject());
        }
    }
}
 
Example #10
Source File: FakeApiConnector.java    From teamcity-vmware-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public CustomizationSpec getCustomizationSpec(final String name) throws VmwareCheckedCloudException {
  final CustomizationSpec spec = FakeModel.instance().getCustomizationSpec(name);
  if (spec == null){
    throw new VmwareCheckedCloudException("Unable to get Customization Spec '" + name + "'");
  }
  return spec;
}
 
Example #11
Source File: GuestConfigSpecs.java    From cs-actions with Apache License 2.0 4 votes vote down vote up
private void setAdapter(GuestInputs guestInputs, CustomizationSpec customizationSpec) {
    CustomizationAdapterMapping adapterMapping = getCustomizationAdapterMapping(guestInputs);
    List<CustomizationAdapterMapping> adaptersList = customizationSpec.getNicSettingMap();
    adaptersList.add(adapterMapping);
}
 
Example #12
Source File: VmwareCustomizeProcess.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
protected void customizeWindows(VmwareProcessClient vmwareProcessClient, VmwareInstance vmwareInstance,
        VirtualMachine machine) {
    CustomizationSpec customSpec = new CustomizationSpec();

    // Windows設定
    CustomizationSysprep identity = new CustomizationSysprep();

    CustomizationGuiUnattended guiUnattended = new CustomizationGuiUnattended();
    guiUnattended.setAutoLogon(false);
    guiUnattended.setAutoLogonCount(1);
    guiUnattended.setTimeZone(235);
    CustomizationPassword password = new CustomizationPassword();
    password.setPlainText(true);

    // Adminパスワードのデフォルトはユーザのパスワードをセットする
    Instance instance = instanceDao.read(vmwareInstance.getInstanceNo());
    Farm farm = farmDao.read(instance.getFarmNo());
    User user = userDao.read(farm.getUserNo());
    PccSystemInfo pccSystemInfo = pccSystemInfoDao.read();
    if (pccSystemInfo == null) {
        // PCC_SYSTEM_INFOのレコードが存在しない場合
        log.error(MessageUtils.getMessage("EPROCESS-000532"));
        throw new AutoException("EPROCESS-000532");
    }
    PasswordEncryptor encryptor = new PasswordEncryptor();
    String decryptPassword = encryptor.decrypt(user.getPassword(), pccSystemInfo.getSecretKey());
    password.setValue(decryptPassword);
    guiUnattended.setPassword(password);
    identity.setGuiUnattended(guiUnattended);

    CustomizationUserData userData = new CustomizationUserData();
    userData.setProductId("");
    userData.setFullName(windowsFullName);
    userData.setOrgName(windowsOrgName);
    CustomizationFixedName computerName = new CustomizationFixedName();
    computerName.setName(instance.getInstanceName());
    userData.setComputerName(computerName);
    identity.setUserData(userData);

    CustomizationIdentification identification = new CustomizationIdentification();
    identification.setJoinWorkgroup(windowsWorkgroup);
    identity.setIdentification(identification);

    // Windows Server 2000, 2003のみ必要
    CustomizationLicenseFilePrintData printData = new CustomizationLicenseFilePrintData();
    printData.setAutoMode(CustomizationLicenseDataMode.perSeat);
    identity.setLicenseFilePrintData(printData);

    customSpec.setIdentity(identity);

    // Windowsオプション設定
    CustomizationWinOptions options = new CustomizationWinOptions();
    options.setChangeSID(true);
    options.setReboot(CustomizationSysprepRebootOption.shutdown);
    customSpec.setOptions(options);

    // グローバル設定
    CustomizationGlobalIPSettings globalIpSettings = new CustomizationGlobalIPSettings();

    // DNSサーバ設定
    List<String> dnsServerList = new ArrayList<String>();
    // Primary DNSサーバ
    dnsServerList.add(Config.getProperty("dns.server"));
    // Secondry DNSサーバ
    String dns2 = Config.getProperty("dns.server2");
    if (dns2 != null && dns2.length() > 0) {
        dnsServerList.add(Config.getProperty("dns.server2"));
    }

    globalIpSettings.setDnsServerList(dnsServerList.toArray(new String[dnsServerList.size()]));
    List<String> dnsSuffixList = new ArrayList<String>();
    dnsSuffixList.add(farm.getDomainName());
    globalIpSettings.setDnsSuffixList(dnsSuffixList.toArray(new String[dnsSuffixList.size()]));
    customSpec.setGlobalIPSettings(globalIpSettings);

    // NIC設定
    List<CustomizationAdapterMapping> nicSettingMap = createCustomizationAdapterMappings(vmwareProcessClient,
            machine);
    customSpec.setNicSettingMap(nicSettingMap.toArray(new CustomizationAdapterMapping[nicSettingMap.size()]));

    vmwareProcessClient.customize(vmwareInstance.getMachineName(), customSpec);

}
 
Example #13
Source File: FakeModel.java    From teamcity-vmware-plugin with Apache License 2.0 4 votes vote down vote up
public CustomizationSpec getCustomizationSpec(String name){
  return myCustomizationSpecs.get(name);
}
 
Example #14
Source File: FakeModel.java    From teamcity-vmware-plugin with Apache License 2.0 4 votes vote down vote up
public Map<String, CustomizationSpec> getCustomizationSpecs() {
  return myCustomizationSpecs;
}
 
Example #15
Source File: GuestConfigSpecs.java    From cs-actions with Apache License 2.0 3 votes vote down vote up
public CustomizationSpec getLinuxCustomizationSpec(GuestInputs guestInputs) {
    CustomizationSpec customizationSpec = new CustomizationSpec();

    CustomizationLinuxPrep customizationLinuxPrep = getCustomizationLinuxPrep(guestInputs);
    customizationSpec.setIdentity(customizationLinuxPrep);

    CustomizationGlobalIPSettings customizationGlobalIPSettings = new CustomizationGlobalIPSettings();
    customizationSpec.setGlobalIPSettings(customizationGlobalIPSettings);

    setAdapter(guestInputs, customizationSpec);

    return customizationSpec;
}
 
Example #16
Source File: GuestConfigSpecs.java    From cs-actions with Apache License 2.0 3 votes vote down vote up
public CustomizationSpec getWinCustomizationSpec(GuestInputs guestInputs) {
    CustomizationSpec customizationSpec = new CustomizationSpec();

    CustomizationSysprep customizationSysprep = getCustomizationSysprep(guestInputs);
    customizationSpec.setIdentity(customizationSysprep);

    CustomizationWinOptions winOptions = getCustomizationWinOptions(guestInputs);
    customizationSpec.setOptions(winOptions);

    customizationSpec.setGlobalIPSettings(new CustomizationGlobalIPSettings());

    setAdapter(guestInputs, customizationSpec);

    return customizationSpec;
}
 
Example #17
Source File: VMWareApiConnector.java    From teamcity-vmware-plugin with Apache License 2.0 votes vote down vote up
CustomizationSpec getCustomizationSpec(String name) throws VmwareCheckedCloudException;