@Sample(name="nico-for-dvs",
description="demonstrates how to add/modify NetworkResourcePool to Distributed Virtual Switch")
public class NIOCForDVS
extends ConnectedVimServiceBase
This sample demonstrates how to add/modify NetworkResourcePool to Distributed
Virtual Switch:
Parameters:
url [required]: url of the web service.
username [required]: username for authentication
Password [required]: password for authentication
option [required]:
"enablenioc" for enabling network I/O control
"addnrp" for adding Network Resource Pool
"listnrp" for Listing existing DVSNetworkResourcePool
"modifynrp" for reconfiguring NetworkResourcePool
"nrptoportgroup" for adding NetworkResourcePool key to DVS Port Group
dvsname [required]: Distributed Virtual Switch name
enablenioc : If true, enables I/O control. If false, disables network I/O control
nrpsharelevel : The allocation level. The level is a simplified view of shares.
Levels map to a pre-determined set of numeric values for shares. If the
Shares value does not map to a predefined size, then the level is set as custom.
nrphostlimit : Numeric value: The maximum allowed usage for network clients
belonging to this resource pool per host.
nrpprioritytag : Numeric value: The 802.1p tag to be used for this resource pool.
Its value should be between 0-7
nrpname : The user defined name for the resource pool.
nrpdesc : [optional] The user defined description for the resource pool.
dvpgname : The name of the portgroup.
Sample usage:
Enable Network I/O Control:
run.bat com.vmware.host.NIOCForDVS --url [URLString] --username [User] --password [Password]
--option enablenioc --dvsname [dvsname] --enablenioc [enablenioc]
Add NetworkResourcePool:
run.bat com.vmware.host.NIOCForDVS --url [URLString] --username [User] --password [Password]
--option addnrp --dvsname [dvsname] --nrpsharelevel [nrpsharelevel] --nrphostlimit [nrphostlimit]
--nrpprioritytag [nrpprioritytag] --nrpname [nrpname] --nrpdesc [nrpdesc]
List NetworkResourcePool:
run.bat com.vmware.host.NIOCForDVS --url [URLString] --username [User] --password [Password]
--option listnrp --dvsname [dvsname]
Reconfiguring NetworkResourcePool:
run.bat com.vmware.host.NIOCForDVS --url [URLString] --username [User] --password [Password]
--option modifynrp --dvsname [dvsname] --nrpsharelevel [nrpsharelevel] --nrphostlimit [nrphostlimit]
--nrpprioritytag [nrpprioritytag] --nrpname [nrpname]
Associate DVS Port Group to NetworkResourcePool :
run.bat com.vmware.host.NIOCForDVS --url [URLString] --username [User] --password [Password]
--option nrptoportgroup --dvsname [dvsname] --nrpname [nrpname] --dvpgname [dvpgname]
Note: Sample only works for DVS 5.0 onwards.
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
NIOCForDVS() |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setDvPGName(java.lang.String dvPGName) |
void |
setDvsname(java.lang.String dvsname) |
void |
setEnableNIOC(java.lang.String enableNIOC) |
void |
setHostLimit(java.lang.String hostLimit) |
void |
setNrpAllocationShareLevel(java.lang.String nrpAllocationShareLevel) |
void |
setNrpDesc(java.lang.String nrpDesc) |
void |
setNrpName(java.lang.String nrpName) |
void |
setOption(java.lang.String option) |
void |
setPrioritytag(java.lang.String prioritytag) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="option",
description="\n\t\"enablenioc\" for enabling network I/O control\n\t\"addnrp\" for adding Network Resource Pool\n\t\"listnrp\" for Listing existing DVSNetworkResourcePool\n\t\"modifynrp\" for reconfiguring NetworkResourcePool\n\t\"nrptoportgroup\" for adding NetworkResourcePool key to DVS Port Group\n")
public void setOption(java.lang.String option)
@Option(name="dvsname",
description="Distributed Virtual Switch name")
public void setDvsname(java.lang.String dvsname)
@Option(name="enablenioc",
required=false,
description="If true, enables I/O control. If false, disables network I/O control")
public void setEnableNIOC(java.lang.String enableNIOC)
@Option(name="nrpsharelevel",
required=false,
description="high, normal, low or numeric\n\tThe allocation level. The level is a simplified view of shares.\n\tLevels map to a pre-determined set of numeric values for shares. If the\n\tShares value does not map to a predefined size, then the level is set as custom.\n")
public void setNrpAllocationShareLevel(java.lang.String nrpAllocationShareLevel)
@Option(name="nrphostlimit",
required=false,
description="\n\tNumeric value: The maximum allowed usage for network clients\n\tbelonging to this resource pool per host.\n")
public void setHostLimit(java.lang.String hostLimit)
@Option(name="nrpprioritytag",
required=false,
description="\n\tNumeric value: The 802.1p tag to be used for this resource pool.\n\tIts value should be between 0-7\n")
public void setPrioritytag(java.lang.String prioritytag)
@Option(name="nrpname",
required=false,
description="The user defined name for the resource pool.")
public void setNrpName(java.lang.String nrpName)
@Option(name="nrpdesc",
required=false,
description="The user defined description for the resource pool.")
public void setNrpDesc(java.lang.String nrpDesc)
@Option(name="dvpgname",
required=false,
description="The name of the portgroup.")
public void setDvPGName(java.lang.String dvPGName)
@Action
public void run()
throws com.vmware.vim25.InvalidPropertyFaultMsg,
com.vmware.vim25.DvsFaultFaultMsg,
com.vmware.vim25.InvalidNameFaultMsg,
com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.NotFoundFaultMsg,
com.vmware.vim25.ConcurrentAccessFaultMsg,
com.vmware.vim25.DuplicateNameFaultMsg,
com.vmware.vim25.InvalidCollectorVersionFaultMsg,
java.rmi.RemoteException
com.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.DvsFaultFaultMsgcom.vmware.vim25.InvalidNameFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.NotFoundFaultMsgcom.vmware.vim25.ConcurrentAccessFaultMsgcom.vmware.vim25.DuplicateNameFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgjava.rmi.RemoteException