HewlettPackard / python-ilorest-library

Python library for interacting with devices which support a Redfish Service
Apache License 2.0
181 stars 89 forks source link

ilorest tool: how to change/disable IPv6 on dedicated ILO interface? #127

Closed ralfgro closed 2 years ago

ralfgro commented 2 years ago

I've tried this now for several hours with no luck. As we don't use IPv6 and also no DHCP, I set a static IPv4 address. But I can't add a domain name as long as DHCPv6 is enabled. So I want to disable it (in the example below I tried to enable it again as I disabled it in GUI).

It seems the changes are only applied to the shared network port, not the dedicated.

iLOrest > set Oem/Hpe/DHCPv6/StatelessModeEnabled=True --filter="@odata.id=/redfish/v1/Managers/1/EthernetInterfaces/1/"
Added the following patch:
{
  "Oem/Hpe/DHCPv6/StatelessModeEnabled": true
}
iLOrest > commit
Committing changes...

Error: No changes found or made during commit operation.

iLOrest > set Oem/Hpe/DHCPv6/StatefulModeEnabled=True --filter="@odata.id=/redfish/v1/Managers/1/EthernetInterfaces/1/"
Added the following patch:
{
  "Oem/Hpe/DHCPv6/StatefulModeEnabled": true
}
iLOrest > commit
Committing changes...

Error: No changes found or made during commit operation.

iLOrest > pending
Current Pending Changes:

HpeServerBootSettings.v2_0_0:
No pending changes found.

HpeiSCSISoftwareInitiator.v2_0_0:
No pending changes found.

HpeKmsConfig.v1_0_0:
No pending changes found.

HpeServerConfigLock.v1_0_0:
No pending changes found.

Bios.v1_0_0:
No pending changes found.

HpeTlsConfig.v1_0_0:
No pending changes found.

iLOrest >  get Oem/Hpe/DHCPv6 --filter="@odata.id=/redfish/v1/Managers/1/EthernetInterfaces/1/"
Oem=
     Hpe=
          DHCPv6=
                  StatefulModeEnabled=False
                  StatelessModeEnabled=False
                  UseDNSServers=True
                  UseDomainName=True
                  UseNTPServers=False
                  UseRapidCommit=False

Same for adding domain name.

iLOrest > set oem/Hpe/DomainName="mydomain.xxx" --filter="@odata.id=/redfish/v1/Managers/1/EthernetInterfaces/1/"
Added the following patch:
{
  "Oem/Hpe/DomainName": "mydomain.xxx"
}
iLOrest > commit
Committing changes...

Error: No changes found or made during commit operation.
iLOrest > get oem/Hpe/DomainName

Oem=
     Hpe=
          DomainName=""

Oem=
     Hpe=
          DomainName=mydomain.xxx

rawpatch seems to work better. With a json file and the same content I use with ilorest "set" command I get the expected output. But I'd like to avoid using a json file, doing this with ilorest set command would be much more useful in Ansible.

iLOrest > rawpatch domain.json
{
  "/redfish/v1/Managers/1/EthernetInterfaces/1":
  {
  "Oem": {
    "Hpe": {
         "DomainName": "mydomain.xxx"
      }
    }
  }
}

# ilorest --nologo get oem/Hpe/DomainName --select=EthernetInterface.v1_4_1.EthernetInterface --filter=Name="Manager Dedicated Network Interface"   --url=https://kdev1011 --user Administrator --password password
Discovering data...Done
Oem=
     Hpe=
          DomainName=mydomain.xxx
rajeevkallur commented 2 years ago

@ralfgro , We will this item in next development cycle. Closing this for now.