首页 文章 精选 留言 我的

精选列表

搜索[openstack],共3159篇文章
优秀的个人博客,低调大师

openStack error infos 调试

glance image-create --name "RuiCheck" --disk-format qcow2 --container-format bare --is-public True --progress <nix.qcow2[> ] 0%Error communicating with http://ruiy.ostack.cc:9292 timed out 2015-01-07 05:51:05.745 15583 ERROR nova.wsgi [-] Could not bind to 0.0.0.0:87752015-01-07 05:51:05.752 15583 CRITICAL nova [-] error: [Errno 98] Address already in use2015-01-07 06:50:11.723 3854 ERROR nova.wsgi [-] Could not bind to 0.0.0.0:87752015-01-07 06:50:54.929 3854 CRITICAL nova [-] error: [Errno 98] Address already in use 解决方案联系Ruiy 150 5519 8367 来电前请短信告知原因,

优秀的个人博客,低调大师

openstack添加新功能

#增加按钮功能【例如增加增量功能】 vim /opt/horizon-2012.1/horizon/dashboards/nova/instances_and_volumes/instances/tables.py class SnapshotLink(tables.LinkAction): #创建快照功能,快照流程分析 name = "snapshot" verbose_name = _("Snapshot") url = "horizon:nova:images_and_snapshots:snapshots:create" #连接目录如下: classes = ("ajax-modal", "btn-camera") def allowed(self, request, instance=None): return instance.status in ACTIVE_STATES 说明: vim /opt/horizon-2012.1/horizon/dashboards/nova/images_and_snapshots/snapshots/url.py # from django.conf.urls.defaults import patterns, url from .views import CreateView urlpatterns = patterns('', url(r'^(?P[^/]+)/create', CreateView.as_view(), name='create') #### vim /opt/horizon-2012.1/horizon/dashboards/nova/images_and_snapshots/snapshots/views.py class CreateView(forms.ModalFormView): #vim /opt/horizon-2012.1/horizon/forms/views.py form_class = CreateSnapshot template_name = 'nova/images_and_snapshots/snapshots/create.html' def get_initial(self): redirect = reverse('horizon:nova:instances_and_volumes:index') instance_id = self.kwargs["instance_id"] try: self.instance = api.server_get(self.request, instance_id) except: self.instance = None msg = _("Unable to retrieve instance.") exceptions.handle(self.request, msg, redirect) if self.instance.status != api.nova.INSTANCE_ACTIVE_STATE: msg = _('To create a snapshot, the instance must be in ' 'the "%s" state.') % api.nova.INSTANCE_ACTIVE_STATE raise exceptions.Http302(redirect, message=msg) return {"instance_id": instance_id, "tenant_id": self.request.user.tenant_id} def get_context_data(self, **kwargs): context = super(CreateView, self).get_context_data(**kwargs) context['instance'] = self.instance return context #修改实例:单击Snapshot按钮后出现的对话框如下: name = forms.CharField(max_length="20", label=_("shot Name")) #修改前 #name = forms.CharField(max_length="20", label=_("Snapshot Name")) #修改后 修改完毕,重启apache vim /opt/horizon-2012.1/horizon/forms/views.py import os from django import http from django.views import generic ## cd /usr/lib/python2.6/site-packages/django/views/generic class ModalFormView(generic.TemplateView): vim /usr/lib/python2.6/site-packages/django/views/generic/base.py # class View(object): """ Intentionally simple parent class for all views. Only implements dispatch-by-method and simple sanity checking. """ http_method_names = ['get', 'post', 'put', 'delete', 'head', 'options', 'trace'] def __init__(self, **kwargs): """ Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things. """ # Go through keyword arguments, and either save their values to our # instance, or raise an error. for key, value in kwargs.iteritems(): setattr(self, key, value) @classonlymethod def as_view(cls, **initkwargs): """ Main entry point for a request-response process. """ # sanitize keyword arguments for key in initkwargs: if key in cls.http_method_names: raise TypeError(u"You tried to pass in the %s method name as a " u"keyword argument to %s(). Don't do that." % (key, cls.__name__)) if not hasattr(cls, key): raise TypeError(u"%s() received an invalid keyword %r" % ( cls.__name__, key)) def view(request, *args, **kwargs): self = cls(**initkwargs) return self.dispatch(request, *args, **kwargs) # take name and docstring from class update_wrapper(view, cls, updated=()) # and possible attributes set by decorators # like csrf_exempt from dispatch update_wrapper(view, cls.dispatch, assigned=()) return view def dispatch(self, request, *args, **kwargs): # Try to dispatch to the right method; if a method doesn't exist, # defer to the error handler. Also defer to the error handler if the # request method isn't on the approved list. if request.method.lower() in self.http_method_names: handler = getattr(self, request.method.lower(), self.http_method_not_allowed) else: handler = self.http_method_not_allowed self.request = request self.args = args self.kwargs = kwargs return handler(request, *args, **kwargs) def http_method_not_allowed(self, request, *args, **kwargs): allowed_methods = [m for m in self.http_method_names if hasattr(self, m)] logger.warning('Method Not Allowed (%s): %s' % (request.method, request.path), extra={ 'status_code': 405, 'request': self.request } ) return http.HttpResponseNotAllowed(allowed_methods) class TemplateResponseMixin(object): """ A mixin that can be used to render a template. """ template_name = None response_class = TemplateResponse def render_to_response(self, context, **response_kwargs): """ Returns a response with a template rendered with the given context. """ return self.response_class( request = self.request, template = self.get_template_names(), context = context, **response_kwargs ) def get_template_names(self): """ Returns a list of template names to be used for the request. Must return a list. May not be called if render_to_response is overridden. """ if self.template_name is None: raise ImproperlyConfigured( "TemplateResponseMixin requires either a definition of " "'template_name' or an implementation of 'get_template_names()'") else: return [self.template_name] class TemplateView(TemplateResponseMixin, View): #表示有两个父类 """ A view that renders a template. """ def get_context_data(self, **kwargs): return { 'params': kwargs } def get(self, request, *args, **kwargs): context = self.get_context_data(**kwargs) return self.render_to_response(context) #add by xk=新增项==============================================# class IncreaseLink(tables.LinkAction): name = "increase" verbose_name = _("Increase") url = "horizon:nova:images_and_snapshots:snapshots:create" classes = ("ajax-modal", "btn-camera") #def allowed(self, request, instance=None): # retturn instance.status in ACTIVE_STATES #============================================================# Add 虚拟机创建规则功能和主机选择功能 vim /opt/horizon-2012.1/horizon/dashboards/nova/images_and_snapshots/images/forms.py +175 class LaunchForm(forms.SelfHandlingForm): name = forms.CharField(max_length=80, label=_("Server Name")) image_id = forms.CharField(widget=forms.HiddenInput()) tenant_id = forms.CharField(widget=forms.HiddenInput()) user_data = forms.CharField(widget=forms.Textarea, label=_("User Data"), required=False) flavor = forms.ChoiceField(label=_("Flavor"), help_text=_("Size of image to launch.")) #add by xk 2012-12-27 rouler = forms.ChoiceField(label=_("rouler"), help_text=_("Rouler of image to create.")) #-------------------# .. .. api.server_create(request, data['name'], data['image_id'], data['flavor'], #add by xk 2012-12-27 data['rouler'], #--------------------# meta, data.get('keypair'), normalize_newlines(data.get('user_data')), data.get('security_groups'), dev_mapping, instance_count=data.get('count')) messages.success(request, _('Instance "%s" launched.') % data["name"]) 重启apache #效果如下 #=======launch按钮涉及的页面====================================# vim /opt/horizon-2012.1/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_launch.html vim /opt/horizon-2012.1/horizon/templates/horizon/common/_form_fields.html Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them. 《开源人》

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册