Has anyone successfully connected to the openstack...
# yaml
b
Has anyone successfully connected to the openstack provider on a pc using yaml
o
@broad-raincoat-27115 have you had issues using the openstack provider?
b
@orange-policeman-59119 I have not managed to successfully connect to the openstack provider.
o
What error(s) are you encountering?
b
@orange-policeman-59119 if I try git bash, pulumi thinks I am in non-interactive mode. Errors: None syntactically. Its just when I try and run the pulumi up command, it finishes in 1 second and there is no vm deployed. I am pretty certain its not connecting to the openstack provider. I don't know how I should set the provider on windows.
o
I see, do you have an existing OpenStack cluster/system you're trying to connect to?
& since you mention git bash, are you using Windows by chance?
b
yes , I am using windows. yes I have access to an openstack system but it does not have any internet access. This precludes me using luinix vm's. Additionally, it is a corporate laptop, which means that I do not have full control of it. I do have the ability to give myself admin privileges for a limited period of time
o
Got it, okay, constrained environment & no access to the Windows Subsystem for Linux 2? Could you DM me the output of running
pulumi up --verbose=3
?
& are you using git bash because you have an Openstack credentials file that you're sourcing?
b
tthats why I was trying to do that tes
pulumi up --verbose basically says that it is missing the --verbose command
this is my personal pc , not my corporate laptop . I could copy the message via usb stick but no point when it is not saying anything
The usage says:
pulumi up [template|url] [flags]
o
that is a very old or wrong version of Pulumi, I suspect... what does "pulumi version" say?
b
3.32.1
o
and what does "which pulumi" report? I'm very confused by that usage statement
b
seems its only down by 1 version but was installed from github rather than the installer
o
well, ah, nvm, that is right for running it outside of a Pulumi project
b
yes but that is in a directory , unless you mean the provider directory
I think I will try and reinstall from the windows installer
o
right, I see. taking a step back:
if I try git bash, pulumi thinks I am in non-interactive mode. Errors: None syntactically. Its just when I try and run the pulumi up command, it finishes in 1 second and there is no vm deployed.
Are you running Pulumi against a YAML program or other Pulumi language program that is in a directory?
e.g.: If I run
pulumi up
in a directory, I expect there to be a Pulumi.yaml file in that directory, and if I'm using TypeScript/Java/etc, there will be source code in that directory.
b
Yes . My original problem was that I using openstack syntax instead of pulumi syntax for the openstack application credentials
once I figured that out, I got the syntax correct
so there must be a reason my VM is not being created. Ideally is there a pulumi openstack yaml command that can show me somne of my infrastructure to validate that my connection is good. an equivalent of an openstack server show for instance
o
What resource are you trying to create in OpenStack that should create a VM?
b
name: skeleton-openstack type: pulumiprovidersopenstack runtime: yaml properties: cloud: skeleton-openstack auth_type: v3applicationcredential authUrl: https://api.devops.in.idemia.com:5000 applicationCredentialId: "f687b8d2c3304086b5615ca621b7ee4d" applicationCredentialSecret: "1234567890" region: "poc" compute_api_version: "2.79" insecure: true name: createInstance type: openstackcomputeInstance inputs: accessIPv4: true avaiabilityZone: nova flavorName: m2.micro sourceType: Image imageName: centos-8.2-2004 name: made_by_pulumi
my Pulumni.yaml. My cloud.yaml references skeleton-openstack
o
@broad-raincoat-27115 Oh I think I see where there's some places we could improve our documentation here
Here's just the resource, no config:
Copy code
name: skeleton-openstack
type: pulumi:providers:openstack
runtime: yaml
resources:
  # Pulumi resources are declared under the 
  # "resources" key of the document
  # each resource has a name:
  myComputeInstance:
    # This is the level where you'd set type, properties, ...
    type: openstack:compute:Instance
    properties: 
      accessIPv4: true
      availabilityZone: nova
      flavorName: m2.micro
      sourceType: Image
      imageName: centos-8.2-2004
      name: made_by_pulumi
b
k thanks. I will try that now. I will have to go soon. I have a barking dog who cannot be fed because he has an xray in the morning, and its nearly 9.30pm. Let me just try that change now
o
For configuration, the environment variables you set in git bash should work
The Pulumi way to set config variables however would be something like so:
Copy code
pulumi config set openstack:authUrl $OS_AUTH_URL
pulumi config set openstack:cloud $OS_CLOUD
pulumi config set openstack:region $OS_REGION_NAME
...
And for secrets/passwords, like so:
Copy code
pulumi config set --secret openstack:applicationCredentialSecret $OS_APPLICATION_CREDENTIAL_SECRET
Where
$foo
should be the value of the variable set by your auth command, not the literal string "$foo". Doing this, you should see a
Pulumi.stackName.yaml
file appear, where stackName will be the name of the stack (aka environment). That file will look like:
Copy code
config:
  # unencrypted values appear as-is:
  openstack:authUrl: <https://api.devops.in.idemia.com:5000>
  openstack:cloud: skeleton-openstack 
  # encrypted values will look different:
  openstack:applicationCredentialSecret:
    secure: [redacted]
b
iThanks for your help so fra. I am going to have to leave it at that for now. its past 9.30 pm in the evening here
just one mor ething before I go. I thing I have WSL installed on my corporate laptop. How do I access it
o
If you have WSL, you should be able to run "wsl.exe" from any powershell or command prompt, it may also show as an installed app for the default distribution:
Although I understand changing your practices to use WSL might be a bit out of scope, I can speak highly to its benefits as a Windows laptop using engineer 🙂 Here's a getting started guide for using WSL: https://docs.microsoft.com/en-us/learn/modules/get-started-with-windows-subsystem-for-linux/
Either way, I'm happy to help you figure out what might be going wrong with using OpenStack in Pulumi YAML. If there's a bug or issue with YAML or one of our providers on Windows, we definitely want to figure it out. At the same time, is the company you're with already using Pulumi or are you working on a proof of concept? I ask because beyond bugs, we have folks who are more focused on solutions engineering and they may be the right place to go
b
Hi. Its just a proof of concept at present
Just to klet you know that I have successfully create an openstack instance from a Pulumi.yaml file. The key was indeed to use wsl. . This meant I could source the app credentials
🙌 1
o
@broad-raincoat-27115 glad to hear that!