cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
hardware.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # @COPYRIGHT_begin
3 #
4 # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # @COPYRIGHT_end
19 
20 ##
21 # @package src.common.hardware
22 # Cluster configuration
23 #
24 # You can specify here what hardware will be emulated on this cluster and all
25 # supported disk types/formats. Some variables have python-dictionary format.
26 # Each element is sub-dictionary:
27 #
28 # @code{.py}
29 # {
30 # id: {param_name: param_value, ...},
31 # id2: {param_name: param_value, ...},
32 # }
33 # @endcode
34 #
35 # Usually required parameters are name and enabled. If any attitional are re-
36 # quired, it is written in comment.
37 #
38 
39 ## Network devices available for Virtual Machines. Add own if necessary
40 # (virtualizator has to support it!)
41 network_devices = {
42  'rtl8139': 0,
43  'virtio': 1,
44  'ne2k_pci': 2,
45  'e1000': 3
46 }
47 
48 ## Emulated video devices for Virtual Machines. Add own if necessary
49 # (virtualizator has to support it!)
50 video_devices = {
51  'cirrus': 0,
52  'vga': 1
53 }
54 
55 ## Disk controllers for virtual machines.
56 disk_controllers = {
57  'scsi': 0,
58  'virtio': 1,
59  'ide': 2,
60  'sata': 3,
61  'usb': 4
62 }
63 
64 live_attach_disk_controllers = ['virtio', 'usb']
65 
66 # Disk filesystems (must be supported by ResourceManager for this CM!)
67 # Required parameters:
68 # - name
69 # - command - formatting program. %%s will be replaced with formatting filename
70 # - enabled
71 disk_filesystems = {
72  'raw': 0,
73  #'ntfs-full': 1,
74  'fat32': 2,
75  #'ext2': 3,
76  #'ext3': 4,
77  'ext4': 5,
78  'reiserfs': 6,
79  'xfs': 7,
80  'ntfs': 8
81 }
82 
83 disk_format_commands = {
84  'raw': '',
85  'ntfs-full': '/sbin/mkfs.ntfs -F',
86  'fat32': '/sbin/mkfs.vfat',
87  'ext2': '/sbin/mkfs.ext2 -F',
88  'ext3': '/sbin/mkfs.ext3 -F',
89  'ext4': '/sbin/mkfs.ext4 -F',
90  'reiserfs': '/sbin/mkfs.reiserfs -f -q',
91  'xfs': '/sbin/mkfs.xfs -f',
92  'ntfs': '/sbin/mkfs.ntfs -Q -F',
93 }
94 
95 video_devices_reversed = dict((v, k) for k, v in video_devices.iteritems())
96 disk_controllers_reversed = dict((v, k) for k, v in disk_controllers.iteritems())
97 network_devices_reversed = dict((v, k) for k, v in network_devices.iteritems())
98 disk_filesystems_reversed = dict((v, k) for k, v in disk_filesystems.iteritems())
99