Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Cannot create a new VM endpoint if the VM is part of a Virtual Network #543

Closed
tomconte opened this Issue May 21, 2013 · 13 comments

Comments

Projects
None yet
6 participants
Member

tomconte commented May 21, 2013

(this works fine using the Portal, go the the VM Endpoints tab and add the endpoint)

$ azure vm endpoint create mycdh 8888
info: Executing command vm endpoint create

  • Fetching VM
  • Reading network configuration
  • Updating network configuration
    error: Subnet name(s) belonging to role mycdh cannot be changed during deployment update or upgrade.
    info: Error information has been recorded to azure_error
    error: vm endpoint create command failed

tom@tombuntu:~$ cat azure_error
Tue May 21 2013 12:46:28 GMT+0000 (UTC):
{ [Error: Subnet name(s) belonging to role mycdh cannot be changed during deployment update or upgrade.] code: 'BadRequest' }
Error: Subnet name(s) belonging to role mycdh cannot be changed during deployment update or upgrade.
at Object.ServiceClient._normalizeError (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/serviceclient.js:701:23)
at Object.ServiceClient._processResponse (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/serviceclient.js:350:32)
at Request.processResponseCallback as _callback
at Request.self.callback (/usr/local/lib/node_modules/azure-cli/node_modules/azure/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request. (/usr/local/lib/node_modules/azure-cli/node_modules/azure/node_modules/request/index.js:876:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage. (/usr/local/lib/node_modules/azure-cli/node_modules/azure/node_modules/request/index.js:827:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:895:16

Sounds like you just have to wait because it's performing an operation ?

Member

tomconte commented May 21, 2013

I think the error message is misleading, as I had no operations ongoing at
that time. When I tried on the portal, it just worked immediately. I then
tried later the command with a different port and received the same error...

On Tue, May 21, 2013 at 2:51 PM, André Rodrigues
notifications@github.comwrote:

Sounds like you just have to wait because it's performing an operation ?


Reply to this email directly or view it on GitHubhttps://github.com/WindowsAzure/azure-sdk-tools-xplat/issues/543#issuecomment-18206456
.

Thomas Conté.

I see. This error actually comes out from the endpoint, so i suspect the portal will show the same in the same conditions. Closing this issue then.

@andrerod andrerod closed this May 21, 2013

Member

tomconte commented May 21, 2013

Hi André, this may be indeed a temporary condition but I have tried many times and always receive the same error, whereas it works every time on the portal. I have deleted everything and tried from scratch and received the same error, if you want to try to repro ...

  • Using the portal, create an Affinity Group "mytestag"
  • Import a Virtual Network Configuration from the Portal, here is the one I used:
<NetworkConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration">
    <VirtualNetworkConfiguration>
      <Dns>
        <DnsServers>
          <DnsServer name="mydns" IPAddress="10.0.0.4" />
        </DnsServers>
      </Dns>
      <VirtualNetworkSites>
        <VirtualNetworkSite name="mytestvn" AffinityGroup="mytestag">
          <AddressSpace>
            <AddressPrefix>10.0.0.0/20</AddressPrefix>
          </AddressSpace>
          <DnsServersRef>
            <DnsServerRef name="mydns" />
          </DnsServersRef>
          <Subnets>
            <Subnet name="Subnet-1">
              <AddressPrefix>10.0.0.0/23</AddressPrefix>
            </Subnet>
          </Subnets>
        </VirtualNetworkSite>
      </VirtualNetworkSites>
    </VirtualNetworkConfiguration>
  </NetworkConfiguration>
  • Create a Storage Account in Affinity Group "mytestag" (I did it via the Portal too) ... The CLI tool fails if it doesn't exist.
  • Create the VM using the command line: (you may need to change the SSH config)
azure vm create --virtual-network-name mytestvn --subnet-names Subnet-1 --affinity-group mytestag --vm-size small --ssh 22 --ssh-cert ./myCert.pem mytestvm42 b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130415-en-us-30GB tom 'password'
  • Then try to add an endpoint:
azure vm endpoint create mytestvm42 8888

I don't understand why it complains about changing a Subnet name, as I am only trying to add an endpoint.

misunderstood you then. I thought it now worked. Reopenning then.

@andrerod andrerod reopened this May 21, 2013

Member

tomconte commented Jun 3, 2013

It works from PowerShell (same VM as above):

PS C:\> Get-AzureVM -ServiceName mycdh -Name "mycdh" | Add-AzureEndpoint -Name "test" -Protocol "tcp" -PublicPort 9999 -LocalPort 9999 | Update-AzureVM
VERBOSE: 2:55:36 PM - Begin Operation: Get Deployment
VERBOSE: 2:55:38 PM - Completed Operation: Get Deployment
VERBOSE: 2:55:38 PM - Begin Operation: Get Deployment
VERBOSE: 2:55:39 PM - Completed Operation: Get Deployment
VERBOSE: 2:55:39 PM - Begin Operation: Update-AzureVM
VERBOSE: 2:56:43 PM - Completed Operation: Update-AzureVM

OperationDescription                    OperationId                             OperationStatus
--------------------                    -----------                             ---------------
Update-AzureVM                          2c681137-572f-440b-a8ba-12e6c0cb9ff1    Succeeded

PS C:\> Get-AzureVM -ServiceName mycdh -Name mycdh | Get-AzureEndpoint
VERBOSE: 2:57:26 PM - Begin Operation: Get Deployment
VERBOSE: 2:57:27 PM - Completed Operation: Get Deployment

LBSetName              :
LocalPort              : 9999
Name                   : test
Port                   : 9999
Protocol               : tcp
Vip                    : 137.135.131.152
ProbePath              :
ProbePort              : 0
ProbeProtocol          :
ProbeIntervalInSeconds :
ProbeTimeoutInSeconds  :

Member

tomconte commented Jun 3, 2013

I have tracked down the problem to the azure service management serialization function for the network configuration XML in servicemanagementserialize.js. Will work on integrating the fix to the azure-node-sdk project...

Member

tomconte commented Jun 3, 2013

Here is the fix in my dev branch for azure-sdk-for-node:

https://github.com/tomconte/azure-sdk-for-node/commit/5b119bb2be600069582ab4ba1d220d867f8188e2

@andrerod do you want me to send a pull request?

andrerod commented Jun 3, 2013

That would be appreciated yes :) Feel free to.

Contributor

babumuralidharan commented Jul 30, 2013

Verified. Working as expected.

@guangyang guangyang closed this Aug 5, 2013

prateek commented May 16, 2014

$ azure vm endpoint create name 8888

Still fails for me on version 0.8.2

Contributor

babumuralidharan commented May 16, 2014

@prateek, can you print the error what you are getting ? Also can you upgrade your cli installer to latest release 0.8.3 and try the same?

ebuildy commented May 25, 2015

Actually this is more an Azure API error, since all client SDK have this issue ;-( I am trying to patch the ruby SDK with the fix posted in NodeJS SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment