Hi All,
I am using pynetbox python bindings to talk to the nebox api. I am not sure if this is the right platform to ask the question as I don't find any serious and well detailed documentation anywhere else.
1. I am trying to create a virtual machine.
2. Add an interface to the created VM.
3. Add an IP Address to the interface that we just created.
=================
import pynetbox
vm_name='vm1'
print nb
vrf_obj=nb.ipam.vrfs.get(name='test')
nb.virtualization.virtual_machines.create(name=vm_name,status=1,cluster='1')
vm_obj = nb.virtualization.virtual_machines.get(name=var_name)
if vm_obj != None:
nb.virtualization.interfaces.create(virtual_machine=vm_obj.id,name='eth1') else:
print "vm with the given name doesn't exists in the netbox inventory."
#Assign the IP ADDR to the interface on the vm
#print ip_obj
quit()
=================
up the second step, I am able to get create the objects in the netbox. However, I can't seem to make it to work for assigning the IP address to the "eth1", I created for "VM1".
Any help is appreciated?
Thanks,
No1.