powershell命令的Openstack Heat Template输出

时间:2018-05-23 12:43:04

标签: openstack openstack-heat

我使用Powershell命令创建Heat模板,添加部署部分后我的模板没有执行。我已添加此部分以获取命令的输出。我正在使用的显示模板:

import subprocess
from subprocess import Popen, PIPE, STDOUT 
nmap = "nmap"
argumento_nmap = "-p"
port_nmap = "22"
port2_nmap = "2104"
open_port = "open"
closed_port = "closed"
ip_nmap = "localhost"
salida = "stdout.txt"
atributos_salida = "wb"
error = "stderr.txt"
atributos_error = "wb"
lista = Popen([nmap, argumento_nmap, port_nmap,ip_nmap], stdin=PIPE,          stdout=PIPE, stderr=STDOUT, close_fds=True)
resultado = lista.communicate()[0]
print resultado

如果有人尝试过相同的方法或任何其他解决方案,他们可以提供输出从Template执行的powershell命令。

1 个答案:

答案 0 :(得分:1)

user_data_format: SOFTWARE_CONFIG属性下添加OS::Nova::Server行:

instance:
  type: OS::Nova::Server
  properties:
     name: machine2
     flavor: LARGE
     networks:
        - network: 71xxxx85-8a24-475b-9xxc-169xxxxxbb0
     security_groups:
        - default
        - all_open
     block_device_mapping_v2:
        - device_name: /dev/vpa
          volume_id: {get_resource: volume}
          delete_on_termination: "true"
     user_data_format: SOFTWARE_CONFIG

当还有其他资源可用于软件配置时,此行必填。

在输出部分deployent-> deployment

中也有错字
outputs:
  instance_ip:
    description: Ipaddress
    value: { get_attr: [instance,addresses] }
  result:
   description: Checkoutput
   value: { get_attr: [deployment] }

注意:在space之后和{之前添加}。例如:

 { get_resource: volume }