osimages hostsettings
This command retrieves information about network and storage settings for all servers, and creates and modifies network and storage settings for one or more servers.
Syntax
osimages hostsettings -h
osimages hostsettings [-a <action> -o <settings_JSON>] [-v <filter>]
Options
- {-h | --help}
- Displays the syntax and brief usage information for this command.
- {-a | --action} <action>
- Specifies the action to perform. This can be one of the following values.
create. Creates host settings for a specific host platform.
update. Modifies host settings for a specific host platform.
delete. Deletes host settings for a specific host platform
If no action is specified, this command returns information about all host (global and storage) settings.
- {-o | --osimages_dict} <settings_JSON>
- Specifies the host settings for each host platform, in JSON format. You must specify this parameter to create, modify, or delete host settings
Table 1. Delete host settings Parameters Required / Optional Type Description uuid Required String UUID of the host platform Table 2. Create or update host settings. Parameters Required / Optional Type Description hosts Required Array of objects Information about the host settings for each host platform. networkSettings Optional Object Information about network settings dns1 Optional String Preferred DNS server for the host server to be used after the operating system is deployed dns2 Optional String Alternative DNS server for the host server to be used after the operating system is deployed gateway Optional String Gateway of the host server to be used after the operating system is deployed. This is used when the network setting is set to static in the Global OS deployment settings. TipTo determine the IP mode, useosimages globalsettings. hostname Optional String Hostname for the host server. If a hostname is not specified, a default hostname is assigned. ipAddress Optional String IP address of the host server to be used after the operating system is deployed. This is used when the network setting is set to static in the Global OS deployment settings. mtu Optional Long Maximum transmission unit for the host to be used after the operating system is deployed prefixLength Optional String Prefix length of the host IP address to be used after the operating system is deployed. This is used when the network setting is set to static IPv6 in the Global OS deployment settings. selectedMAC Optional String MAC address of the host server to which the IP address is to be bound The MAC address is set to AUTO by default. This setting automatically detects the Ethernet ports that can be configured and used for deployment. The first MAC address (port) that is detected is used by default. If connectivity is detected on a different MAC address, the XClarity Administrator host is automatically restarted to use the newly detected MAC address for deployment, and selectedMAC is set to the newly detected MAC address.
VLAN mode is supported only for servers that have MAC addresses in their inventory. If AUTO is the only the MAC address that is available for a server, then VLANs cannot be used to deploy operating systems to that server.
TipTo obtain the MAC address, use themacaddress value field in osimages hostplatforms. subnetMask Optional String Subnet mask of the host server to be used after the operating system is deployed. This is used when the network setting is set to static in the Global OS deployment settings. TipTo determine the IP mode, useosimages globalsettings. vlanId Optional String VLAN ID for operating-system VLAN tagging This parameter is valid only if in VLAN mode is enabled (see osimages globalsettings).
ImportantOnly specify a VLAN ID when a VLAN tag is required to function on the network. Using VLAN tags can affect the network routability between the host operating system and theLenovo XClarity Administrator. storageSettings Optional Object Preferred storage location on which you want to deploy operating-system images targetDevice Optional String Target device. This can be one of the following values. - localdisk. Local disk drive. The first enumerated local disk drive in the managed server is used.
- M.2drive. M.2 drive. The first enumerated M.2 drive in the managed server is used.
- usbdisk. Embedded USB Hypervisor. This location is applicable only when a VMware ESXi image is being deployed to managed servers. If two hypervisor keys are installed on the managed server, the VMware installer selects the first enumerated key for deployment.
- lunpluswwn=LUN@WWN. FC SAN storage (for example, lunpluswwn=2@50:05:07:68:05:0c:09:bb).
- lunplusiqn=LUN@IQN. iSCSI SAN Storage (for example, lunplusiqn=0@iqn.1990-01.com.lenovo:tgt1). Specifying the IQN is optional if only one iSCSI target is configured If the IQN is not specified, the first detected iSCSI target is selected for OSDN. If specified, and exact match is made.
NoteFor ThinkServer servers, this value is alwayslocaldisk.
uuid Required String UUID of the host platform For example,
{
"hosts": [{
"networkSettings": {
"dns2": "",
"dns1": "10.240.0.10",
"gateway": "10.243.0.1",
"hostname": "nodeundefined",
"ipAddress": "10.243.27.27",
"mtu": 1500,
"prefixLength": 64,
"selectedMAC": "AUTO",
"subnetMask": "255.255.240.0",
"vlanId": 0
},
"storageSettings": {
"targetDevice": "localdisk"
},
"uuid": "A1445C6FDBAA11E6A87F86E06E3ACCCC"
}]
} - {-v | --view} <filter>
- Identifies the view to use for the returned data. If a filter is not specified, the default view is used.
You can also create custom views (see Creating custom views).
Examples
The following example returns information about all host settings.
connect --url https://192.0.2.0 --user ADMIN --noverify
osimages hostsettings -v hostsettings
The following example creates host settings for a specific host platform.
connect --url https://192.0.2.0 --user ADMIN --noverify
osimages hostsetttings --action create ' -v result
-o '{"hosts": [{"networkSettings": {"dns2": "", "dns1": "10.240.0.10",
"gateway": "10.243.0.1", "hostname": "nodeundefined",
"ipAddress": "10.243.27.27", "mtu": 1500, "prefixLength": 64,
"selectedMAC": "AUTO", "subnetMask": "255.255.240.0", "vlanId": 0},
"storageSettings": {"targetDevice": "localdisk"},
"uuid": "A1445C6FDBAA11E6A87F86E06E3ACCCC"}]}
The following example modifies host settings for a specific host platform.
connect --url https://192.0.2.0 --user ADMIN --noverify
osimages hostsetttings --action update --update True -v result
-o '{{"hosts": [{"storageSettings": {"targetDevice": "localdisk"},
"networkSettings": {"dns2": "", "dns1": "10.240.0.10", "hostname": "nodeundefined",
"vlanId": 0, "selectedMAC": "AUTO", "gateway": "10.243.0.1",
"subnetMask": "255.255.240.0", "mt": 1500, "prefixLength": 64,
"ipAddress": "10.243.27.27"}, "uuid": "A1445C6FDBAA11E6A87F86E06E3ACCCC"}]}'
The following example deletes host settings for a host platform.
connect --url https://192.0.2.0 --user ADMIN --noverify
osimages hostsettings --action delete -v result
-o '{\"uuid\": \"A1445C6FDBAA11E6A87F86E06E3AFFFF\"}'