Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jeremy Collins
    @beetlebugorg
    And I'm making an assumption that this VM is a static instance definition and not part of any autoscale type resources.
    ErikBZ
    @ErikBZ
    let me check on that
    Todd Loisel
    @tloisel1
    the plugin updates data-disks and custom-data fields
    ErikBZ
    @ErikBZ
    yeah it's just a static instance. There doesn't seem to be any inconsistencies between the config and the resource
    Jeremy Collins
    @beetlebugorg
    Do you define a public ip on your vm?
    (I'm not super familar with vm on azure)
    I wonder if that implementation is correct.
    ErikBZ
    @ErikBZ
    Yeah. public ips are a different resource and we our VM referencing it. There is also a publicIpAdresssIp field which is set correctly in pendingDiffables
    Jeremy Collins
    @beetlebugorg
    Can you paste the snippet of your VM config with the public ip reference + the public ip resource config?
    I think I might know what is happening
    findById always returns an object even if it doesn't find one. So if PrimaryPublicIPAddressId is set but by something not managed by Gyro, it'll create an "empty" resource with that as the id.
    ErikBZ
    @ErikBZ
    oh i was mistaken, VM references Network Interface and that references Public IP
    Jeremy Collins
    @beetlebugorg
    And my guess is the VM is being created with a public ip but you don't define that as a separate resource.
    can you paste a snippet
    ErikBZ
    @ErikBZ
        azure::public-ip-address $(box-name)
            name: "$(project)-v$(serial)-$(box-name)"
            resource-group: $(resource-group)
            idle-timeout-in-minute: 4
            sku-type: 'STANDARD'
        end
    
        azure::network-interface $(box-name)
            name: "$(project)-v$(serial)-$(box-name)"
            resource-group: $(resource-group)
            network: $(network)
            subnet: $(subnet)
            security-group: $(security-group)
    
            nic-ip-configuration
                name: 'primary'
                public-ip-address: $(azure::public-ip-address $(box-name))
            end
        end
    
        azure::virtual-machine virtual-machine
            resource-group: $(resource-group)
            network: $(network)
            subnet: $(subnet)
            os-type: "linux"
            network-interface: $(azure::network-interface $(box-name))
            vm-image-type: "custom"
            custom-image: $(image-id)
            admin-user-name: "ubuntu"
            ssh: $(public-ssh-key)
            caching-type: "NONE"
        end
    here you go
    Jeremy Collins
    @beetlebugorg
    Thanks
    My next question would be does the value of virtualMachine.getPrimaryPublicIPAddressId() match the id of azure::public-ip-address $(box-name) (in state)?
    Might need to stop the debugger to grab that since I don't think the id is exposed by Gyro.
    Jeremy Collins
    @beetlebugorg
    Either way, something feels off about the implementation of publicIpAddress in this case.
    I think a quick fix would be to reverse the implementation of getGyroInstancePublicIpAddress though, so that it looks at the string field first, then the subresource. That seems more correct.
    ErikBZ
    @ErikBZ
    I just clicked around and it seems virtualMachine.getPrimaryPublicIPAdresssId()returned the correct Id. I can update the the getGyroInstance method to check the string first
    Todd Loisel
    @tloisel1
    Deepanjan Bhattacharyya
    @deepanjan90
    Add to queue for review.
    ErikBZ
    @ErikBZ
    Deepanjan Bhattacharyya
    @deepanjan90
    Also added to the queue
    Todd Loisel
    @tloisel1
    what's the best way to check the existence of a field in an @if statement?
    i.e. @if $(reference).field != null
    Jeremy Collins
    @beetlebugorg
    @if $(reference).field will check for null
    aws::instance instance-example
        ami: 'ami-0fc20dd1da406780b'
        instance-type: 't2.micro'
        key: 'example'
    
        tags: {
            "Name": "example"
        }
    end
    
    @if $(aws::instance instance-example).user-data
        @print: "has userdata"
    @end
    
    @if $(aws::instance instance-example).tags
        @print: "has tags"
    @end
    This will print has tags
    Todd Loisel
    @tloisel1
    :thumbsup: thanks
    Deepanjan Bhattacharyya
    @deepanjan90
    Deepanjan Bhattacharyya
    @deepanjan90
    Todd Loisel
    @tloisel1
    has anybody seen this error?
    ↓ Loading plugin: gyro:gyro-aws-provider:0.99.1-SNAPSHOT
    ↓ Loading plugin: gyro:gyro-brightspot-plugin:0.99.1-SNAPSHOT
    ↓ Loading plugin: gyro:gyro-ssh-plugin:0.99.1-SNAPSHOT
    ⟳ Refreshed resources: 291
    
    Error: null
    
    Caused by: Unexpected error: java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/exc/InputCoercionException
        at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.createTreeDeserializer(BasicDeserializerFactory.java:1513)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:409)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
        at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
        at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:476)
        at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4389)
        at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4250)
        at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2711)
        at gyro.aws.ec2.EndpointResource.getProcessedPolicy(EndpointResource.java:313)
        at gyro.aws.ec2.EndpointResource.getPolicy(EndpointResource.java:223)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at gyro.core.Reflections.invoke(Reflections.java:126)
        at gyro.core.resource.DiffableField.getValue(DiffableField.java:154)
        at gyro.core.scope.NodeEvaluator.copy(NodeEvaluator.java:562)
        at gyro.core.scope.NodeEvaluator.lambda$visitResource$35(NodeEvaluator.java:523)
        at java.base/java.util.Optional.ifPresent(Optional.java:183)
        at gyro.core.scope.NodeEvaluator.visitResource(NodeEvaluator.java:523)
        at gyro.core.scope.NodeEvaluator.visitResource(NodeEvaluator.java:81)
        at gyro.lang.ast.block.ResourceNode.accept(ResourceNode.java:55)
        at gyro.lang.ast.NodeVisitor.visit(NodeVisitor.java:37)
        at gyro.core.scope.NodeEvaluator.lambda$evaluateBody$31(NodeEvaluator.java:341)
        at gyro.core.scope.Defer.execute(Defer.java:50)
        at gyro.core.scope.NodeEvaluator.evaluateBody(NodeEvaluator.java:341)
        at gyro.core.scope.NodeEvaluator.visitFile(NodeEvaluator.java:424)
        at gyro.core.scope.NodeEvaluator.visitFile(NodeEvaluator.java:81)
        at gyro.lang.ast.block.FileNode.accept(FileNode.java:32)
        at gyro.lang.ast.NodeVisitor.visit(NodeVisitor.java:37)
        at gyro.core.scope.NodeEvaluator.lambda$evaluateBody$31(NodeEvaluator.java:341)
        at gyro.core.scope.Defer.execute(Defer.java:50)
        at gyro.core.scope.NodeEvaluator.evaluateBody(NodeEvaluator.java:341)
        at gyro.core.scope.NodeEvaluator.evaluate(NodeEvaluator.java:325)
        at gyro.core.scope.RootScope.evaluate(RootScope.java:325)
        at gyro.core.command.AbstractConfigCommand.doExecute(AbstractConfigCommand.java:136)
        at gyro.core.command.AbstractCommand.execute(AbstractCommand.java:71)
        at gyro.cli.Gyro.run(Gyro.java:195)
        at gyro.cli.Gyro.main(Gyro.java:76)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.
    Jeremy Collins
    @beetlebugorg
    I have not.
    Possibly a classloader issue? Can you change the order of your plugins and try again?
    (We have an unmerged PR to resolve this if it's the issue)
    Todd Loisel
    @tloisel1
    that appears to be the case
    Jeremy Collins
    @beetlebugorg
    Do you have time to test it against this PR? perfectsense/gyro#245
    Todd Loisel
    @tloisel1
    didn't fix it
    Jeremy Collins
    @beetlebugorg
    To be clear, moving around plugins did fix it?
    Todd Loisel
    @tloisel1
    correct. moving the plugins in certan order fixed the issue. Then I used gyro from the PR branch, and moved the plugins back to their original order and got the same error as above
    Jeremy Collins
    @beetlebugorg
    Ok, @alex-lambrides probably worth seeing if this PR can be modified to fix this issue.
    alex-lambrides
    @alex-lambrides
    :thumbsup: Looking into it now