[ovirt-users] [Python SDK] Setup Host network with IP address

TranceWorldLogic . tranceworldlogic at gmail.com
Fri Mar 24 04:42:01 UTC 2017


Hi,

I am trying to setup network via python sdk as shown below:

myhost_service.setup_networks( modified_network_attachments = [
                                    types.NetworkAttachment(
                                        host = myhost,
                                        host_nic =
types.HostNic(name="eth0"),
                                        network =
types.Network(name="Hello"),
                                        ip_address_assignments = [
                                            types.IpAddressAssignment(
                                                assignment_method =
types.BootProtocol.STATIC,
                                                ip = types.Ip(

address="192.168.300.10",
                                                    netmask="255.255.255.0",

version=types.IpVersion.V4,
                                                ),
                                            )
                                        ],
                                    ),
                               ] )


But I am getting below error:
"ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Bad
format of IPv4 address]". HTTP response code is 400."

Please help me.
Ovirt release version = 4.0

Thanks,
~Rohit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20170324/01e9a91f/attachment.html>


More information about the Users mailing list