scylladb / scylla-machine-image

Apache License 2.0
18 stars 25 forks source link

[azure]:fix copy image due to long image name #448

Closed yaronkaikov closed 1 year ago

yaronkaikov commented 1 year ago

When trying to copy Azure image to other regions (on enterprise only), we get the following failure:

10:23:45  ERROR: command failed: ['/usr/bin/../../opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--resource-group', 'image-copy-rg', '--name', 'scylla-enterprise-2023.2.0-dev-x86_64-2023-05-01T09-12-36_os_disk_snapshot-eastus2', '--location', 'eastus2', '--source', 'https://eastus2lalnrozwewefc0at6.blob.core.windows.net/snapshots/scylla-enterprise-2023.2.0-dev-x86_64-2023-05-01T09-12-36_os_disk_snapshot.vhd', '--source-storage-account-id', '/subscriptions/****/resourceGroups/image-copy-rg/providers/Microsoft.Storage/storageAccounts/eastus2lalnrozwewefc0at6', '--hyper-v-generation', 'V2', '--output', 'json', '--subscription', ****, '--tags', 'created_by=image-copy-extension']
10:23:45  ERROR: output: ERROR: (InvalidParameter) The value of parameter snapshot.name is invalid.
10:23:45  Code: InvalidParameter
10:23:45  Message: The value of parameter snapshot.name is invalid.
10:23:45  Target: snapshot.name

Since SCT are depending on branch and region to search for images, and during promoting we create an image gallery link to the relevant image, switching image name to use generalProductName(Scylla) instead of productName(Scylla/Scylla-enterprise)

yaronkaikov commented 1 year ago

Verified with https://jenkins.scylladb.com/view/enterprise/job/scylla-enterprise/job/releng-testing/job/azure-image/12/

[yaronkaikov@london]~/git/scylla-cluster-tests (master)$ hydra list-images -br enterprise:all -c azure -r eastus2
There is scylladb/hydra:v1.38-argus-0.10.2-update in local cache, using it.
Obtaining QA SSH keys...
QA SSH keys obtained.
Going to run './sct.py  list-images -br enterprise:all -c azure -r eastus2'...
Obtaining QA SSH keys...
QA SSH keys obtained.
/usr/local/lib/python3.10/site-packages/elasticsearch/connection/http_urllib3.py:209: UserWarning: Connecting to https://746f0ad652a3447d83b1572f657c67cb.us-east-1.aws.found.io:9243 using SSL with verify_certs=False is insecure.
  warnings.warn(
install-bash-completion current path: /home/yaronkaikov/git/scylla-cluster-tests
New directory created: /home/yaronkaikov/sct-results/20230503-120136-762145-list-images
WARNING:--arch option not implemented currently for Azure machine images.
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                                                                     Azure Machine Images by version                                                                                                                      |
+---------+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| Backend | Name                                                         | ImageId                                                                                                                                                                          | CreationDate |
+---------+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| Azure   | debug-scylla-2023.2.0-dev-x86_64-2023-05-03T14-42-02-eastus2 | /subscriptions/6c268694-47ab-43ab-b306-3c5514bc4112/resourceGroups/SCYLLA-IMAGES/providers/Microsoft.Compute/images/debug-scylla-2023.2.0-dev-x86_64-2023-05-03T14-42-02-eastus2 | N/A          |
+---------+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
yaronkaikov commented 1 year ago

@fruch Please review

yaronkaikov commented 1 year ago

verified after the last changes with; https://jenkins.scylladb.com/view/enterprise/job/scylla-enterprise/job/releng-testing/job/azure-image/13/consoleFull and https://jenkins.scylladb.com/view/master/job/scylla-master/job/releng-testing/job/next-machine-image/96/