Node.js 使用节点SDK从映像创建azure VM
我正在尝试使用azure sdk()根据已保存的映像创建虚拟机。我也已经创建了服务 以下是我得到的:Node.js 使用节点SDK从映像创建azure VM,node.js,azure,virtual-machine,Node.js,Azure,Virtual Machine,我正在尝试使用azure sdk()根据已保存的映像创建虚拟机。我也已经创建了服务 以下是我得到的: // Create a virtual machine in the cloud service. computeManagementClient.virtualMachines.createDeployment('prerender-pro', { name: "prerender-pro", deploymentSlot: "Production", label: "for he
// Create a virtual machine in the cloud service.
computeManagementClient.virtualMachines.createDeployment('prerender-pro', {
name: "prerender-pro",
deploymentSlot: "Production",
label: "for heavy duty caching",
roles: [{
roleName: "prerender-pro",
roleType: "PersistentVMRole",
label: "for heavy duty caching",
oSVirtualHardDisk: {
sourceImageName: "prerender-os-2014-07-16",
mediaLink: "https://XXXXXXX.blob.core.windows.net/vhds/prerender-os-2014-07-16.vhd"
},
dataVirtualHardDisks: [],
configurationSets: [{
configurationSetType: "LinuxProvisioningConfiguration",
adminUserName: "Blah",
adminPassword: "Blahblah2014!",
computerName: 'prerender-pro',
enableAutomaticUpdates: true,
resetPasswordOnFirstLogon: false,
storedCertificateSettings: [],
inputEndpoints: []
}, {
configurationSetType: "NetworkConfiguration",
subnetNames: [],
storedCertificateSettings: [],
inputEndpoints: [{
localPort: 3389,
protocol: "tcp",
name: "RemoteDesktop"
}]
}]
}]
}, function (err, result) {
if (err) {
console.error(err);
} else {
console.info(result);
}
});
我得到的错误是这个。我几乎完全遵循github自述中的示例。不知道为什么这是一个问题
{ [Error: A computer name must be specified.]
code: 'BadRequest',
statusCode: 400,
requestId: '9206ea1e591eb4dd8ea21a9196da5d74' }
谢谢 结果是错误消息不准确。在部署Linux实例时,定义配置集时只需要“主机名”。“ComputerName”仅适用于Windows实例。下面是C代码的一个示例:
这不应该是一个答案。这不是在解决问题。请使用评论部分进行此类干预:)@morgs32:我现在面临着同样的问题,你知道问题出在哪里了吗?@xcoder37这是一个合法的问题。我不确定它是否被修好了。我最终没有了它。
ConfigurationSet configSet = new ConfigurationSet
{
HostName = "VMTest",
UserName="xxxxx",
UserPassword="xxxx",
ConfigurationSetType = ConfigurationSetTypes.LinuxProvisioningConfiguration
}