close
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: apache/libcloud
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: trunk
Choose a base ref
...
head repository: ByteInternet/libcloud
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: byte
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 5 files changed
  • 3 contributors

Commits on Oct 30, 2019

  1. OpenStack v2 create_volume can create bootable vol

    This PR adds `ex_image_ref` to create_volume for the
    OpenStack_2_NodeDriver. This allows the user to create
    bootable volumes based on machine images. When the UUID
    of an image is passed as ImageRef it will create a bootable
    volume from which later an instance can be launched. This is
    helpful because for older versions of OpenStack it is not
    possible to create an instance with a block device mapping
    where the newly created volume has to be put in a availability
    zone that is not the default.
    
    More info about bootable volumes at https://docs.openstack.org/api-ref/block-storage/v2/index.html?expanded=create-volume-detail#volumes-volumes
    
    > To create a bootable volume, include the UUID of the image from which
    > you want to create the volume in the imageRef attribute in the request
    > body.
    vdloo committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    dca5908 View commit details
    Browse the repository at this point in the history
  2. openstack driver can create node from bootable vol

    Currently it is not possible to use the create_node method without
    specifying an image. This is because in the OpenStack_1_1_NodeDriver
    create_node converts the server_params like:
    
    ```
    server_params = self._create_args_to_params(None, **kwargs)
    ```
    
    but in case when there is no image to boot from like when you are
    booting from an already existing bootable volume (which could have been
    created from an image earlier), then _create_args_to_params will try to
    access node.extra in order to get the imageRef, and node is None:
    
    ```
            if 'image' in kwargs:
                server_params['imageRef'] = kwargs.get('image').id
            else:
                server_params['imageRef'] = node.extra.get('imageId')
    ```
    
    Booting an instance from a previously existing bootable volume like this
    would fail:
    
    ```
    In [36]: conn.create_node(ex_availability_zone='R123', port='8487d948-0840-4205-8b31-7f705a19e7f4', name='r123apitestnode', ex_keyname
        ...: ='rick', size='e55a2688-ef74-44cf-b302-9a6f960c3d74', ex_blockdevicemappings=[{'boot_index': 0, 'uuid': 'be7ee330-b454-4414-8
        ...: e9f-c70c558dd3af', 'source_type': 'volume', 'destination_type': 'volume', 'delete_on_termination': False}])
    ```
    
    with:
    ```
    /usr/local/venv/hypernode-control/src/apache-libcloud/libcloud/compute/drivers/openstack.pyc in _create_args_to_params(self, node, **kwargs)
       1495             server_params['imageRef'] = kwargs.get('image').id
       1496         else:
    -> 1497             server_params['imageRef'] = node.extra.get('imageId')
       1498
       1499         if 'size' in kwargs:
    
    AttributeError: 'NoneType' object has no attribute 'extra'
    ```
    
    This could be circumvented by specifying `image=''`:
    ```
    In [39]: conn.create_node(ex_availability_zone='R123', port='8487d948-0840-4205-8b31-7f705a19e7f4', image='', name='r123apitestnode',
        ...: ex_keyname='rick', size='e55a2688-ef74-44cf-b302-9a6f960c3d74', ex_blockdevicemappings=[{'boot_index': 0, 'uuid': 'be7ee330-b
        ...: 454-4414-8e9f-c70c558dd3af', 'source_type': 'volume', 'destination_type': 'volume', 'delete_on_termination': False}])
    ```
    
    This PR also changes the default imageRef to empty string '' instead of None to prevent the API from responding with an error like this when the .get would default to None so that `image=''` will now no longer have to be specified.
    ```
    BaseHTTPError: 400 Bad Request Invalid input for field/attribute imageRef. Value: None. u'None' is not valid under any of the given schemas
    ```
    vdloo committed Oct 30, 2019
    Configuration menu
    Copy the full SHA
    5f5aff5 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2020

  1. Update CHANGES.rst

    SanderRoosingh committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    edce3c2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dba6fb3 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2020

  1. Configuration menu
    Copy the full SHA
    dfe9dab View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2023

  1. Configuration menu
    Copy the full SHA
    b91937c View commit details
    Browse the repository at this point in the history
Loading