-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Libvirt test create network and storage #1306
base: main
Are you sure you want to change the base?
Libvirt test create network and storage #1306
Conversation
I am thinking of changing how the storage works. The pool type is a directory pool, so I created a directory in /tmp. While the pool itself is destroyed, the directory is not. |
4e9a153
to
f82f30e
Compare
I do not know of a way to cleanly delete the directory of a transient storage pool. I'm thinking I can either:
|
f82f30e
to
3811ede
Compare
Changed it to delete the volumes and just ignore the empty folder in /tmp, but if there are any opinions on if the other ways are better, I would be happy to change it. The reason I don't want to change it to a persistent storage pool is because I'm using its transient status as a way to track whether I should delete it. Otherwise I would need to store some other flag in the libvirt provisioner. Parsing seemed like a slightly more ugly solution to me, but that is not really based on anything. |
3811ede
to
73829ba
Compare
Changed the xml to libvirtxml. |
73829ba
to
52ed1c9
Compare
@@ -135,11 +134,99 @@ func (l *LibvirtProvisioner) CreateVPC(ctx context.Context, cfg *envconf.Config) | |||
) | |||
|
|||
if _, err := l.conn.LookupNetworkByName(l.network); err != nil { | |||
return fmt.Errorf("Network '%s' not found. It should be created beforehand", l.network) | |||
// Check if network is defined, but not enabled | |||
defined_nets, err := l.conn.ListDefinedNetworks() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use camel-case with Go: s/defined_nets/definedNets/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
} | ||
|
||
if sPool, err = l.conn.LookupStoragePoolByName(l.storage); err != nil { | ||
return fmt.Errorf("Storage pool '%s' not found. It should be created beforehand", l.storage) | ||
|
||
defined_storage, err := l.conn.ListDefinedStoragePools() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise
Creates a temporary network when the specified network is undefined. The resulting network will be transient. Its ip will be automatically chosen. Names corresponding to defined but disabled networks will not be created to avoid unintended side-effects. Temporary networks will be destroyed if TEST_TEARDOWN and TEST_PROVISION are set to "yes". Signed-off-by: Derek Lee <[email protected]>
Creates a directory storage pool in /tmp if the storage name given is not enabled and undefined. Delete volumes on exit from temporary storage. Fixes: confidential-containers#1165 Signed-off-by: Derek Lee <[email protected]>
52ed1c9
to
4eeab8f
Compare
@bookinabox hi! I'm getting an error:
|
We talked a bit in slack, and it looks like it is a kcli version difference. I can either set createCluster to explicitly set the api_ip or we can try to set a kcli version specification? |
Relies on: #1244
Creates temporary network and storage if the provided libvirt_network and/or libvirt_storage are not networks/storage pools that are currently enabled.
Destroys network and storage on DeleteVPC (which is triggered when provisioning and teardown are both enabled)