Package com.vmware.storage
Class SDRSRules
- java.lang.Object
-
- com.vmware.connection.ConnectedVimServiceBase
-
- com.vmware.storage.SDRSRules
-
@Sample(name="sdrs-rules", description="This sample demonstrates how to Add/List/Modify/Delete the rules for an\nexisting SDRS cluster.") public class SDRSRules extends ConnectedVimServiceBaseThis sample demonstrates how to Add/List/Modify/Delete the rules for an existing SDRS cluster. Parameters: url [required]: url of the web service. username [required]: username for the authentication Password [required]: password for the authentication podname [required]: StoragePod name. option [required]: valid option are "addVmAntiAffinity", "addVmdkAntiAffinity", "list", "modifyVmAntiAffinity", "modifyVmdkAntiAffinity", "deleteVmAntiAffinity" and "deleteVmdkAntiAffinity". rulename Rule name. vmlist Comma separated, list of VM name. It is required while adding VmAntiAffinity Rule. newrulename New name for rule while modifying enable Flag to indicate whether or not the rule is enabled. vmname virtual machine name. Sample usage: addVmAntiAffinity Rule: run.bat com.vmware.storage.SDRSRules --url [URLString] --username [User] --password [Password] --option addVmAntiAffinity --podname [podname] --rulename [rulename] --enable [enable] --vmlist [vmlist] addVmdkAntiAffinity Rule: run.bat com.vmware.storage.SDRSRules --url [URLString] --username [User] --password [Password] --option addVmdkAntiAffinity --podname [podname] --rulename [rulename] --enable [enable] --vmname [vmname] List Rules: run.bat com.vmware.storage.SDRSRules --url [URLString] --username [User] --password [Password] --option list --podname [podname] modifyVmAntiAffinity Rule: run.bat com.vmware.storage.SDRSRules --url [URLString] --username [User] --password [Password] --option modifyVmAntiAffinity --podname [podname] --rulename [rulename] --enable [enable] --vmname [vmname] --newrulename [newrulename] modifyVmdkAntiAffinity Rule: run.bat com.vmware.storage.SDRSRules --url [URLString] --username [User] --password [Password] --option modifyVmdkAntiAffinity --podname [podname] --rulename [rulename] --enable [enable] --newrulename [newrulename] deleteVmAntiAffinity Rule: run.bat com.vmware.storage.SDRSRules --url [URLString] --username [User] --password [Password] --option deleteVmAntiAffinity --podname [podname] --rulename [rulename] deleteVmdkAntiAffinity Rule: run.bat com.vmware.storage.SDRSRules --url [URLString] --username [User] --password [Password] --option deleteVmdkAntiAffinity --podname [podname] --rulename [rulename] NOTE: All the virtual disks will be added while adding Vmdk AntiAffinity Rule. A minimum of 2 disks should be present in the VM for this rule. The VMs should be present in a datastore which is part of the POD.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vmware.connection.ConnectedVimServiceBase
ConnectedVimServiceBase.ConnectionException
-
-
Field Summary
-
Fields inherited from class com.vmware.connection.ConnectedVimServiceBase
PROP_ME_NAME, SVC_INST_NAME
-
-
Constructor Summary
Constructors Constructor Description SDRSRules()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()voidsetEnabled(java.lang.String enable)voidsetNewRuleName(java.lang.String newName)voidsetOption(java.lang.String opt)voidsetPodName(java.lang.String podName)voidsetRuleName(java.lang.String name)voidsetVmList(java.lang.String list)voidsetVmName(java.lang.String name)-
Methods inherited from class com.vmware.connection.ConnectedVimServiceBase
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection
-
-
-
-
Method Detail
-
setPodName
@Option(name="podname", description="StoragePod name.") public void setPodName(java.lang.String podName)
-
setOption
@Option(name="option", description="valid option are: \"addVmAntiAffinity\",\n\"addVmdkAntiAffinity\", \"list\", \"modifyVmAntiAffinity\",\n\"modifyVmdkAntiAffinity\", \"deleteVmAntiAffinity\" and\n\"deleteVmdkAntiAffinity\".") public void setOption(java.lang.String opt)
-
setRuleName
@Option(name="rulename", required=false, description="Rule name.") public void setRuleName(java.lang.String name)
-
setVmList
@Option(name="vmlist", required=false, description="Comma separated,\nlist of VM name. It is required while\nadding VmAntiAffinity Rule.") public void setVmList(java.lang.String list)
-
setNewRuleName
@Option(name="newrulename", required=false, description="New name for rule while modifying") public void setNewRuleName(java.lang.String newName)
-
setEnabled
@Option(name="enable", required=false, description="Flag to indicate whether or not the rule is enabled.") public void setEnabled(java.lang.String enable)
-
setVmName
@Option(name="vmname", required=false, description="virtual machine name.") public void setVmName(java.lang.String name)
-
run
@Action public void run() throws java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsg, com.vmware.vim25.InvalidCollectorVersionFaultMsg, java.rmi.RemoteException, jakarta.xml.soap.SOAPException- Throws:
java.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptioncom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgjava.rmi.RemoteExceptionjakarta.xml.soap.SOAPException
-
-