HPE OneView
1826230 Members
4899 Online
109692 Solutions
New Discussion

OneView configure second interface in DHCP.

 
linuxteam-belgi
Senior Member

OneView configure second interface in DHCP.

Hello,

I am trying to configure a second network interface in the oneview appliance. I read this can be achieved only via the rest api, is it true?

I am trying to run the following python code but I receive an error : "hpeOneView.exceptions.HPEOneViewTaskError: A appliance-2 IPv4 host name is required for DHCP configuration."

#!/usr/bin/python3

import logging
import sys
import getpass

from pprint import pprint
from hpeOneView.oneview_client import OneViewClient
from hpeOneView.exceptions import HPEOneViewException

# Default credentials to login to oneview
if sys.stdin.isatty():
print("Enter credentials")
USERNAME = input("Username: ")
PASSWORD = getpass.getpass("Password: ")
else:
USERNAME = sys.stdin.readline().rstrip()
PASSWORD = sys.stdin.readline().rstrip()

CONFIG = {
"api_version": 6000,
"ip": "<OneViewIP>",
"credentials": {
"userName": USERNAME,
"password": PASSWORD
}
}

# Initiate a connection to the appliance and instanciate a new OneViewClient class object
ONEVIEW_CLIENT = OneViewClient(CONFIG)
network_interface = ONEVIEW_CLIENT.appliance_network_interfaces

updated_details = {"applianceNetworks": [{
"hostname": "<oneviewHostname>",
"networkLabel":"ILOnetwork",
"interfaceName": "ILOnetwork",
"device": "eth1",
"macAddress": "<MACaddress>",
"ipv4Type": "DHCP"
}]}
updated_network_interface = network_interface.create(updated_details)
pprint(updated_network_interface.data)
print("\nNetwork Interface updated successfully")

 

Could you help finding what is going wrong?

Thank you in advance...

3 REPLIES 3
shiva_jr
HPE Pro

Re: OneView configure second interface in DHCP.

Hi linuxteam-belgi,

    Yes, you heard right. Configuration of the secondary NIC is supported only through the REST API. 
    For 2nd NIC configuration, you need to retrieve the network settings first, then configure the secondary NIC using the following NIC REST API.
    Please refer the link for more information on configuration. Hope it gives solution for you.

Regards,
Shiva_JR
Please mark as 'Accepted solution' and thumbs up with Kudos if my post worked
    



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
ManBha
HPE Pro

Re: OneView configure second interface in DHCP.

Hello,

I agree with the above information.
Please do let us know if a case is logged.

Thanks,

I work for HPE.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

Accept or Kudo

shiva_jr
HPE Pro

Re: OneView configure second interface in DHCP.

Hi @linuxteam-belgi 
Is this issue resolved? Any help required ?
Regards,
Shiva_JR



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo