def config_cascaded_az(): """Update parameter for neutron-server and cinder-volume, then restart them.""" params = { 'mechanism_drivers': 'openvswitch,l2populationcascaded,evs,sriovnicswitch,netmapnicswitch' } ret = cps_server.update_template_params('neutron', 'neutron-server', params) if not ret: LOG.error("cps update_template_params for neutron-server failed.") return ret params = { 'volume_driver': 'cinder.volume.drivers.ec2.driver.AwsEc2VolumeDriver' } ret = cps_server.update_template_params('cinder', 'cinder-volume', params) if not ret: LOG.error("cps update_template_params for cinder-volume failed.") return ret cps_server.cps_commit() restart_component('neutron', 'neutron-openvswitch-agent') restart_component('cinder', 'cinder-volume') restart_component('nova', 'nova-compute')
def update_ceph_param(self, key, val): LOG.info("update ceph backend: %s = %s" % (key, val)) update_param = self._get_update_ceph_param(key, val) LOG.info("cps_server update cinder cinder-volume") while True: if not cps_server.update_template_params("cinder", "cinder-volume", update_param): sleep(5) continue else: break LOG.info("cps_server update cinder cinder-backup") while True: if not cps_server.update_template_params("cinder", "cinder-backup", update_param): sleep(5) continue else: break self._commit()
def config_cascaded_az(): """Update parameter for neutron-server and cinder-volume, then restart them.""" params = {"mechanism_drivers": "openvswitch,l2populationcascaded,evs,sriovnicswitch,netmapnicswitch"} ret = cps_server.update_template_params("neutron", "neutron-server", params) if not ret: LOG.error("cps update_template_params for neutron-server failed.") return ret params = {"volume_driver": "cinder.volume.drivers.vcloud.driver.VMwareVcloudVolumeDriver"} ret = cps_server.update_template_params("cinder", "cinder-volume", params) if not ret: LOG.error("cps update_template_params for neutron-server failed.") return ret cps_server.cps_commit() restart_component("neutron", "neutron-openvswitch-agent") restart_component("cinder", "cinder-volume") restart_component("nova", "nova-compute")
def cps_server_update_params_list(service_name, template_name, update_params_list): while len(update_params_list) != 0: update_params_item = update_params_list.pop() if not cps_server.update_template_params(service_name, template_name, update_params_item): LOG.error("update service %s template %s params failed."%(service_name,template_name)) update_params_list.append(update_params_item) sleep(5) else: LOG.info("update service %s template %s params successed."%(service_name,template_name)) cps_server.cps_commit()
def config_cascaded_az(): """Update parameter for neutron-server and cinder-volume, then restart them.""" params = {'mechanism_drivers': 'openvswitch,l2populationcascaded,evs,sriovnicswitch,netmapnicswitch'} ret = cps_server.update_template_params('neutron', 'neutron-server', params) if not ret: LOG.error("cps update_template_params for neutron-server failed.") return ret params = {'volume_driver': 'cinder.volume.drivers.ec2.driver.AwsEc2VolumeDriver'} ret = cps_server.update_template_params('cinder', 'cinder-volume', params) if not ret: LOG.error("cps update_template_params for cinder-volume failed.") return ret cps_server.cps_commit() restart_component('neutron', 'neutron-openvswitch-agent') restart_component('cinder', 'cinder-volume') restart_component('nova', 'nova-compute')
def cps_server_update_params_list(service_name, template_name, update_params_list): while len(update_params_list) != 0: update_params_item = update_params_list.pop() if not cps_server.update_template_params( service_name, template_name, update_params_item): LOG.error("update service %s template %s params failed." % (service_name, template_name)) update_params_list.append(update_params_item) sleep(5) else: LOG.info("update service %s template %s params successed." % (service_name, template_name)) cps_server.cps_commit()
def update_cinder_volume_other_storage_cfg(): service = "cinder" template = "cinder-volume" cascaded_domain = cps_server.get_local_domain() cascaded_region = _get_region_form_domain(cascaded_domain) rbd = {'iscsi_server_ip': '172.29.253.11', 'rbd_store_chunk_size': '4', 'rbd_ceph_conf': '/etc/ceph/ceph.conf', 'volume_backend_name': 'HYBRID:%s:%s' % (cascaded_region, cascaded_region), 'iscsi_server_pem': '/home/ceph-keypair.pem', 'volume_driver': 'cinder.volume.drivers.cephiscsi.cephiscsi.CephIscsiDriver', 'rbd_user': '******', 'rados_connect_timeout': '-1', 'rbd_pool': 'volumes', 'rbd_flatten_volume_from_snapshot': 'false', 'rbd_max_clone_depth': '5', 'iscsi_server_user': '******'} ec2 = {'storage_tmp_dir': CONF.provider_opts.storage_tmp_dir, 'availability_zone': CONF.provider_opts.availability_zone, 'cgw_host_ip': CONF.provider_opts.cgw_host_ip, 'cgw_certificate': CONF.provider_opts.cgw_certificate, 'volume_backend_name': 'AMAZONEC2', 'region': CONF.provider_opts.region, 'provider_image_conversion_dir': CONF.provider_opts.conversion_dir, 'volume_driver': 'cinder.volume.drivers.ec2.driver.AwsEc2VolumeDriver', 'access_key_id': CONF.provider_opts.access_key_id, 'secret_key': CONF.provider_opts.secret_key, 'cgw_username': CONF.provider_opts.cgw_user_name, 'cgw_host_id': CONF.provider_opts.cgw_host_id} other_storage_cfg_temp = {"rbd": rbd, "ec2": ec2} other_storage_cfg = {0: other_storage_cfg_temp} updated_params = { "other_storage_cfg": other_storage_cfg } return cps_server.update_template_params(service, template, updated_params)