{"action":"created","issue":{"url":"https://api.github.com/repos/vieyahn2017/iBlog/issues/153","repository_url":"https://api.github.com/repos/vieyahn2017/iBlog","labels_url":"https://api.github.com/repos/vieyahn2017/iBlog/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/vieyahn2017/iBlog/issues/153/comments","events_url":"https://api.github.com/repos/vieyahn2017/iBlog/issues/153/events","html_url":"https://github.com/vieyahn2017/iBlog/issues/153","id":330863971,"node_id":"MDU6SXNzdWUzMzA4NjM5NzE=","number":153,"title":"6.9 OpenStack Heat基础介绍","user":{"login":"vieyahn2017","id":31752705,"node_id":"MDQ6VXNlcjMxNzUyNzA1","avatar_url":"https://avatars1.githubusercontent.com/u/31752705?v=4","gravatar_id":"","url":"https://api.github.com/users/vieyahn2017","html_url":"https://github.com/vieyahn2017","followers_url":"https://api.github.com/users/vieyahn2017/followers","following_url":"https://api.github.com/users/vieyahn2017/following{/other_user}","gists_url":"https://api.github.com/users/vieyahn2017/gists{/gist_id}","starred_url":"https://api.github.com/users/vieyahn2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vieyahn2017/subscriptions","organizations_url":"https://api.github.com/users/vieyahn2017/orgs","repos_url":"https://api.github.com/users/vieyahn2017/repos","events_url":"https://api.github.com/users/vieyahn2017/events{/privacy}","received_events_url":"https://api.github.com/users/vieyahn2017/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-09T07:53:17Z","updated_at":"2018-06-09T10:29:08Z","closed_at":null,"author_association":"OWNER","body":"OpenStack Heat基础介绍\r\nhttp://3ms.huawei.com/km/blogs/details/2501835"},"comment":{"url":"https://api.github.com/repos/vieyahn2017/iBlog/issues/comments/395958145","html_url":"https://github.com/vieyahn2017/iBlog/issues/153#issuecomment-395958145","issue_url":"https://api.github.com/repos/vieyahn2017/iBlog/issues/153","id":395958145,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTk1ODE0NQ==","user":{"login":"vieyahn2017","id":31752705,"node_id":"MDQ6VXNlcjMxNzUyNzA1","avatar_url":"https://avatars1.githubusercontent.com/u/31752705?v=4","gravatar_id":"","url":"https://api.github.com/users/vieyahn2017","html_url":"https://github.com/vieyahn2017","followers_url":"https://api.github.com/users/vieyahn2017/followers","following_url":"https://api.github.com/users/vieyahn2017/following{/other_user}","gists_url":"https://api.github.com/users/vieyahn2017/gists{/gist_id}","starred_url":"https://api.github.com/users/vieyahn2017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vieyahn2017/subscriptions","organizations_url":"https://api.github.com/users/vieyahn2017/orgs","repos_url":"https://api.github.com/users/vieyahn2017/repos","events_url":"https://api.github.com/users/vieyahn2017/events{/privacy}","received_events_url":"https://api.github.com/users/vieyahn2017/received_events","type":"User","site_admin":false},"created_at":"2018-06-09T10:29:08Z","updated_at":"2018-06-09T10:29:08Z","author_association":"OWNER","body":"下面我们一起快速地过一下这个template。\r\n\r\n首先，注意我指定该template的版本为”AWSTemplateFormatVersion”。这边有个让我一开始感到困惑的事情是template格式（CFN和HOT）以及资源类型的之间的关系。事实证明，他们相互独立。就像我在这里所做，你可以在一个CFN template里使用HOT资源类型（例如OS::Neutron::Net）。显然，如果你一旦使用HOT资源类型，你的template将不会跟AWS兼容。如我前面所指出的，CFN template通常使用JSON格式。Heat的确在CFN里支持YAML，但是你需要牺牲AWS兼容性。\r\n你将会注意到我的template跳过参数的使用而直接到Resource（资源）部分。这么做没有任何问题，但是这也意味着直接把一些可变的参数的值（如逻辑路由器向上级联的共享公共网和安全组（Security Group））直接写到template里。\r\nTemplate格式限制某些句法。例如，你注意到例子中使用了”Resources”，“Type”，“Properties”。在其他的一些格式中，这些关键字通常指定为小写字母。\r\n该template定义的第一个资源是逻辑网络，类型为OS::Neutron::Net。\r\n\r\n接下来的资源是子网（类型为OS::Neutron::Subnet）。它通过使用内建函数Ref与之前所定义的逻辑网络进行关联。内建函数是template格式的另一个关键。所以当你想引用一个CFN template里的其他对象时，你就可以像我这样使用内建函数Ref。它将改子网的network ID同之前所定义的逻辑网络进行关联。你应该也已经注意到子网资源(subnet)有很多个与之关联的属性：CIDR，DNS Name Server，DHCP，网关IP地址。\r\n\r\n第三个资源是逻辑路由器。\r\n紧随逻辑路由器定义之后，该template通过一个OS::Neutron::RouterGateway类型的资源把逻辑路由器连接到已经创建好的逻辑网络上。这里列出的UUID是已经创建好的逻辑网络的UUID。请注意又使用了Ref函数把改资源连接到逻辑路由器。\r\n接下来该template在逻辑路由器上创建2个interface，并使用2次Ref把路由器interface连接到逻辑路由器和之前创建的子网。这意味着我们正在给制定子网上的路由器添加interface(而且该interface将使用Subnet里的gateway_ip所定义的IP地址。\r\n然后该template创建了2个Neutron端口（Port），把它们连接到默认的安全组（security group）。请注意如果你再创建Neutron端口时不指定security group，它将没有任何东西，而且没有数据从该端口通过。\r\n\r\n最后，Heat template创建了2个实例（类型为OS::Nova::Server），它使用了m1.xsmall的flavor和写好的 Glance Image ID. 这些实例又一次通过Ref函数连接到之前创建的Neutron端口。"}}
{"actor":{"display_login":"vieyahn2017"}}