Upload the contribution of vstf as bottleneck network framework.
[bottlenecks.git] / vstf / vstf / agent / env / basic / vm_xml_help.py
1 """
2 Created on 2015-7-2
3
4 @author: y00228926
5 """
6 xml_head = '''
7 <domain type='kvm'>
8   <name>VM_NAME</name>
9   <memory unit='KiB'>VM_MEMORY</memory>
10   <currentMemory unit='KiB'>VM_MEMORY</currentMemory>
11   <!--numatune>
12        <memory mode='strict' nodeset='0'/>
13   </numatune-->
14   <vcpu placement='static'>CPU_NUM</vcpu>
15   <cpu mode='host-passthrough'>
16   </cpu>
17   <os>
18     <type arch='x86_64' >hvm</type>
19     <boot dev='hd'/>
20   </os>
21   <features>
22     <acpi/>
23     <apic/>
24     <pae/>
25   </features>
26   <on_poweroff>destroy</on_poweroff>
27   <on_reboot>restart</on_reboot>
28   <on_crash>restart</on_crash>
29   <devices>
30     <emulator>/usr/bin/qemu-system-x86_64</emulator>'''
31 xml_disk = '''
32     <disk type='file' device='disk'>
33       <driver name='qemu' type='IMAGE_TYPE' cache='none' io='native'/>
34       <source file='IMAGE_PATH'/>
35       <target dev='vda' bus='virtio'/>
36     </disk>'''
37     
38 xml_ctrl_br = '''
39 <interface type='bridge'>
40   <mac address='CTRL_MAC'/>
41   <source bridge='CTRL_BR'/>
42   <model type='CTRL_MODEL'/>
43 </interface>
44 '''
45 xml_ovs = '''
46     <interface type='bridge'>
47       <mac address='TAP_MAC'/>
48       <source bridge='BR_NAME'/>
49       <virtualport type='BR_TYPE'>
50       </virtualport>
51       <model type='virtio'/>
52       <driver name='vhost' queues='4'/>
53       <target dev='TAP_NAME'/>
54     </interface>'''
55 xml_br = '''
56     <interface type='bridge'>
57       <mac address='TAP_MAC'/>
58       <source bridge='BR_NAME'/>
59       <model type='virtio'/>
60       <target dev='TAP_NAME'/>
61     </interface>'''
62     
63 xml_pci = '''
64     <hostdev mode='subsystem' type='pci' managed='yes'>
65       <driver name='kvm'/>
66       <source>
67         <address domain='0x0000' bus='0xBUS' slot='0xSLOT' function='0xFUNCTION' />
68       </source>
69     </hostdev>'''
70 xml_9p = '''
71     <filesystem type='mount' accessmode='passthrough'>
72       <source dir='9P_PATH'/>
73       <target dir='9pfs'/>
74     </filesystem>'''
75 xml_tail = '''
76     <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
77       <listen type='address' address='0.0.0.0'/>
78     </graphics>
79   </devices>
80 </domain>'''
81