Trying to add a disk via the Python API
Using the python API I am attempting to add a disk. I can create the disk and have an object, but I cannot figure out how to get it into the configuration.
I tried modifying the instance.config.devices but it told me that this was not a mutable field of 'Config'.
I then tried setting the actual conf.devices.<driveletter> to the disk object which it took, but then the save doesn't do anything</driveletter>
myconf.devices.sdb = billTest
myconf.devices.sdb
Disk: 107171088
myconf.save(force=False)
False
Any tips?
1 Reply
I'm not too familiar with python, but if you're working with the python library for the Linode API, I think I may have a possible workaround.
I didn't see an option to actually update the current configs, but Linodes can have more than one configuration profile. There is an option to create a new configuration that includes choosing the disks. You should then be able to boot from that configuration.
If I'm too far off base here, feel free to share any documents or guides you used to get you to where you are, we hopefully someone in our Community can use that as a starting point to help you figure out the rest.