Azure cli virtual machine scale sets tutorial fails with "Parameter 'osProfile' is not allowed."? - azure-cli

Follwing https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/tutorial-use-custom-image-cli fails here with the error
...
$ az vmss create --resource-group myResourceGroup --name myScaleSet --image /subscriptions/.../myGallery/images/myImageDefinition
Deployment failed. Correlation ID: 6c5f031b-aa0e-42a8-a1d9-faba9b11b208. {
"error": {
"code": "InvalidParameter",
"message": "Parameter 'osProfile' is not allowed.",
"target": "osProfile"
}
}
Any suggestions? You can reproduce this easily using the script https://github.com/dankegel/azure-scripts/blob/main/ss-demo.sh

I can reproduce the error with your script. The problem is that there is a missing "\" after the parameter --image $IDID in your script.
az vmss create \
--resource-group myResourceGroup \
--name myScaleSet \
--image $IDID
--specialized
It should be
az vmss create \
--resource-group myResourceGroup \
--name myScaleSet \
--image $IDID \
--specialized

Related

Error "unable to resolve docker endpoint: open /root/.docker/ca.pem: no such file or directory" when deploying to elastic beanstalk through bitbucket

I am trying to upload to elastic beanstalk with bitbucket and I am using the following yml file:
image: atlassian/default-image:2
pipelines:
branches:
development:
- step:
name: "Install Server"
image: node:10.19.0
caches:
- node
script:
- npm install
- step:
name: "Install and Build Client"
image: node:14.17.3
caches:
- node
script:
- cd ./client && npm install
- npm run build
- step:
name: "Build zip"
script:
- cd ./client
- shopt -s extglob
- rm -rf !(build)
- ls
- cd ..
- apt-get update && apt-get install -y zip
- zip -r application.zip . -x "node_modules/**"
- step:
name: "Deployment to Development"
deployment: staging
script:
- ls
- pipe: atlassian/aws-elasticbeanstalk-deploy:1.0.2
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_REGION
APPLICATION_NAME: $APPLICATION_NAME
ENVIRONMENT_NAME: $ENVIRONMENT_NAME
ZIP_FILE: "application.zip"
All goes well until I reach the AWS deployment and I get this error:
+ docker container run \
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/aws-elasticbeanstalk-deploy:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/aws-elasticbeanstalk-deploy \
--workdir=$(pwd) \
--label=org.bitbucket.pipelines.system=true \
--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \
--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \
--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \
--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \
--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \
--env=BITBUCKET_DEPLOYMENT_ENVIRONMENT_UUID="$BITBUCKET_DEPLOYMENT_ENVIRONMENT_UUID" \
--env=BITBUCKET_SSH_KEY_FILE="$BITBUCKET_SSH_KEY_FILE" \
--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \
--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \
--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \
--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \
--env=BITBUCKET_DEPLOYMENT_ENVIRONMENT="$BITBUCKET_DEPLOYMENT_ENVIRONMENT" \
--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \
--env=CI="$CI" \
--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \
--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \
--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \
--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \
--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \
--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \
--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \
--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \
--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \
--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/aws-elasticbeanstalk-deploy" \
--env=APPLICATION_NAME="$APPLICATION_NAME" \
--env=AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \
--env=AWS_DEFAULT_REGION="$AWS_REGION" \
--env=AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \
--env=ENVIRONMENT_NAME="$ENVIRONMENT_NAME" \
--env=ZIP_FILE="application.zip" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/aws-elasticbeanstalk-deploy:1.0.2
unable to resolve docker endpoint: open /root/.docker/ca.pem: no such file or directory
I'm unsure how to approach this as I've followed the documentation bitbucket lies out exactly and it doesn't look like there's any place to add a .pem file.

Why can I install this Jelastic manifest through the dashboard import function but not throuhg the Jelastic API?

I have the following very simple manifest:
type: install
name: very simple manifest
onInstall:
- log: installing manifest
I can install it from the Jelastic Dashboard. There is an import function in the main menu where I can copy / paste that manifest content and it gets installed. In the Jelastic console, I can see
[15:36:38 manifest.settings]: BEGIN INSTALLATION: very simple manifest
[15:36:39 manifest.settings]: BEGIN HANDLE EVENT: {"topic":"application/install","envAppid":""}
[15:36:39 manifest.settings:1]:> installing manifest
[15:36:39 manifest.settings]: END HANDLE EVENT: application/install
[15:36:39 manifest.settings]: END INSTALLATION: very simple manifest
and the Jelastic dashboard confirms installation.
Now, when I do the same, but via the Jelastic REST API, i.e. using the endpoint
http://my-jelastic-provide.com/1.0/marketplace/jps/REST/install
with the relevant data, then, it doesn't install. Instead, I get the strange error message
Can\'t find environment by domain [jelasticclient-master-0954606]
where jelasticclient-master-0954606 is the envName I set.
However, if I change my manifest to e.g.
type: install
name: very simple manifest
nodes:
count: 1
cloudlets: 4
nodeGroup: cp
image: alpine:latest
skipNodeEmails: true
onInstall:
- log: installing manifest
then it installs perfectly. What am I missing?
I am using Jelastic v6.0.2.
Your "very simple manifest" doesn't suppose any environment name to be passed.
That's why when you pass it you get an error "Can't find environment by domain [domain-name]" (Example1).
When you don't have the "nodes" parameter in the manifest (as in your second example), you shouldn't pass any environment name (Example2) or should pass the existing environment name (response is in Example3).
Example1:
curl -X POST 'https://jca.host-domain/1.0/marketplace/jps/rest/install' \
-d 'envName=jelasticclient-master-0954606' \
-d session=*** \
-d skipNodeEmails=1 \
-d ownerUid=UID \
--data-urlencode 'jps={ "type": "install", "name": "very simple manifest", "onInstall": [ { "log": "installing manifest" } ] }'
The response is:
{"result":11,"response":{"result":11,"source":"JEL","error":"domain [jelasticclient-master-0954606] doesn't exist"},"source":"JEL","error":"domain [jelasticclient-master-0954606] doesn't exist"}
When the environment name is not passed (Example2),
curl -X POST 'https://jca.host-domain/1.0/marketplace/jps/rest/install' \
-d session=*** \
-d skipNodeEmails=1 \
-d ownerUid=UID \
--data-urlencode 'jps={ "type": "install", "name": "very simple manifest", "onInstall": [ { "log": "installing manifest" } ] }'
the response is
{"result":0,"uniqueName":"3c819586-2ef7-4691-9faa-d3059459d20e","response":{"result":0,"uniqueName":"3c819586-2ef7-4691-9faa-d3059459d20e","successText":"","appid":""},"appid":"","successText":""}
When the environment with envName=jelasticclient-master-0954606 already exists, the response of the same request from the Example1 is as this (Example3)
{"result":0,"uniqueName":"b52a8db9-8850-4b66-958a-3dee3345b923","response":{"result":0,"uniqueName":"b52a8db9-8850-4b66-958a-3dee3345b923","successText":"","appid":"7b0c465f6c9573b8d8ce3ed59591781b"},"appid":"7b0c465f6c9573b8d8ce3ed59591781b","successText":""}
In other words, if you pass the environment name when deploying this "very simple manifest" this manifest is installed like an add-on because there is no "nodes" parameter in it but there is no existing environment "jelasticclient-master-0954606" to install this "add-on".

Azure CLI ARM parameters json using variables to retrieve keyvault secrets

We've created a bash script to rollout our Azure infrastructure based on Azure CLI & ARM Templates.
We also use keyvault to store our secrets and we need to it for references when deploying resources.
Example (this works with static values in the parameters json):
templateUri="armdeploymysql.json"
az group deployment create \
--name $Environment \
--resource-group $RSGName \
--template-file $templateUri \
--parameters #armdeploymysql-parameters.json
In the armdeploymysql-parameters.json you find this:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"administratorLogin": {
"value": "termysqladmin"
},
"administratorLoginPassword": {
"reference": {
"keyVault": {
"id": "/subscriptions/xxx-xxx-xxx-xxx--xx/resourceGroups/resourcegroupname/providers/Microsoft.KeyVault/vaults/keyvaultname"
},
"secretName": "WORDPRESSDBPASSWORD"
}
},
As you can see we are using static values. But we need to deploy this template for multiple environments (Test, Acc & Prod), so we would like to use variables instead of static values.
It works for most of the ARM parameters and we used configure it like:
templateUri="armdeploymysql.json"
az group deployment create \
--name $Environment \
--resource-group $RSGName \
--template-file $templateUri \
--parameters "version=$version" \
"location=$location" \
"administratorLogin=$SQLAdmin" \
"administratorLoginPassword=$SQLPass"
So the question is:
Can we make a parameter reference like the last example to point to a keyvault?
How can we parse variables in the parameters json?
Why don't you use az to get the secret, and then pass it to your template.
WpPwd = az keyvault secret show --vault-name "keyvaultname" --name "WORDPRESSDBPASSWORD"
templateUri="armdeploymysql.json"
az group deployment create \
--name $Environment \
--resource-group $RSGName \
--template-file $templateUri \
--parameters "version=$version" \
"location=$location" \
"administratorLogin=$SQLAdmin" \
"administratorLoginPassword=$SQLPass"
"wordpresspassword=$WpPwd"
Final fix for this specific case (credits to #Murray Foxcroft), snippet from the code:
keyVaultName="keyvaultname-$Environment"
keyVaultsecret="WORDPRESSDBPASSWORD"
SQLPass=$(az keyvault secret show --vault-name $keyVaultName --name $keyVaultsecret --query value -o tsv)
az group deployment create \
--name $Environment \
--resource-group $RSGName \
--template-file $templateUri \
--parameters "version=$version" \
"location=$location" \
"administratorLogin=$SQLAdmin" \
"administratorLoginPassword=$SQLPass" \
The -o tsv was important to avoid adding the extra characters that the normal command passes to the variable.
Thanks for the help!

Galen framework Null pointer exception and FileNotFoundException

this is my galen command for gelya1.gspec file
D:\Galen\Project1>galen check gelya1.gspec \ --url http://samples.galenframework.com/tutorial1/tutorial1.html \ --size 640x480 \ --htmlreport .
This is my gelya1.gspec file
'
#objects
header id header
= Main section =
header:
height 40to 120px
'
This is my error logs
Test: gelya1.gspec
check gelya1.gspec \ --url http://samples.galenframework.com/tutorial1/tutorial1.html \ --size 640x480 \ --htmlreport .
java.lang.NullPointerException
Test: \
check gelya1.gspec \ --url http://samples.galenframework.com/tutorial1/tutorial1.html \ --size 640x480 \ --htmlreport .
java.io.FileNotFoundException: \ (The system cannot find the path specified)
Suite status: FAIL
Total tests: 4
Total failed tests: 3
Total failures: 3
There were failures in galen tests
D:\Galen\Project1> `
Firefox browser is getting launched when I run this command, not sure why these exceptions are coming.

Crooscompile qt5.4 for imx6

I am trying to crosscompile qt-everywhere-opensource-5.4.0 to iMx6 board.
The following is my configuration file (config.imx6):
./configure --prefix=/tools/rootfs/usr/local/qt-5.4.0 -examplesdir /tools/rootfs/usr/local/qt-5.4.0/examples -verbose -opensource -confirm-license -make libs -make examples -device imx6 \
-device-option CROSS_COMPILE=\
/home/acsia/Desktop/imx6-Qt5/arm-tool-chain/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi- \
-no-pch -no-opengl -no-icu -no-xcb -no-c++11 \
-opengl es2 \
-eglfs \
-compile-examples \
-glib -gstreamer -pkg-config -no-directfb\
When I run ./config.imx I am getting following error:
-gstreamer: invalid command-line switch
But same configuration file runs fine qt-everywhere-opensource-5.1.1
The platform I am using is ubuntu 14.04.
How do I resolve this?