All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vmware.vim25.mo.samples.vm.VMReconfig.class Maven / Gradle / Ivy

The newest version!
????2?)com/vmware/vim25/mo/samples/vm/VMReconfigjava/lang/Objectclp,Lcom/vmware/vim25/mo/util/CommandLineParser;()VCode	LineNumberTableLocalVariableTable
this+Lcom/vmware/vim25/mo/samples/vm/VMReconfig;reConfigS(Lcom/vmware/vim25/mo/util/CommandLineParser;Lcom/vmware/vim25/mo/VirtualMachine;)V
Exceptionsjava/lang/Exceptiondevice
*com/vmware/vim25/mo/util/CommandLineParser
get_option&(Ljava/lang/String;)Ljava/lang/String;!)com/vmware/vim25/VirtualMachineConfigSpec
 $memory
&('java/lang/String)*equalsIgnoreCase(Ljava/lang/String;)Z	,.-java/lang/System/0outLjava/io/PrintStream;2java/lang/StringBuilder44Reconfiguring The Virtual Machine For Memory Update 
167(Ljava/lang/String;)V9vmname
1;<=append-(Ljava/lang/String;)Ljava/lang/StringBuilder;
1?@AtoString()Ljava/lang/String;
CEDjava/io/PrintStreamF7printlnHvalue
JKL	getShares=(Ljava/lang/String;)Lcom/vmware/vim25/ResourceAllocationInfo;
 NOPsetMemoryAllocation,(Lcom/vmware/vim25/ResourceAllocationInfo;)VR7Value of Memory update must be either Custom or IntegerTcpuV1Reconfiguring The Virtual Machine For CPU Update 
 XYPsetCpuAllocation[4Value of CPU update must be either Custom or Integer]disk_2Reconfiguring The Virtual Machine For Disk Update 
abcgetDiskDeviceConfigSpecP(Lcom/vmware/vim25/mo/VirtualMachine;)Lcom/vmware/vim25/VirtualDeviceConfigSpec;e(com/vmware/vim25/VirtualDeviceConfigSpec
 ghisetDeviceChange.([Lcom/vmware/vim25/VirtualDeviceConfigSpec;)Vknicm1Reconfiguring The Virtual Machine For NIC Update 
opcgetNICDeviceConfigSpecrcdt0Reconfiguring The Virtual Machine For CD Update 
vwcgetCDDeviceConfigSpecy,Invlaid device type [memory|cpu|disk|nic|cd]
{}|"com/vmware/vim25/mo/VirtualMachine~reconfigVM_TaskG(Lcom/vmware/vim25/VirtualMachineConfigSpec;)Lcom/vmware/vim25/mo/Task;
???com/vmware/vim25/mo/Task?A	waitForMe?java/lang/NumberFormatExceptionvm$Lcom/vmware/vim25/mo/VirtualMachine;
deviceTypeLjava/lang/String;vmConfigSpec+Lcom/vmware/vim25/VirtualMachineConfigSpec;nfe!Ljava/lang/NumberFormatException;	vdiskSpec*Lcom/vmware/vim25/VirtualDeviceConfigSpec;vdiskSpecArray+[Lcom/vmware/vim25/VirtualDeviceConfigSpec;nicSpecnicSpecArraycdSpeccdSpecArraytaskLcom/vmware/vim25/mo/Task;
StackMapTable?	operation
d
{???	getConfig-()Lcom/vmware/vim25/VirtualMachineConfigInfo;?Add	???1com/vmware/vim25/VirtualDeviceConfigSpecOperation??add3Lcom/vmware/vim25/VirtualDeviceConfigSpecOperation;
d???setOperation6(Lcom/vmware/vim25/VirtualDeviceConfigSpecOperation;)V?com/vmware/vim25/VirtualCdrom
??+com/vmware/vim25/VirtualCdromIsoBackingInfo
?
???getDataStoreSummaryI(Lcom/vmware/vim25/mo/VirtualMachine;)Lcom/vmware/vim25/DatastoreSummary;
???!com/vmware/vim25/DatastoreSummary??getDatastore+()Lcom/vmware/vim25/ManagedObjectReference;
????setDatastore,(Lcom/vmware/vim25/ManagedObjectReference;)V?[
???AgetName?] ?/?.iso
???7setFileName
???getIDEControllerF(Lcom/vmware/vim25/mo/VirtualMachine;)Lcom/vmware/vim25/VirtualDevice;
????
setBacking.(Lcom/vmware/vim25/VirtualDeviceBackingInfo;)V
???com/vmware/vim25/VirtualDevice??getKey()I
???java/lang/Integer??valueOf(I)Ljava/lang/Integer;
????setControllerKey(Ljava/lang/Integer;)V
????
getUnitNumber()Ljava/lang/Integer;
????
setUnitNumber
????setKey(I)V
d???	setDevice#(Lcom/vmware/vim25/VirtualDevice;)V
???)com/vmware/vim25/VirtualMachineConfigInfo??getHardware$()Lcom/vmware/vim25/VirtualHardware;
??? com/vmware/vim25/VirtualHardware	getDevice#()[Lcom/vmware/vim25/VirtualDevice;	??remove
?
getDeviceInfo ()Lcom/vmware/vim25/Description;

com/vmware/vim25/Description
AgetLabelNo device available opsvmConfigInfo+Lcom/vmware/vim25/VirtualMachineConfigInfo;cdromLcom/vmware/vim25/VirtualCdrom;cdDeviceBacking-Lcom/vmware/vim25/VirtualCdromIsoBackingInfo;dsum#Lcom/vmware/vim25/DatastoreSummary;vd Lcom/vmware/vim25/VirtualDevice;cdRemovetest![Lcom/vmware/vim25/VirtualDevice;kI
{"#$
getRuntime.()Lcom/vmware/vim25/VirtualMachineRuntimeInfo;
{&'(getEnvironmentBrowser*()Lcom/vmware/vim25/mo/EnvironmentBrowser;
*,+*com/vmware/vim25/VirtualMachineRuntimeInfo-?getHost/com/vmware/vim25/mo/HostSystem
{123getServerConnection(()Lcom/vmware/vim25/mo/ServerConnection;
.56R(Lcom/vmware/vim25/mo/ServerConnection;Lcom/vmware/vim25/ManagedObjectReference;)V
8:9&com/vmware/vim25/mo/EnvironmentBrowser;<queryConfigTargetA(Lcom/vmware/vim25/mo/HostSystem;)Lcom/vmware/vim25/ConfigTarget;
>@?com/vmware/vim25/ConfigTarget?A1()[Lcom/vmware/vim25/VirtualMachineDatastoreInfo;
CED,com/vmware/vim25/VirtualMachineDatastoreInfo?F%()Lcom/vmware/vim25/DatastoreSummary;
?HIJisAccessible()ZLNo Datastore founddsSum
vmRuntimeInfo,Lcom/vmware/vim25/VirtualMachineRuntimeInfo;
envBrowser(Lcom/vmware/vim25/mo/EnvironmentBrowser;hmor)Lcom/vmware/vim25/ManagedObjectReference;configTargetLcom/vmware/vim25/ConfigTarget;ivdsInfo.Lcom/vmware/vim25/VirtualMachineDatastoreInfo;	dsSummary['com/vmware/vim25/ManagedObjectReference
]^_getDefaultDevicesG(Lcom/vmware/vim25/mo/VirtualMachine;)[Lcom/vmware/vim25/VirtualDevice;a%com/vmware/vim25/VirtualIDEControllerideCtlrdefaultDevices
8efgqueryConfigOptiona(Ljava/lang/String;Lcom/vmware/vim25/mo/HostSystem;)Lcom/vmware/vim25/VirtualMachineConfigOption;i/No VirtualHardwareInfo found in ComputeResource
6
lnm+com/vmware/vim25/VirtualMachineConfigOptionogetDefaultDeviceq%No Datastore found in ComputeResourcecfgOpt-Lcom/vmware/vim25/VirtualMachineConfigOption;defaultDevs
vwxgetNetworkName8(Lcom/vmware/vim25/mo/VirtualMachine;)Ljava/lang/String;zcom/vmware/vim25/VirtualPCNet32
y}6com/vmware/vim25/VirtualEthernetCardNetworkBackingInfo
|
|??7
setDeviceName?	generated
???$com/vmware/vim25/VirtualEthernetCard?7setAddressType
??
???RemovenetworkName&Lcom/vmware/vim25/VirtualEthernetCard;
nicBacking8Lcom/vmware/vim25/VirtualEthernetCardNetworkBackingInfo;
>???
getNetwork/()[Lcom/vmware/vim25/VirtualMachineNetworkInfo;
???*com/vmware/vim25/VirtualMachineNetworkInfo??#()Lcom/vmware/vim25/NetworkSummary;
?H?com/vmware/vim25/NetworkSummary
??? Specify the Correct Network Name?
network Name ?%No Host is responsible to run this VMnetInfo,Lcom/vmware/vim25/VirtualMachineNetworkInfo;
netSummary!Lcom/vmware/vim25/NetworkSummary;?com/vmware/vim25/VirtualDisk
??/com/vmware/vim25/VirtualDiskFlatVer2BackingInfo
??disksize
????parseInt(Ljava/lang/String;)I
???getDataStoreName9(Lcom/vmware/vim25/mo/VirtualMachine;I)Ljava/lang/String;?SCSI Controller 0?.vmdk
???diskmode
???7setDiskMode
??
??
??
????setCapacityInKB(J)V
??	???5com/vmware/vim25/VirtualDeviceConfigSpecFileOperation??create7Lcom/vmware/vim25/VirtualDeviceConfigSpecFileOperation;
d???setFileOperation:(Lcom/vmware/vim25/VirtualDeviceConfigSpecFileOperation;)V	????destroy?No device found diskSpecLcom/vmware/vim25/VirtualDisk;diskfileBacking1Lcom/vmware/vim25/VirtualDiskFlatVer2BackingInfo;dsNameckey
unitNumberfileNamesize
{???
getDatastores"()[Lcom/vmware/vim25/mo/Datastore;
???com/vmware/vim25/mo/Datastore?F
getSummary
????getFreeSpace()J
datastores [Lcom/vmware/vim25/mo/Datastore;ds??'com/vmware/vim25/ResourceAllocationInfo
??com/vmware/vim25/SharesInfo
?
???com/vmware/vim25/SharesLevel??2(Ljava/lang/String;)Lcom/vmware/vim25/SharesLevel;	??highLcom/vmware/vim25/SharesLevel;	?normal	?low
?	
setLevel!(Lcom/vmware/vim25/SharesLevel;)V	?
custom
??	setShares
? (Lcom/vmware/vim25/SharesInfo;)VvalraInfo)Lcom/vmware/vim25/ResourceAllocationInfo;
sharesInfoLcom/vmware/vim25/SharesInfo;slcustomValidation/(Lcom/vmware/vim25/mo/util/CommandLineParser;)Z
*
option_is_set!JFor update disk operation, disksize and diskmode are the Mandatory options#1For update nic operation is the Mandatory options%0For update cd operation is the Mandatory options'1CPU and Memory shares must be a greater than zero)$Disksize must be a greater than zero?-&Operation must be either add or removeflagZconstructOptions(()[Lcom/vmware/vim25/mo/util/OptionSpec;3#com/vmware/vim25/mo/util/OptionSpec5String7Name of the virtual machine
29:L(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V<'Type of device {cpu|memory|disk|cd|nic}>{add|remove}@D{numeric(For Memory and CPU high|low|normal|numeric value)|deviceId}BIntegerDSize of virtual diskF={persistent|independent_persistent,independent_nonpersistent}useroptions&[Lcom/vmware/vim25/mo/util/OptionSpec;main([Ljava/lang/String;)V
L01
NO<([Lcom/vmware/vim25/mo/util/OptionSpec;[Ljava/lang/String;)VQurlSusernameUpasswordW#com/vmware/vim25/mo/ServiceInstanceYjava/net/URL
X6
V\]6(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;Z)V
V_`a
getRootFolder()Lcom/vmware/vim25/mo/Folder;c&com/vmware/vim25/mo/InventoryNavigator
bef&(Lcom/vmware/vim25/mo/ManagedEntity;)VhVirtualMachine
bjklsearchManagedEntityI(Ljava/lang/String;Ljava/lang/String;)Lcom/vmware/vim25/mo/ManagedEntity;
n
prVirtual Machine t
 Not Foundargs[Ljava/lang/String;urlStrsi%Lcom/vmware/vim25/mo/ServiceInstance;
rootFolderLcom/vmware/vim25/mo/Folder;validvcom/vmware/vim25/mo/Folder
SourceFileVMReconfig.java!	)?
?
JH
	/*??H

	?p*?M? Y?"N,#?%?9?+?1Y3?5*8??:?>?B-*G??I?M?":?+Q?B?,S?%?9?+?1YU?5*8??:?>?B-*G??I?W??:?+Z?B?,\?%?>?+?1Y^?5*8??:?>?B+?`:??dYS:-?f???,j?%?>?+?1Yl?5*8??:?>?B+?n:??dYS:-?f?Q?,q?%?>?+?1Ys?5*8??:?>?B+?u:??dYS:-?f?
??+x?B?+-?z:??W?3@C?r???(NOQS3VCXEZM[N^W`rc?e?g?h?k?m?n?o?q?r?v?y?{?|?}????9???D?O?X?Y?a?b?i?o?
?
pp??i??a??E	???	??????	?????	?????O	??i???:?C{& ?
s?
?Bd??Bd??Bd?
wc	[/?
??L?dY??M*??N+??%??,??????Y??:??Y??:*??:?????1Y??5?ö:ƶ:?
8??:ȶ:?
G??:ʶ:?>??*??:???׸ݶ??????,??,?:-????:,???6?)2??	?
G??%?
2??:??????,??#?+?1Y?5?
G??:?>?B?,?~?	????&?/?8?>?H?k??????????????????????????????????
?+?-?
p/??	&???/?8?>z?,?r?i?1? ??&d??? "??
??	V	rL*?!M*?%N,?):?S-?.Y*?0?4?7:?=?66?%?=2:?B:?G?	L???=????+??+K?B?F??????*?2?8?B?I?Q?T?W?e?g?p?
\	r??pMkNOfPQ`RS*=TU50VBWXIY?$?8{?*8Z>?
?
??	?'L*?\M>?,2?`?
,2L??,????+?"???????%?
*'??%b c	V??? ?
^_	?R*?!L*?%M+?)N,?.Y*?0-?4?d:? :??Yh?j??k:??Yp?j??.
"
(-8?DO
>R??MNO
HPQCRS"0rs(*t??8{*8Zl 
pc	?
??L?dY??M*??N+??%?N*?u:?A,?????yY?{:?|Y?~:????????,????+??%?x:-????:,???6?)2??	?
G??%?
2??:??????,??#?+?1Y?5?
G??:?>?B?,?r	 "$%%*'1(:)C*J+R,Y-_.h2j5t7w8?9?:?<?>?:?A?C?G?H?K
f
???	??????%E??:.k?C%??wrk??i?1?-?h{&d?&??"? "??
wx	?	?L*?!M*?%N,?):??-?.Y*?0?4?7:???[6?;??2:??:??????
G??%???L????????+??+??B??+?1Y??5+?:?>?B+??+??B?ZPQSTVX*Y2[8]B^I_Qadcjdm[{hj?k?n?o?s?t
\	???????NO?PQ?RS*yTU5FVB+??I$???%?8{&*8Z>4?
?
bc	a??
??L?dY??M*??N+??%???Y??:??Y??:*?
??????:66-????:	6
?$	
2??	??%?
	
2??6?

	????	?`6?1Y??5?:ƶ:?
8??:ȶ:?
G??:??:?>:

???
?????ݶ??ݶ????
????h6?????,????,?ʶ?,???+??%?:-????:6?)2??	?
G??%?
2??:??????,???,?Զ?,??#?+?1Y׷5?
G??:?>?B?,??)z	{|~?(?1?C?F?I?R?X?l?v??????????????????????(?2?5?>?D?]?g?r?w?~?????????
????	??????(]?1???C???F??I??R?	U,
?g??
%?5y]?>pA1?K	?X{&d???& ??{&d??? "?#?
??	?6M*??N6?#-2??:???????M?
?-????,?&	???
??!?'?*?4?
>6??6?4??/??
*V???
&??
KL	?H??Y??L??Y??M*??N-???-??
-??,-??,??,*???+,?+?&	????*?2?9?A?F?
*H?@83??*???
	??<*?M,\?%?+*???*???
*????+ ?B<,j?%?*????+"?B<,q?%?*????+$?B<,S?%?,#?%?*G?????+&?B<,\?%?*??????+(?B<*???,*??*?%?*??+?%??+,?B<?v??	??%?/?8?:?C?L?U?W?`?i?r?t?????????????????????

 ??./	????/&
 1
01	?	??2K*?2Y846?8S*?2Y4;?8S*?2Y?4=?8S*?2YG4??8S*?2Y?AC?8S*?2Y?4E?8S*?V&-.:ABNUVcjkx{?
|GH	IJ	w	??Y?K*?M?
?
P?L?
R?M?
T?N?
8?:?VY?XY+?Z,-?[:?^:?bY?dg?i?{:?
?m6??
?o?'?+?1Yq?5?
8??:s?:?>?B?6
$%&"',(6)J+Q,g.o/t15?7
\	?uv?w?"?S?,xU?6n9?JZxyQSz{g=??o5|/?#?	}&&&&V~{#??




© 2015 - 2024 Weber Informatics LLC | Privacy Policy