Coverage for nova/conf/zvm.py: 89%

9 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-04-24 11:16 +0000

1# Copyright 2017,2018 IBM Corp. 

2# 

3# Licensed under the Apache License, Version 2.0 (the "License"); you may 

4# not use this file except in compliance with the License. You may obtain 

5# a copy of the License at 

6# 

7# http://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

12# License for the specific language governing permissions and limitations 

13# under the License. 

14 

15from oslo_config import cfg 

16 

17 

18from nova.conf import paths 

19 

20 

21zvm_opt_group = cfg.OptGroup('zvm', 

22 title='zVM Options', 

23 help=""" 

24zvm options allows cloud administrator to configure related 

25z/VM hypervisor driver to be used within an OpenStack deployment. 

26 

27zVM options are used when the compute_driver is set to use 

28zVM (compute_driver=zvm.ZVMDriver) 

29""") 

30 

31 

32zvm_opts = [ 

33 cfg.URIOpt('cloud_connector_url', 

34 sample_default='http://zvm.example.org:8080/', 

35 help=""" 

36URL to be used to communicate with z/VM Cloud Connector. 

37"""), 

38 cfg.StrOpt('ca_file', 

39 default=None, 

40 help=""" 

41CA certificate file to be verified in httpd server with TLS enabled 

42 

43A string, it must be a path to a CA bundle to use. 

44"""), 

45 cfg.StrOpt('image_tmp_path', 

46 default=paths.state_path_def('images'), 

47 sample_default="$state_path/images", 

48 help=""" 

49The path at which images will be stored (snapshot, deploy, etc). 

50 

51Images used for deploy and images captured via snapshot 

52need to be stored on the local disk of the compute host. 

53This configuration identifies the directory location. 

54 

55Possible values: 

56 A file system path on the host running the compute service. 

57"""), 

58 cfg.IntOpt('reachable_timeout', 

59 default=300, 

60 help=""" 

61Timeout (seconds) to wait for an instance to start. 

62 

63The z/VM driver relies on communication between the instance and cloud 

64connector. After an instance is created, it must have enough time to wait 

65for all the network info to be written into the user directory. 

66The driver will keep rechecking network status to the instance with the 

67timeout value, If setting network failed, it will notify the user that 

68starting the instance failed and put the instance in ERROR state. 

69The underlying z/VM guest will then be deleted. 

70 

71Possible Values: 

72 Any positive integer. Recommended to be at least 300 seconds (5 minutes), 

73 but it will vary depending on instance and system load. 

74 A value of 0 is used for debug. In this case the underlying z/VM guest 

75 will not be deleted when the instance is marked in ERROR state. 

76"""), 

77] 

78 

79 

80def register_opts(conf): 

81 conf.register_group(zvm_opt_group) 

82 conf.register_opts(zvm_opts, group=zvm_opt_group) 

83 

84 

85def list_opts(): 

86 return {zvm_opt_group: zvm_opts}