xenserver network commands

From thelinuxwiki
Jump to: navigation, search

List existing networks

The following command will list virtual networks as well as physical.

[root@xen ~]# xe network-list
uuid ( RO)                : 83ca879f-b93a-ab8c-432c-2d2d6acae80b
         name-label ( RW): net_192.168.1.0
   name-description ( RW): my private single server network
             bridge ( RO): xapi3
 
uuid ( RO)  : cc4ec144-9a52-12ff-bed9-fcaa21cceffc name-label ( RW): Pool-wide network associated with eth1 name-description ( RW): bridge ( RO): xenbr1
uuid ( RO)  : 9183bb9e-45bc-3d67-5e19-dbe38d327355 name-label ( RW): Host internal management network name-description ( RW): Network on which guests will be assigned a private link-local IP address which can be used to talk XenAPI bridge ( RO): xenapi
uuid ( RO)  : 701cbdca-b843-120c-eb44-d691a8d190e8 name-label ( RW): Pool-wide network associated with eth0 name-description ( RW): bridge ( RO): xenbr0

creating networks

[root@xenner ~]# xe network-create name-label=net_192.168.1.0-24 name-description="my new test network"
298237bf-e6e4-802a-a9f4-814ff40a56d8
[root@xenner ~]# xe network-list name-label=net_192.168.1.0-24
uuid ( RO)                : 298237bf-e6e4-802a-a9f4-814ff40a56d8
         name-label ( RW): net_192.168.1.0-24
   name-description ( RW): my new test network
             bridge ( RO): xapi7

For more detailed info on the network, use "xe network-param-list"

[root@xen ~]# xe network-param-list name-label=net_192.168.1.0-24
Required parameter not found: uuid
For usage run: 'xe help'

Doh!, that didn't work. Unfortunately we have to use the uuid to query this way...

[root@xenner ~]# xe network-param-list uuid=298237bf-e6e4-802a-a9f4-814ff40a56d8
uuid ( RO)                    : 298237bf-e6e4-802a-a9f4-814ff40a56d8
             name-label ( RW): net_192.168.1.0-24
       name-description ( RW): my new test network
              VIF-uuids (SRO): 
              PIF-uuids (SRO): 
                    MTU ( RW): 1500
                 bridge ( RO): xapi7
           other-config (MRW): 
                  blobs ( RO): 
                   tags (SRW): 
   default-locking-mode ( RW): unlocked

Destory (remove) a network

[root@xen ~]# xe network-destroy uuid=298237bf-e6e4-802a-a9f4-814ff40a56d8