https://pulumi.com logo
#general
Title
# general
b

broad-breakfast-56081

08/07/2023, 11:44 AM
Hi All i am facing this issue Exception: Failed to export output. Root resource is not an instance of 'Stack' on calling pulumi.export
f

faint-dusk-41267

08/07/2023, 11:44 AM
Can you send the code snippet?
b

broad-breakfast-56081

08/07/2023, 11:45 AM
yes sure
import pulumi from pulumi_openstack import compute # # Create an OpenStack resource (Compute Instance) instance = compute.Instance('runtest123', flavor_name='m1.large',image_name='FortiOS') # # Export the IP of the instance pulumi.export('runtest123', instance.name) _# pulumi.export('runtest123', instance.access_ip_v4)_
name: "development" runtime: name: "python" options: virtualenv: "venv" description: "war_zone" config: openstackuserName "######" openstackpassword "########" openstackauthUrl "###############" openstacktenantName "development" openstackregion "RegionOne"
this is my YAML file
f

faint-dusk-41267

08/07/2023, 11:46 AM
Please edit it and insert "code block"
b

broad-breakfast-56081

08/07/2023, 11:47 AM
i did'nt get it
what i have to edit
can we connect on a call
f

faint-dusk-41267

08/07/2023, 11:47 AM
Screenshot 2023-08-07 at 14.47.30.png
Copy code
this is the code
the right next to the circle
b

broad-breakfast-56081

08/07/2023, 11:48 AM
import pulumi
from pulumi_openstack import compute
# # Create an OpenStack resource (Compute Instance)
instance = compute.Instance('runtest123', flavor_name='m1.large',image_name='FortiOS')
# # Export the IP of the instance
pulumi.export('runtest123', instance.name)
_`# pulumi.export('runtest123', instance.access_ip_v4)`_
import pulumi from pulumi_openstack import compute # # Create an OpenStack resource (Compute Instance) instance = compute.Instance('runtest123', flavor_name='m1.large',image_name='FortiOS') # # Export the IP of the instance pulumi.export('runtest123', instance.name)
Copy code
# pulumi.export('runtest123', instance.access_ip_v4)
f

faint-dusk-41267

08/07/2023, 11:50 AM
which cloud?
b

broad-breakfast-56081

08/07/2023, 11:50 AM
openstack
did you create a stack?
b

broad-breakfast-56081

08/07/2023, 11:52 AM
no i didnt
i am using the same code you shared above
f

faint-dusk-41267

08/07/2023, 11:53 AM
you can try to create a stack
b

broad-breakfast-56081

08/07/2023, 11:53 AM
how can i do it
can you share any link for same.
f

faint-dusk-41267

08/07/2023, 11:53 AM
pulumi stack ls
pulumi stack init dev
b

broad-breakfast-56081

08/07/2023, 11:54 AM
image.png
f

faint-dusk-41267

08/07/2023, 11:54 AM
ok so you have a stack already
b

broad-breakfast-56081

08/07/2023, 11:55 AM
yes i have
f

faint-dusk-41267

08/07/2023, 11:56 AM
what a command you send via the cli?
try to comment out the export and try with
Copy code
pulumi up -s dev --diff
b

broad-breakfast-56081

08/07/2023, 11:56 AM
pulumi up
i don't want to run it via CLI i want to run it through my code
f

faint-dusk-41267

08/07/2023, 11:58 AM
go for it, just dont forget to comment out the export command and show us the diff
b

broad-breakfast-56081

08/07/2023, 11:59 AM
sure just a sec
f

faint-dusk-41267

08/07/2023, 12:00 PM
Are you sure there is the name as "output"?
b

broad-breakfast-56081

08/07/2023, 12:01 PM
yes
i also changed the name from runtest123 to runtest456
but still after executing my main.py file i am not able to create any instance their
f

faint-dusk-41267

08/07/2023, 12:03 PM
yes but you know the name already so it's meaningless to return the name
b

broad-breakfast-56081

08/07/2023, 12:03 PM
but same if i run using pulumi up then it works
f

faint-dusk-41267

08/07/2023, 12:03 PM
its telling you that there is no "name" as output
only ipv4
b

broad-breakfast-56081

08/07/2023, 12:04 PM
ok i don't want to return the name but when i run my script it should create the instance in my openstack
that is also it's not doing
f

faint-dusk-41267

08/07/2023, 12:05 PM
you should try to destroy the env
and then to try to build it again
b

broad-breakfast-56081

08/07/2023, 12:05 PM
ok i changes it to ipv4
but still its not running
f

faint-dusk-41267

08/07/2023, 12:06 PM
b

broad-breakfast-56081

08/07/2023, 12:06 PM
image.png
yes i did
what's next
should i execute the main.py file
f

faint-dusk-41267

08/07/2023, 12:07 PM
Copy code
pulumi up -s dev --diff
b

broad-breakfast-56081

08/07/2023, 12:08 PM
ok
f

faint-dusk-41267

08/07/2023, 12:09 PM
cool, try to approve it and take a look
b

broad-breakfast-56081

08/07/2023, 12:09 PM
should i hit yes
f

faint-dusk-41267

08/07/2023, 12:10 PM
yes
b

broad-breakfast-56081

08/07/2023, 12:11 PM
should i change the image name and then try it again
Hi you there
f

faint-dusk-41267

08/07/2023, 12:16 PM
ya
ok
b

broad-breakfast-56081

08/07/2023, 12:16 PM
should i press yes
f

faint-dusk-41267

08/07/2023, 12:17 PM
ya
b

broad-breakfast-56081

08/07/2023, 12:20 PM
also if i use only pulumi up it works and creates a instance
but i don't want to do it using pulumi up command
i want it to be executed with my code
f

faint-dusk-41267

08/07/2023, 12:21 PM
i'm sorry i don't have any idea
b

broad-breakfast-56081

08/07/2023, 12:23 PM
no issues thanks for the help and quick response
2 Views