Installation guide

mac = [ 0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
return ':'.join(map(lambda x: "%02x" % x, mac))
#
print randomMAC()
An o t h er met ho d t o g en erat e a n ew MAC f o r yo u r g u est
You can also use the built-in modules of python-virtinst to generate a new MAC address and
UUID for use in a guest configuration file:
# echo 'import virtinst.util ; print\
virtinst.util.uuidToString(virtinst.util.randomUUID())' | python
# echo 'import virtinst.util ; print virtinst.util.randomMAC()' | python
The script above can also be implemented as a script file as seen below.
#!/usr/bin/env python
# -*- mode: python; -*-
print ""
print "New UUID:"
import virtinst.util ; print virtinst.util.uuidToString(virtinst.util.randomUUID())
print "New MAC:"
import virtinst.util ; print virtinst.util.randomMAC()
print ""
33.10. Limit net work bandwidt h for a Xen guest
In some environments it may be required to limit the network bandwidth available to certain guests.
This can be used to implement basic Quality of Service on a host running multiple virtual machines.
By default, the guest can use any bandwidth setting available which your physical network card
supports. The physical network card must be mapped to one of virtual machine's virtual network
interfaces. In Xen the “ rate parameter part of the VIF entries can throttle guests.
This list covers the variables
rate
The rate= option can be added to the VIF= entry in a virtual machine configuration file to
limit a virtual machine's network bandwidth or specify a specific time interval for a time
window.
t ime win d o w
The time window is optional to the rate= option:
The default time window is 50ms.
A smaller time window will provide less burst transmission, however, the replenishment rate
and latency will increase.
The default 50ms time window is a good balance between latency and throughput and in
most cases will not require changing.
Examples of rate parameter values and uses.
Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e
322