OpenStack 创建VM流程简单介绍__Newton版本

本文概述了在OpenStack Newton版本中通过Nova创建虚拟机(VM)的详细步骤,从用户请求入口 nova/api/compute/servers.py 开始,经过API、调度、任务队列到计算节点的流程,涉及 nova/compute/manager.py 中的驱动调用以最终建立虚拟机。
摘要由CSDN通过智能技术生成
才疏学浅,若有不当之处敬请雅正, 本文适合刚刚开始看Nova源码的人,先把整个流程串一下,后面再详细介绍一下。
Nova 接收用户请求的入口:nova/api/compute/servers.py

nova/api/compute/servers.py
class ServersController(wsgi.Controller):
"""The Server API base controller class for the OpenStack API."""
.........................
def create(self, req, body):
"""Creates a new server for a given user."""
................................
(instances, resv_id) = self.compute_api.create(context,
inst_type,
image_uuid,
display_name=name,
display_description=description,
availability_zone=availability_zone,
forced_host=host, forced_node=node,
metadata=server_dict.get('metadata', {}),
admin_password=password,
requested_networks=requested_networks,
check_server_group_quota=True,
**create_kwargs)
.....................................
跳转到nova/compute/api.py
class API(base.Base):
"""API for interacting with the compute manager."""
............................................................
def create(self,------------):
"""Provision instances, sending instance information to the
scheduler. The scheduler will determine where the instance(s)
go and will handle creating the DB entries.
............................................................
return self._create_instance(
context, instance_type,
image_href, kernel_id, ramdisk_id,
min_count, max_count,
display_name, display_description,
key_name, key_data, security_groups,
availability_zone, user_data, metadata,
injected_files, admin_password,
access_ip_v4, access_ip_v6,
requested_networks, config_drive,
block_device_mapping, auto_disk_config,
filter_properties=filter_properties,
legacy_bdm=legacy_bdm,
shutdown_terminate=shutdown_terminate,
check_server_group_quota=check_server_group_quota)
跳转到本文件的_create_
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值