Python Azure SDK: create multiple VMs in the same cloud service -
i trying create multiple vms in same cloud service (but in unique deployments within cloud service). below produces 1 machine have name mycluster-master-3 (given self.nummasters == 3). in other words, last machine created , can seen in azure management portal. note there no errors when execute code self.nummasters == 3:
for node in range(self.nummasters): logger.info('deploying virtual machine "%s"...' % (self.clustername + '-master-' + str(node + 1))) logger.info('creating linuxconfig...') linuxconfig = azure.servicemanagement.linuxconfigurationset( host_name=self.clustername + '-master-' + str(node + 1), user_name='auser', user_password='auser123!', disable_ssh_password_authentication=true ) # destination storage account container/blob vm disk # created media_link = 'https://xxxxxxx.blob.core.windows.net/xxxxxx/%s.vhd' % (self.clustername + '-master-' + str(node + 1)) os_hd = azure.servicemanagement.osvirtualharddisk(image_name, media_link) logger.info('creating virtual machine deployment...') self.sms.create_virtual_machine_deployment( service_name=servicename, deployment_name=self.clustername + '-master-' + str(node + 1), label=self.clustername + '-master-' + str(node + 1), role_name=self.clustername + '-master-' + str(node + 1), system_config=linuxconfig, os_virtual_hard_disk=os_hd, role_size=self.instancetype, deployment_slot='production' )
i thought having vms in 1 cloud service allow them talk each other internally without being exposed machines in other cloud services. apparently, cloud service provides single public ip vm within it. perhaps that's why 1 vm created, although, conceptually, thought single cloud service can have multiple vm instances. confuses hell out of me. thinking need have 1 cloud service each vm instance in cluster. way, of machines have public ip , can accessed on internet. need put cloud services within virtual network. way, traffic between them not routed through internet. assumption correct? there better/other way accomplish want (a cluster of machines talking each other securely , fast, yet ssh-able through internet.)
first of - if creating cluster, not put vms in separate cloud services. please read thouroughly article: manage availbility of virtual mchines.
then main topic: multiple vms can , should deployed same cloud service when serve common purpose (building cluster).
vms in same cloud service can talk each other without going internet , without need special, beside opening firewalls on vms themselfs.
for how name resolution works in azure whole, can read following article: name resolution vm , role instances.
one vip per cloud service - so. why should issue? please elaborate on reason require multiple vip (public ip addresses) single cloud service (your cluster). following article give idea different options load balancing clustered vms: load balancing virtual machines.
on how configure ssh per-vm access, can create endpoints vms different public ports.
last, not least, reasony why end 1 vm created. can create 1 vm in cloud service at time. cannot create second vm in same cloud service while first 1 still being created. so, creation of vm1 should 100% complete, can create second vm in same cloud service.
Comments
Post a Comment