Giter Club home page Giter Club logo

Comments (69)

phantium avatar phantium commented on September 1, 2024 1

The build has finished succesfully now!

Build 'ddcloud-customerimage' finished.

==> Builds finished. The artifacts of successful builds are:
--> ddcloud-customerimage: Customer image 'Ubuntu 16.04 test' ('ea3e0f47-d598-4135-8943-0f5b60c11d67') in datacenter 'EU7'.

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024 1

No worries! Glad to be able to help test it! In fact used to do a lot of testing for companies, and worked in software development myself.

I'll test if the image deploys now, I didn't do much to it besides install python and run Ansible debug returning which network it's in.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Hi looks like it should work - I'll check this out first thing tomorrow (am in AU and it's almost bedtime)

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Ok, had a glance at the code and it looks like you've hit a bug - will sort it out first thing tomorrow; sorry for the inconvenience :)

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Thank you!

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

No problem :)

In the meanwhile, would you mind running packer again with the following environment variables set and then attaching the resulting log file to this issue? I'm off to bed but will have a look tomorrow.

export PACKER_LOG=1
export PACKER_LOG_PATH=$PWD/packer.log
export MCP_EXTENDED_LOGGING=1

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

packer.log

I have installed your latest release beta4 which shows that it is unable to find an OS Image or Customer Image named Debian9-base. Which I did upload as a customer image.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

From the log, it looks like the CloudControl API says there is no image, but I suspect that this relates to guest OS customisation (older API doesn't return images with GOC disables), had to deal with this in our Terraform provider a while back. Will check it out tomorrow

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Ok, I'm going to try updating to the current version of the CloudControl client library (should be able to see images that have GOC disabled) and rebuild. Will post here when a new release is out.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Ok, so I'm about to create the release (thanks for bearing with me). This won't actually fix your problem but will at least confirm for us that the problem relates to the newer style of images (where you can disable GOC). If that's the case, it should only take a couple of hours to implement.

Sorry about that, BTW - it looks like a case of our Packer plugins not keeping up with new features in CloudControl (I didn't realise anyone was using the plugins, but if you are then I'm happy to keep them up to date).

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Ok @phantium, could you try running v1.0.3-beta5 with logging and posting the log, please?

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

I have run beta5, it seems to work alright. But cleanup on failure goes wrong.
I still have a network issue as ddcloud does not seem to support DHCP for some reason, hoping to figure out how to get around that...

packer.log

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Yeah, they don't support DHCP unfortunately - I've been caught out by that one too 😁

Fortunately, I wrote a service that'll do what you want:

https://github.com/DimensionDataResearch/mcp2-dhcp-server

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

(sorry, I know it's slightly more awkward than native support within CloudControl but once it's set up, it's pretty much set-and-forget)

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

(just turn off PXE / iPXE features as needed)

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Thanks 👍

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

No worries - give us a yell if you have any trouble with it.

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

I am a bit disappointed as to needing to run a VM with a DHCP server in order to deploy VMs naturally.
How do the Dimension Data images work to circumvent this?

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Yeah, it's not the best :-/

As I understand it (I'm not part of the team that does the MCP and CloudControl), CloudControl uses VMWare's Guest OS Customisation facility to achieve configuration of stuff like IP addresses (more here and distro support matrix here).

When you initially imported your image, were you presented with a choice to enable / disable guest OS customisation? I could be wrong, but if not then you might be using a distro that VMWare doesn't know how to customise.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

I'll reach out to the relevant team to confirm this, BTW.

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Thanks I'll give that a try, yes I did disable guest OS customisation as I did not have vmware tools installed.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Ah, sorry, just looked through the support matrix myself - looks like Debian is supported, but not for GOC :(

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

So if you're using Debian, you'll probably need either DHCP or static IPs baked into the image (yuck).

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

I tried to fake it being Ubuntu 16.04 instead, giving the following error:

ddcloud-customerimage output will be in this color.

    ddcloud-customerimage: Resolving datacenter 'EU7'...
    ddcloud-customerimage: Resolved datacenter 'EU7'.
    ddcloud-customerimage: Deploying server 'packer-build-bddaa7002f' in network domain 'develop' ('e7e74af0-6dcd-41a9-8c12-9e60ad24c6a5')...
==> ddcloud-customerimage: Request to deploy server 'packer-build-bddaa7002f' failed with status code 400 (INVALID_INPUT_DATA): administratorPassword must not be provided if the imageId corresponds to a Linux Customer Image or Windows 2003 Customer Image.
Build 'ddcloud-customerimage' errored: unexpected EOF

==> Some builds didn't complete successfully and had errors:
--> ddcloud-customerimage: unexpected EOF

Not quite sure what this is supposed to mean.

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

I did not provide "initial_admin_password" as part of the builder in Packer.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Ah - ok, that might be a bug (or undefined behaviour at least); let me have a look.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Creating a new release now...

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Ok, would you mind giving it one more try on beta7 (with logging)?

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

packer.log
Issue is still present unfortunately.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

LOL ok, sorry, I know what the problem is now. Give me a minute.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Creating a new release (sorry about this, but I think we've got it right this time)...

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

(it's been close to 12 months since I've touched this codebase and it's taking me a while to get familiar with the design again)

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

https://github.com/DimensionDataResearch/packer-plugins-ddcloud/releases/tag/v0.1.3-beta8

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Thanks! It seems to be doing something right now.

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Right now my VM is stuck on "Wait for Guest Ip Address"

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Hmm - you may need to follow these instructions to make sure the original source image is customisation-compatible.

I'm not sure if you actually need open-vm-tools or equivalent to be present in the image...

You could also try just deploying a server from the source image and then logging into the console to see the effects of customisation (assuming the image was marked as supporting customisation) and whether the server boots correctly at all.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Probably worth seeing if a server deployed via the UI from that source image boots correctly; it would at least make it easier to see what IP it winds up with (otherwise, perhaps the DHCP option may wind up being easier to use).

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Thanks for the help so far. I am still trying to figure out why the IP is not assigned, would be nice if someone from Dimension Data could tell me what's causing the it.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Hi, sorry to hear you're still having problems :-/

I think the best way to get support on this is to try deploy your image using the UI and then log a new ticket that doesn't mention Packer but just the server deployment problem(s). That way it'll get routed to the right people.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

I take it following the instructions in that page I linked didn't help?

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

If the deployment fails I can probably show you how to use curl or httpie to view the full server details (including reason for failure) via the CloudControl API, which may help the CloudControl folks diagnose the issue...

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

If you could provide me with that info, that would be most helpful. Thanks!

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Sure - no problem:

Do you prefer curl, HTTPie, or POSTMAN (personally I prefer HTTPie or POSTMAN but any of those is fine)?

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

I prefer httpie or postman as well.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Try this:

http get 'https://api-EU.dimensiondata.com/caas/2.5/{orgId}/server/server/{serverId}' Accept:application/json --auth-type basic --auth 'user:password'

Where {orgId} is, from the logs, 799dda5b-93ba-411c-a2a3-61c4c6e20c54, and {serverId} is the Id of the server (you can see that in the CloudControl UI).

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Thanks, that resulted in giving me the following information.

    "progress": {
        "action": "DEPLOY_SERVER",
        "numberOfSteps": 14,
        "requestTime": "2017-11-09T07:54:52.000Z",
        "step": {
            "name": "WAIT_FOR_GUEST_IP_ADDRESS",
            "number": 11
        },
        "updateTime": "2017-11-09T08:29:00.000Z",
        "userName": "x"
    },

Doesn't really say why, but I guess I should make a ticket with this information.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Yeah - that part of the process is a little opaque, but essentially it means that the server has booted but has not picked up the configured IP address. I believe the customisation process modifies stuff in /etc and if your distro has unexpected stuff in there it may not be successful in doing so. I'd say at this stage yes, the best option is to raise a ticket; someone with knowledge of the system internals will need to take a look at it.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

BTW, you can see a list of the steps and what they do here (search for "Guest OS Customization Server Deployment Process").

(sorry I couldn't more directly helpful but I have no deeper access to the system than you do)

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

BTW, it looks you do need to have VMWare tools or open-vm-tools installed for GOC to work correctly.

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

I did have them installed, I am seeing the following issue still when using Ubuntu 16.04 as a base image.

    ddcloud-customerimage: Destroying server 'packer-build-c2da04e43b' ('6a2c6ef9-ddd0-4e41-88a5-0717e9ae7053')...
==> ddcloud-customerimage: Request to delete server failed with unexpected status code 400 (SERVER_STARTED): Server with id 6a2c6ef9-ddd0-4e41-88a5-0717e9ae7053 is started but must be stopped to perform this operation. Please Power Off or Shutdown the Server (as appropriate) and try again.
Build 'ddcloud-customerimage' errored: unexpected EOF

Could you make it so that it forces deletion or stops and then deletes?

It causes Packer to fail.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Oops, I would have though it would already do that - I'll look into it first thing tomorrow. Thanks for sticking with it!

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

I've made the change (turns out it was done correctly in another step, but not this one), but have to get to bed; will create a release as soon as I wake up (sorry about that).

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Never mind - just created beta9 release. Go for it. Will be back online tomorrow morning :)

PS. If you still have any problems, attach a log and I'll see what's going on.

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Thanks!! Sleep well :)

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

packer.log
Getting a segmentation fault now.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

😭

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Believe it or not, we're making progress! The server deploy / destroy is working now and it's the destroying the firewall rule that is causing problems. Looking into it now.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Turns out the code path for use_private_ipv4 hasn't been used before and it was trying to delete a non-existent firewall rule. Fixing now.

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Right, beta10 is ready to go - fingers crossed this is the last release you'll have to try.

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Thanks, sorry for the lack of response. You are a day ahead of us and by the time you are at work I am home and unable to run Packer. 😄 I am running it now and waiting for the results!

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

No worries - I'm used to the time-zone thing and besides, it seems like you're the one who's having to wait for me rather than the other way around :)

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Sorry again for all the trouble; I built this more than a year ago, and nobody used it so it didn't receive much testing. I'll give it a little love in the coming months if I can (will probably get it merged into Packer as a built-in module).

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

(let me know if the image deploys successfuly, BTW)

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

If it helps, BTW, there's a libcloud driver for CloudControl, and some (rather basic because we've had a couple of PRs stuck in limbo for a while) Ansible modules for it too.

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Haven't heard of it before, what is it's use case?

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Libcloud's a Python library that provides an abstraction over most of the cloud providers out there. If you can write Python it's not a bad way to automate things (it's how we wrote those Ansible modules, for example).

https://docs.mcp-services.net/display/LPC/LibCloud+Python+Client

from packer-plugins-ddcloud.

phantium avatar phantium commented on September 1, 2024

Ah cool, thanks I'll give it a look! Yes I do write Python.. for quite a few years already, but you probably checked my profile? 👍

from packer-plugins-ddcloud.

tintoy avatar tintoy commented on September 1, 2024

Yep, that's why I suggested it 😉

from packer-plugins-ddcloud.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.