So I've created a `const f = new vsphere.Folder(.....
# general
So I've created a
const f = new vsphere.Folder(....)
and now I'm trying to use it with `vsphere.getVirtualMachine({ name:
})` but I'm getting
error fetching virtual machine: vm 'Calling [toString] on an [Output<T>] is not supported.
Anyone know how to get the path as a string?
Usually, you would use
with an
(see — but I want to better understand what you’re doing, too. I’m not really familiar with vSphere, but I thought
are an organizational concept for things, which might include VMs. In which case, if you are attempting to
a VM with a certain path, doesn’t that imply the
already exists? If the
already exists, you wouldn’t
it unless you’re also including
so that it’s managed the pulumi stack.
I just got started with Pulumi on Friday so I'm still learning how to use it really. But in this instance, if I deploy a new stack, I want it to create a folder or get it if already exists.
I'm hoping I can then call Packer somehow to stand up a new template and then use that template with some new VirtualMachine calls. The getVirtualMachine call for the template is where I'm trying to use the folder path and appending the template name.
getVirtualMachine requires a full path, I can't specify name and then folder, i have to pass
I think I’m confused how the template
already exists if you’ve just created the folder? If that template already exists, it implies you already know the name of the folder, in which case you shouldn’t need to rely on the output value?
I was hoping to figure out a way to create the template in my pulumi code.
But also yea, I am creating the path dynamically in my code. So I do "know" it already and I can just use the same var I used to create the folder in the getVirtualMachine call. For some reason I thought it'd be better to actually use the path from the actual folder object. But if it doesn't really matter
Yeah, if you know the value, you should just use it there. Typically, you’d want to use the
values when it’s something returned from the API/computed by the provider