Hi,
I could successfully create one VM via REST API. So still not understanding the domain model completely I tried to create multiple roles with one deployment:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Name>dirktest5</Name><DeploymentSlot>Production</DeploymentSlot><Label>TestLabel1</Label><RoleList><Role><RoleName>TestRoleName</RoleName><RoleType>PersistentVMRole</RoleType><ConfigurationSets><ConfigurationSet i:type="LinuxProvisioningConfigurationSet"><ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType><HostName>uwitest1</HostName><UserName>uwi1</UserName><UserPassword>secret1234!$</UserPassword></ConfigurationSet><ConfigurationSet i:type="LinuxProvisioningConfigurationSet"><ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType><HostName>uwitest2</HostName><UserName>uwi1</UserName><UserPassword>secret1234!$</UserPassword></ConfigurationSet></ConfigurationSets><OSVirtualHardDisk><DiskLabel>dirktest5</DiskLabel><MediaLink>https://portalvhdsb8yhw1q41fnxj.blob.core.windows.net/vhds/dirktest5.vhd</MediaLink><SourceImageName>CentOS7-Minimal</SourceImageName></OSVirtualHardDisk><RoleSize>Small</RoleSize></Role></RoleList></Deployment>
Answer was too many roles :
<Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>BadRequest</Code><Message>An invalid number of roles was found in the role collection. Expected number of roles is 1, but the number found in the collection is 2.</Message></Error>
My guessing was that the RoleList could contain more than one elements (What it does when you call a get).
Is there an efficient way to create multiple machines in one deployment?
best regards,
Uwe