Fuel UI
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

consts.py 9.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. # -*- coding: utf-8 -*-
  2. # Copyright 2013 Mirantis, Inc.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  5. # not use this file except in compliance with the License. You may obtain
  6. # a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. # License for the specific language governing permissions and limitations
  14. # under the License.
  15. from collections import namedtuple
  16. def Enum(*values, **kwargs):
  17. names = kwargs.get('names')
  18. if names:
  19. return namedtuple('Enum', names)(*values)
  20. return namedtuple('Enum', values)(*values)
  21. RELEASE_STATES = Enum(
  22. 'available',
  23. 'unavailable',
  24. 'manageonly'
  25. )
  26. RELEASE_OS = Enum(
  27. 'Ubuntu',
  28. 'CentOS',
  29. names=(
  30. 'ubuntu',
  31. 'centos'
  32. )
  33. )
  34. CLUSTER_MODES = Enum(
  35. 'multinode',
  36. 'ha_full',
  37. 'ha_compact'
  38. )
  39. CLUSTER_STATUSES = Enum(
  40. 'new',
  41. 'deployment',
  42. 'stopped',
  43. 'operational',
  44. 'error',
  45. 'remove',
  46. 'partially_deployed'
  47. )
  48. NETWORKS = Enum(
  49. # Node networks
  50. 'fuelweb_admin',
  51. 'storage',
  52. 'baremetal',
  53. # internal in terms of fuel
  54. 'management',
  55. 'public',
  56. # private in terms of fuel
  57. 'fixed',
  58. 'private'
  59. )
  60. NOVA_NET_MANAGERS = Enum(
  61. 'FlatDHCPManager',
  62. 'VlanManager'
  63. )
  64. CLUSTER_NET_PROVIDERS = Enum(
  65. 'nova_network',
  66. 'neutron'
  67. )
  68. NEUTRON_L23_PROVIDERS = Enum(
  69. 'ovs',
  70. 'nsx',
  71. 'dpdkovs'
  72. )
  73. NEUTRON_SEGMENT_TYPES = Enum(
  74. 'vlan',
  75. 'gre',
  76. 'tun'
  77. )
  78. BRIDGE_NAME_MAX_LEN = 15
  79. DEFAULT_BRIDGES_NAMES = Enum(
  80. 'br-fw-admin',
  81. 'br-storage',
  82. 'br-mgmt',
  83. 'br-prv',
  84. 'br-floating',
  85. 'br-int',
  86. 'br-ex',
  87. 'br-mesh',
  88. 'br-aux',
  89. 'br-baremetal',
  90. 'br-ironic',
  91. names=(
  92. 'br_fw_admin',
  93. 'br_storage',
  94. 'br_mgmt',
  95. 'br_prv',
  96. 'br_floating',
  97. 'br_int',
  98. 'br_ex',
  99. 'br_mesh',
  100. 'br_aux',
  101. 'br_baremetal',
  102. 'br_ironic'
  103. )
  104. )
  105. NODE_STATUSES = Enum(
  106. 'ready',
  107. 'discover',
  108. 'provisioning',
  109. 'provisioned',
  110. 'deploying',
  111. 'error',
  112. 'removing',
  113. 'stopped',
  114. )
  115. NODE_ERRORS = Enum(
  116. 'deploy',
  117. 'provision',
  118. 'deletion',
  119. 'discover',
  120. 'stop_deployment'
  121. )
  122. NODE_GROUPS = Enum(
  123. 'default'
  124. )
  125. NODE_VIEW_MODES = Enum(
  126. 'standard',
  127. 'compact'
  128. )
  129. NODE_LIST_FILTERS = Enum(
  130. 'cluster',
  131. 'roles',
  132. 'status',
  133. 'manufacturer',
  134. 'cores',
  135. 'ht_cores',
  136. 'hdd',
  137. 'disks_amount',
  138. 'ram',
  139. 'interfaces',
  140. 'group_id'
  141. )
  142. NODE_ROLE_GROUPS = Enum(
  143. 'base',
  144. 'compute',
  145. 'storage',
  146. 'other'
  147. )
  148. NETWORK_INTERFACE_TYPES = Enum(
  149. 'ether',
  150. 'bond'
  151. )
  152. NETWORK_VIP_NAMES_V6_1 = Enum(
  153. 'haproxy',
  154. 'vrouter',
  155. )
  156. BOND_MODES = Enum(
  157. # same for both OVS and linux
  158. 'active-backup',
  159. # OVS modes
  160. 'balance-slb',
  161. 'balance-tcp',
  162. 'lacp-balance-tcp',
  163. # linux modes
  164. 'balance-rr',
  165. 'balance-xor',
  166. 'broadcast',
  167. '802.3ad',
  168. 'balance-tlb',
  169. 'balance-alb',
  170. names=(
  171. 'active_backup',
  172. 'balance_slb',
  173. 'balance_tcp',
  174. 'lacp_balance_tcp',
  175. 'balance_rr',
  176. 'balance_xor',
  177. 'broadcast',
  178. 'l_802_3ad',
  179. 'balance_tlb',
  180. 'balance_alb',
  181. )
  182. )
  183. BOND_XMIT_HASH_POLICY = Enum(
  184. 'layer2',
  185. 'layer2+3',
  186. 'layer3+4',
  187. 'encap2+3',
  188. 'encap3+4',
  189. names=(
  190. 'layer2',
  191. 'layer2_3',
  192. 'layer3_4',
  193. 'encap2_3',
  194. 'encap3_4',
  195. )
  196. )
  197. BOND_LACP_RATES = Enum(
  198. 'slow',
  199. 'fast'
  200. )
  201. BOND_TYPES = Enum(
  202. 'ovs',
  203. 'linux',
  204. 'dpdkovs',
  205. )
  206. TASK_STATUSES = Enum(
  207. 'pending',
  208. 'ready',
  209. 'running',
  210. 'error'
  211. )
  212. HISTORY_TASK_STATUSES = Enum(
  213. 'pending',
  214. 'ready',
  215. 'running',
  216. 'error',
  217. 'skipped'
  218. )
  219. TASK_NAMES = Enum(
  220. 'super',
  221. # Cluster changes
  222. # For deployment supertask, it contains
  223. # two subtasks deployment and provision
  224. 'deploy',
  225. 'deployment',
  226. 'provision',
  227. 'stop_deployment',
  228. # reset_environment supertask contains three subtasks:
  229. # reset_nodes, remove_keys and remove_ironic_bootstrap
  230. 'reset_environment',
  231. 'reset_nodes',
  232. 'remove_keys',
  233. 'remove_ironic_bootstrap',
  234. 'update',
  235. 'spawn_vms',
  236. 'node_deletion',
  237. 'cluster_deletion',
  238. 'remove_images',
  239. 'check_before_deployment',
  240. # network
  241. 'check_networks',
  242. 'verify_networks',
  243. 'check_dhcp',
  244. 'verify_network_connectivity',
  245. 'multicast_verification',
  246. 'check_repo_availability',
  247. 'check_repo_availability_with_setup',
  248. 'dry_run_deployment',
  249. # dump
  250. 'dump',
  251. 'capacity_log',
  252. # statistics
  253. 'create_stats_user',
  254. 'remove_stats_user',
  255. # setup dhcp via dnsmasq for multi-node-groups
  256. 'update_dnsmasq'
  257. )
  258. NOTIFICATION_STATUSES = Enum(
  259. 'read',
  260. 'unread'
  261. )
  262. NOTIFICATION_TOPICS = Enum(
  263. 'discover',
  264. 'done',
  265. 'error',
  266. 'warning',
  267. 'release',
  268. )
  269. CLUSTER_CHANGES = Enum(
  270. 'networks',
  271. 'attributes',
  272. 'disks',
  273. 'interfaces'
  274. )
  275. PROVISION_METHODS = Enum(
  276. 'cobbler',
  277. 'image'
  278. )
  279. STAGES = Enum(
  280. 'pre_deployment',
  281. 'deploy',
  282. 'post_deployment'
  283. )
  284. ACTION_TYPES = Enum(
  285. 'http_request',
  286. 'nailgun_task'
  287. )
  288. LOG_CHUNK_SEND_STATUS = Enum(
  289. 'ok',
  290. 'error'
  291. )
  292. LOG_RECORD_SEND_STATUS = Enum(
  293. 'added',
  294. 'existed',
  295. 'failed',
  296. 'updated',
  297. 'skipped'
  298. )
  299. NOVA_SERVICE_TYPE = Enum(
  300. 'compute',
  301. )
  302. VIRTUAL_NODE_TYPES = Enum(
  303. "virt",
  304. )
  305. OPENSTACK_IMAGES_SETTINGS = Enum(
  306. "OS-EXT-IMG-SIZE:size",
  307. "byte",
  308. names=(
  309. "size_attr_name",
  310. "size_unit"
  311. )
  312. )
  313. DEPLOY_STRATEGY = Enum(
  314. 'parallel',
  315. 'one_by_one'
  316. )
  317. ORCHESTRATOR_TASK_TYPES = Enum(
  318. 'puppet',
  319. 'shell',
  320. 'sync',
  321. 'upload_file',
  322. 'group',
  323. 'stage',
  324. 'skipped',
  325. 'reboot',
  326. 'copy_files',
  327. 'role',
  328. 'master_shell',
  329. 'move_to_bootstrap',
  330. 'erase_node'
  331. )
  332. INTERNAL_TASKS = (ORCHESTRATOR_TASK_TYPES.group,
  333. ORCHESTRATOR_TASK_TYPES.stage,
  334. ORCHESTRATOR_TASK_TYPES.skipped)
  335. PLUGIN_PRE_DEPLOYMENT_HOOK = "_plugin_pre_deployment_hook"
  336. PLUGIN_POST_DEPLOYMENT_HOOK = "_plugin_post_deployment_hook"
  337. # filter for deployment tasks which should be rerun on deployed nodes to make
  338. # re-setup of network on nodes
  339. TASKS_TO_RERUN_ON_DEPLOY_CHANGES = ['deploy_changes']
  340. TASK_REFRESH_FIELD = 'refresh_on'
  341. ROLE_NAME_MAX_SIZE = 64
  342. EXTENSION_NAME_MAX_SIZE = 64
  343. MASTER_NODE_UID = 'master'
  344. MASTER_NODE_NAME = 'Fuel master node'
  345. # version of Fuel when we added granular deploy support
  346. FUEL_GRANULAR_DEPLOY = '6.1'
  347. # version of Fuel when we added remote repos
  348. FUEL_REMOTE_REPOS = '6.1'
  349. # version of Fuel when external mongo was added
  350. FUEL_EXTERNAL_MONGO = '6.1'
  351. # version of Fuel when classic provisioning is not available anymore.
  352. FUEL_IMAGE_BASED_ONLY = '7.0'
  353. # version of Fuel when multiple floating IP ranges support is added
  354. FUEL_MULTIPLE_FLOATING_IP_RANGES = '8.0'
  355. # version of Fuel when LCM was introduced
  356. FUEL_LCM_AVAILABLE = '9.0'
  357. # version of Fuel when NFV was introduced
  358. FUEL_NFV_AVAILABLE_SINCE = '9.0'
  359. # version of Fuel when Tags was introduced
  360. TAGS_SUPPORT_VERSION = '9.0'
  361. # this file is provided by the fuel-release package
  362. FUEL_RELEASE_FILE = '/etc/fuel_release'
  363. # this file is provided by the fuel-openstack-metadata package
  364. FUEL_OPENSTACK_VERSION_FILE = '/etc/fuel_openstack_version'
  365. OSWL_RESOURCE_TYPES = Enum(
  366. 'vm',
  367. 'tenant',
  368. 'volume',
  369. 'security_group',
  370. 'keystone_user',
  371. 'flavor',
  372. 'cluster_stats',
  373. 'image',
  374. )
  375. PROTOCOL = Enum(
  376. 'http',
  377. 'https',
  378. )
  379. NETWORK_NOTATION = Enum(
  380. "ip_ranges",
  381. "cidr",
  382. )
  383. # Minimal quantity of IPs to be fetched and checked within one request to DB.
  384. MIN_IPS_PER_DB_QUERY = 5
  385. CLOUD_INIT_TEMPLATES = Enum(
  386. 'boothook',
  387. 'cloud_config',
  388. 'meta_data',
  389. )
  390. # NOTE(kozhukalov): This constant is used to collect
  391. # the information about installed fuel packages (rpm -q).
  392. # This information is necessary for fuel-stats.
  393. STAT_FUEL_PACKAGES = (
  394. 'fuel-nailgun',
  395. )
  396. OPENSTACK_CONFIG_TYPES = Enum(
  397. 'cluster',
  398. 'role',
  399. 'node',
  400. )
  401. NODE_RESOLVE_POLICY = Enum(
  402. "all",
  403. "any"
  404. )
  405. TASK_ROLES = Enum(
  406. '*', 'master', 'self',
  407. names=('all', 'master', 'self')
  408. )
  409. OVERRIDE_CONFIG_BASE_PATH = '/etc/hiera/override/configuration/'
  410. # Task version from which cross-dependencies is used
  411. TASK_CROSS_DEPENDENCY = '2.0.0'
  412. # Task version from which lcm supported
  413. TASK_LCM_READINESS = '2.1.0'
  414. # From which (major) plugins package version task based is strictly required
  415. TASK_DEPLOY_STRICT_FROM_VER = '5.0.0'
  416. IRONIC_BOOTSTRAP_PKGS = ('openssh-server',
  417. 'ntp',
  418. 'fuel-agent',
  419. 'ubuntu-minimal',
  420. 'live-boot',
  421. 'wget',
  422. 'live-boot-initramfs-tools',
  423. 'squashfs-tools',
  424. 'linux-firmware',
  425. 'msmtp-mta',
  426. 'i40e-dkms',
  427. 'xz-utils',
  428. 'linux-headers-generic')
  429. DEPLOYMENT_TASK_DEFAULT_VERSION = '1.0.0'
  430. DEFAULT_DEPLOYMENT_GRAPH_TYPE = 'default'
  431. # default size for hugepages is 2048 KiB
  432. DEFAULT_HUGEPAGE_SIZE = '2048'
  433. HUGE_PAGES_SIZE_MAP = [('2048', '2M'), ('1048576', '1G')]
  434. DPDK_OVS_CORE_CPUS = 1
  435. # minimal RAM amount for OVS+DPDK in MB
  436. MIN_DPDK_HUGEPAGES_MEMORY = 1024
  437. MEMORY_RESERVED_FOR_OPERATING_SYSTEM = 1024 ** 3 # one GiB in bytes
  438. HYPERVISORS = Enum(
  439. "kvm",
  440. "qemu"
  441. )
  442. DPDK_DRIVER_IN_SRIOV_CASE = 'vfio-pci'