com.vmware.vim25.mo.samples.vm.MigrateVM.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vijava Show documentation
Show all versions of vijava Show documentation
Java API for accessing VMWare web services API
The newest version!
???? 2 ? (com/vmware/vim25/mo/samples/vm/MigrateVM java/lang/Object ()V Code
LineNumberTable LocalVariableTable this *Lcom/vmware/vim25/mo/samples/vm/MigrateVM; main ([Ljava/lang/String;)V
Exceptions java/lang/Exception java/lang/System out Ljava/io/PrintStream; DUsage: java MigrateVM
java/io/PrintStream println (Ljava/lang/String;)V
" # $ exit (I)V & #com/vmware/vim25/mo/ServiceInstance ( java/net/URL
' *
% , - 6(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;Z)V
% / 0 1
getRootFolder ()Lcom/vmware/vim25/mo/Folder; 3 &com/vmware/vim25/mo/InventoryNavigator
2 5 6 &(Lcom/vmware/vim25/mo/ManagedEntity;)V 8 VirtualMachine
2 : ; < searchManagedEntity I(Ljava/lang/String;Ljava/lang/String;)Lcom/vmware/vim25/mo/ManagedEntity; > "com/vmware/vim25/mo/VirtualMachine @
HostSystem B com/vmware/vim25/mo/HostSystem
A D E F getParent %()Lcom/vmware/vim25/mo/ManagedEntity; H #com/vmware/vim25/mo/ComputeResource J java/lang/String L cpu N software
% P Q R queryVMotionCompatibility ?(Lcom/vmware/vim25/mo/VirtualMachine;[Lcom/vmware/vim25/mo/HostSystem;[Ljava/lang/String;)[Lcom/vmware/vim25/HostVMotionCompatibility;
T V U )com/vmware/vim25/HostVMotionCompatibility W X getCompatibility ()[Ljava/lang/String; Z "CPU/software NOT compatible. Exit.
% \ ] ^ getServerConnection (()Lcom/vmware/vim25/mo/ServerConnection;
` b a $com/vmware/vim25/mo/ServerConnection c logout
G e f g getResourcePool $()Lcom/vmware/vim25/mo/ResourcePool; i k j +com/vmware/vim25/VirtualMachineMovePriority l m highPriority -Lcom/vmware/vim25/VirtualMachineMovePriority; o q p )com/vmware/vim25/VirtualMachinePowerState r s poweredOn +Lcom/vmware/vim25/VirtualMachinePowerState;
= u v w migrateVM_Task ?(Lcom/vmware/vim25/mo/ResourcePool;Lcom/vmware/vim25/mo/HostSystem;Lcom/vmware/vim25/VirtualMachineMovePriority;Lcom/vmware/vim25/VirtualMachinePowerState;)Lcom/vmware/vim25/mo/Task;
y { z com/vmware/vim25/mo/Task | } waitForMe ()Ljava/lang/String; success ?
VMotioned! ? VMotion failed!
y ? ? ? getTaskInfo ()Lcom/vmware/vim25/TaskInfo;
? ? ? com/vmware/vim25/TaskInfo ? ? getError )()Lcom/vmware/vim25/LocalizedMethodFault;
? ? ? %com/vmware/vim25/LocalizedMethodFault ? ? getFault ()Lcom/vmware/vim25/MethodFault;
? ? (Ljava/lang/Object;)V args [Ljava/lang/String; vmname Ljava/lang/String; newHostName si %Lcom/vmware/vim25/mo/ServiceInstance;
rootFolder Lcom/vmware/vim25/mo/Folder; vm $Lcom/vmware/vim25/mo/VirtualMachine; newHost Lcom/vmware/vim25/mo/HostSystem; cr %Lcom/vmware/vim25/mo/ComputeResource; checks vmcs ,[Lcom/vmware/vim25/HostVMotionCompatibility; comps task Lcom/vmware/vim25/mo/Task; info Lcom/vmware/vim25/TaskInfo;
StackMapTable ? ? com/vmware/vim25/mo/Folder ?
SourceFile MigrateVM.java ! / *? ?
3
?
?*?? ? ? ? !*2L*2M? %Y? 'Y*2? )*2*2? +N-? .:? 2Y? 47+? 9? =:? 2Y? 4?,? 9? A:? C? G:? IYKSYMS:-? AYS? O: 2? S:
?
?? ? Y? -? [? _?? d? h? n? t:? x~? ? ?? ? ? ?? ? ?:? ? ?? ?? ?-? [? _?
? + 7 9 ; > ? A B / A 3 D 9 E = F ? E B G E F H E M H Q I S H V J Y I \ H a K k M { O ~ P ? O ? N ? R ? S ? U ? V ? W ? Z ? [ ? \ ? Z ? ^ ? ` ? d ? e ? f ? h ? i ?
? ? ? ? ? ? ? ? ? 3 ? ? ? 9 ? ? ? M ? ? ? a ? ? ? k ? ? ? { ? ? ? ? p ? ? ? g ? ?
? : ? ? ? ? ? ? 2 ? ? ? I I % ? = A G ? ? ? ? ( y ? ?