Detailed Azure Type and Resource Mappings¶
Azure - Labeled Resources¶
Labeled CloudBridge Resource |
Azure Resource Type |
CB ID |
CB Name |
CB Label |
---|---|---|---|---|
AzureInstance |
Virtual Machine |
ID |
Name |
|
AzureMachineImage (Private) AzureMachineImage (Marketplace Image) |
Image VirtualMachineImage |
ID ID |
Name URN |
tag:Label URN |
AzureNetwork |
Virtual Network |
ID |
Name |
|
AzureSubnet |
Subnet |
ID |
NetworkName/SubnetName |
Network:tag:SubnetLabel_SubnetName |
AzureRouter |
Route Table |
ID |
Name |
|
AzureVolume |
Disk |
ID |
Name |
|
AzureSnapshot |
Snapshot |
ID |
Name |
|
AzureVMFirewall |
Network security group |
ID |
Name |
The resources listed above are labeled, they thus have both the name and label properties in CloudBridge. These resources require a mandatory label parameter at creation. The label will then be used to create the name, which will consist of up to 55 characters from the label, followed by a UUID. The label property can subsequently be changed, but the name property will remain unchanged, as it is part of the ID. Finally, labeled resources support a label parameter for the find method in their corresponding services. The below screenshots will help map these properties to Azure objects in the web portal. Additionally, although Azure Security Groups are not associated with a specific network, such an association is done in CloudBridge, due to its necessity in AWS. As such, the VMFirewall creation method requires a network parameter and the association is accomplished in OpenStack through a tag with the key network_id.
Two labeled resources are exceptions to the general trends presented above, namely public images (i.e. Azure Marketplace Images) and subnets.
These public images can be found in the Azure Marketplace, and cannot be found on a user’s dashboard. A Marketplace Image can be passed either by URN, or by public ID, and does not need to be linked to a user. While all Marketplace images will not be be listed by the find or list methods at the moment, a pre-set list of popular images is built into CloudBridge for that purpose. However, one can choose to list all Marketplace Images using the list_marketplace_images function in the azure client. Specifically, this can be done as follows:
# List all images
# Note that in September 2018, around 10 minutes of wall time were required
# to fetch the entire list
provider.azure_client.list_marketplace_images()
# List all images published by Canonical
provider.azure_client.list_marketplace_images(publisher='Canonical')
# List all Ubuntu images
provider.azure_client.list_marketplace_images(publisher='Canonical',
offer='UbuntuServer')
# List all Ubuntu 16.04 images
provider.azure_client.list_marketplace_images(publisher='Canonical',
offer='UbuntuServer',
sku='16.04.0-LTS')
# The ID of the listed object can then be used to retrieve an instance
img = provider.compute.images.get
('/Subscriptions/{subscriptionID}/Providers/Microsoft.Compute/\
Locations/{regionName}/Publishers/Canonical/ArtifactTypes/VMImage\
/Offers/UbuntuServer/Skus/16.04.0-LTS/Versions/16.04.201808140')
# The URN can also be used instead if it is already known
# When the latest version is desired, it can be retrieved with the
# keyword 'latest' in the URN without specifying a version
img = provider.compute.images.get(
'Canonical:UbuntuServer:16.04.0-LTS:latest')
Given that these resources are not owned by the user, they can only be referenced and all setters will silently pass. CloudBridge properties name and label will map to the URN, while the ID will map to the public ID. It is also important to note that some of these resources are paid and required a plan to use, while others are free but likewise require accepting certain terms before being used. These plans and terms are passed and accepted silently by CloudBridge in order to keep the code cloud-independent. We therefore encourage using the marketplace website to view the images and plan details before using them in CloudBridge.
Additionally, Subnets are a particular resource in Azure because they are not simply found in the Resource Group like most resources, but are rather nested within a network. Moreover, Subnets do not support tags in Azure. However, they remain a labeled resource in CloudBridge, which was accomplished by creating Network tags holding Subnet labels in Azure. The below screenshots will show how to find Subnets and their labels in the Azure web portal.
Azure - Unlabeled Resources¶
Unlabeled Resource |
Azure Resource Type |
CB ID |
CB Name |
CB Label |
---|---|---|---|---|
AzureKeyPair |
StorageAccount:Table |
Name |
Name |
|
AzureBucket |
StorageAccount:BlobContainer |
Name |
Name |
|
AzureBucketObject |
StorageAccount:BlobContainer:BlockBlob |
Name |
Name |
The resources listed above are unlabeled. They thus only have the name property in CloudBridge. These resources require a mandatory name parameter at creation, which will directly map to the unchangeable name property. Additionally, for these resources, the ID property also maps to the name in Azure, as these resources don’t have an ID in the traditional sense and can be located simply by name. Finally, unlabeled resources support a name parameter for the find method in their corresponding services.
Azure - Special Unlabeled Resources¶
Unlabeled Resource |
Azure Resource Type |
CB ID |
CB Name |
CB Label |
---|---|---|---|---|
AzureFloatingIP |
Public IP Address |
ID |
[public_ip] |
|
AzureInternetGateway |
None |
cb-gateway-wrapper |
cb-gateway-wrapper |
|
AzureVMFirewallRule |
Network Security Rules |
ID |
name |
While these resources are similarly unlabeled, they do not follow the same general rules as the ones listed above. Firstly, they differ by the fact that they take neither a name nor a label parameter at creation. Moreover, each of them has other special properties.
The FloatingIP resource has a traditional resource ID, but instead of a traditional name, its name property maps to its Public IP. Thus, the name seen in the Azure web portal will not map to the CloudBridge name, but will rather be auto-generated, while the Azure IP Address will map to CloudBridge name. Moreover, the corresponding find method for Floating IPs can thus help find a resource by Public IP Address, and the get method also accepts a ‘Public IP’ instead of an ‘ID’.
In terms of the gateway, one of the major discrepancies in Azure is the non-existence of an InternetGateway. In fact, Azure resources are exposed with no need for an Internet gateway. However, in order to keep resources consistent across providers, the CloudBridge Gateway resource exists regardless of provider. For Azure, the gateway object created through CloudBridge will not appear on the dashboard, but will rather be a cached CloudBridge-level wrapper object. For a succinct comparison between AWS Gateways and Azure, see this answer.
Finally, Firewall Rules in Azure differ from traditional unlabeled resources by the fact that they do not take a name parameter at creation. These rules can be found within each Firewall (i.e. Security Group) in the Azure web portal, and will have an automatically generated name of the form ‘cb-rule-[int]’.