cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
s102_create_vm_foreign_disk.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 #
22 # Create pure VM with not mine images (disk or vm)
23 #
24 from predefined.users import *
25 from predefined.actions import *
26 from predefined.macros import *
27 import settings
28 
29 actions = []
30 actions.append(list_clusters)
31 actions.append(list_private_vm_images)
32 actions.append(list_public_vm_images)
33 actions.append(list_private_storage_images)
34 actions.append(list_templates)
35 actions.append(list_user_public_ip)
36 
37 # Create normal VM with not mine vm image
38 actions.append({'u': test_users[1],
39  'fname': 'vm.user.create',
40  'args': [{'vnc': True,
41  'name': 'TestVM',
42  'iso_list': [],
43  'image_id': MACRO_GET_PRIVATE_VM_IMAGE_ID(settings.PRIVATE_IMAGE),
44  'disk_list': [],
45  'template_id': MACRO_GET_TEMPLATE_ID("Small"),
46  'description': 'asd'}],
47  'estatus': 'image_permission',
48  })
49 
50 # Create normal VM with non-existing vm image
51 actions.append({'u': test_users[1],
52  'fname': 'vm.user.create',
53  'args': [{'vnc': True,
54  'name': 'TestVM',
55  'iso_list': [],
56  'image_id': 99999,
57  'disk_list': [],
58  'template_id': MACRO_GET_TEMPLATE_ID("Small"),
59  'description': 'asd'}],
60  'estatus': 'image_get',
61  })
62 
63 # Create normal VM with not mine storage disk
64 actions.append({'u': test_users[1],
65  'fname': 'vm.user.create',
66  'args': [{'vnc': True,
67  'name': 'TestVM',
68  'iso_list': [],
69  'image_id': MACRO_GET_PUBLIC_VM_IMAGE_ID(settings.PUBLIC_IMAGE),
70  'disk_list': [MACRO_GET_PRIVATE_STORAGE_ID("Test Storage1")],
71  'template_id': MACRO_GET_TEMPLATE_ID("Small"),
72  'description': 'asd'}],
73  'estatus': 'image_permission',
74  })
75 
76 # Create normal VM with not mine storage disk
77 actions.append({'u': test_users[1],
78  'fname': 'vm.user.create',
79  'args': [{'vnc': True,
80  'name': 'TestVM',
81  'iso_list': [],
82  'image_id': MACRO_GET_PUBLIC_VM_IMAGE_ID(settings.PUBLIC_IMAGE),
83  'disk_list': [99999],
84  'template_id': MACRO_GET_TEMPLATE_ID("Small"),
85  'description': 'asd'}],
86  'estatus': 'image_get',
87  })
88