Package com.abiquo.server.core.cloud

Examples of com.abiquo.server.core.cloud.VirtualMachineState


   @Override
   public MonitorStatus apply(final VirtualMachine virtualMachine) {
      checkNotNull(virtualMachine, "virtualMachine");

      try {
         VirtualMachineState state = virtualMachine.getState();
         return state == expectedState ? MonitorStatus.DONE : MonitorStatus.CONTINUE;
      } catch (Exception ex) {
         logger.warn(ex, "exception thrown while monitoring %s on %s, returning CONTINUE", virtualMachine, getClass()
               .getName());
View Full Code Here


   @Override
   public MonitorStatus apply(final VirtualMachine virtualMachine) {
      checkNotNull(virtualMachine, "virtualMachine");

      try {
         VirtualMachineState state = virtualMachine.getState();

         // This state may be reached if the undeploy process fails and a
         // rollback is done
         if (state.existsInHypervisor()) {
            return MonitorStatus.FAILED;
         }

         switch (state) {
            case UNKNOWN:
View Full Code Here

      Iterable<Ip<?, ?>> nics = vm.listAttachedNics();
      builder.privateAddresses(ips(filter(nics, Predicates.instanceOf(PrivateIp.class))));
      builder.publicAddresses(ips(filter(nics, Predicates.not(Predicates.instanceOf(PrivateIp.class)))));

      // Node state
      VirtualMachineState state = vm.getState();
      builder.status(virtualMachineStateToNodeState.apply(state));
      builder.backendStatus(state.name());

      return builder.build();
   }
View Full Code Here

      Iterable<AsyncTask<?, ?>> tasks = env.virtualMachine.listTasks();
      assertNotNull(tasks);
   }

   public void testGetState() {
      VirtualMachineState state = env.virtualMachine.getState();
      assertEquals(state, VirtualMachineState.NOT_ALLOCATED);
   }
View Full Code Here

      List<AsyncTask> tasks = env.virtualMachine.listTasks();
      assertNotNull(tasks);
   }

   public void testGetState() {
      VirtualMachineState state = env.virtualMachine.getState();
      assertEquals(state, VirtualMachineState.NOT_ALLOCATED);
   }
View Full Code Here

      List<Ip<?, ?>> nics = vm.listAttachedNics();
      builder.privateAddresses(ips(filter(nics, Predicates.instanceOf(PrivateIp.class))));
      builder.publicAddresses(ips(filter(nics, Predicates.not(Predicates.instanceOf(PrivateIp.class)))));

      // Node state
      VirtualMachineState state = vm.getState();
      builder.status(virtualMachineStateToNodeState.apply(state));
      builder.backendStatus(state.name());

      return builder.build();
   }
View Full Code Here

    *      VirtualMachineResource-Retrievethestateofthevirtualmachine</a>
    * @return Current state of the virtual machine.
    */
   public VirtualMachineState getState() {
      VirtualMachineStateDto stateDto = context.getApi().getCloudApi().getVirtualMachineState(target);
      VirtualMachineState state = stateDto.getState();
      target.setState(state);
      target.setIdState(state.id());
      return state;
   }
View Full Code Here

      // If there is a gateway network, we have to wait until the network
      // configuration links are
      // available
      if (task != null) {
         VirtualMachineState originalState = target.getState();
         VirtualMachineMonitor monitor = context.utils().injector().getInstance(MonitoringService.class)
               .getVirtualMachineMonitor();
         monitor.awaitState(originalState, this);
      }
View Full Code Here

TOP

Related Classes of com.abiquo.server.core.cloud.VirtualMachineState

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.