I use : google cloud VM that works very well with gcloud command line.
I followed started with Google Cloud DNS .
- Install the Cloud SDK
- Authenticate on the command-line
- create a project
- set api dns
- verify domain ownership .
but when I execute:
gcloud managed dns - area create --dns_name = " mydomaine.com . " --description = " A test zone" mydomainezonename
Creating {' dNSName ' : ' name' ' mydomaine.com . ' ' Examplezone '
'description' : ' mydomaine test area '} in PROJECT
Do you want to continue (Y / n) ? Y
ERROR: ( gcloud.dns.managed - zone.create ) ResponseError : status = 400 = Bad Request code , reason (s) = invalid
message = Invalid value for project: PROJECT
I search on the web but I find no reason on my problem .
Related
I've installed the gcloud CLI according to https://cloud.google.com/sdk/docs/install.
When using cloud shell on browser, I could simply paste a script and it would work. But it won't do the same when using cloud CLI on Powershell.
Script:
# List Projects accessible to these credentials
PROJECTS=$( `
gcloud projects list `
--format="value(projectId)")
# Iterate over each Project
for PROJECT in ${PROJECTS}
do
echo "Project: ${PROJECT}"
# Check Compute Engine service
ENABLED="$( `
gcloud services list `
--project=${PROJECT} `
--filter=config.name=compute.googleapis.com `
--format='value(state)')"
# Is it enabled?
if [ "${ENABLED}" = "ENABLED" ]
then
# Enumerate Disks that have `users` and output `name`
gcloud compute disks list `
--project=${PROJECT} `
--filter="-users:*" `
--format="csv(name,sizeGb,zone,status,type,lastAttachTimestamp,lastDetachTimestamp)"
fi
done
Result on browser cloud shell: successfully iterated through projects and listed disks in that project.
Result on Powershell:
PS C:\WINDOWS\System32> C:\Users\minh.tran\Documents\Get Disk.ps1
At C:\Users\minh.tran\Documents\Get Disk.ps1:7 char:4
+ for PROJECT in ${PROJECTS}
+ ~
Missing opening '(' after keyword 'for'.
At C:\Users\minh.tran\Documents\Get Disk.ps1:8 char:3
+ do
+ ~
Missing statement body in do loop.
At C:\Users\minh.tran\Documents\Get Disk.ps1:17 char:5
+ if [ "${ENABLED}" = "ENABLED" ]
+ ~
Missing '(' after 'if' in if statement.
At C:\Users\minh.tran\Documents\Get Disk.ps1:17 char:7
+ if [ "${ENABLED}" = "ENABLED" ]
+ ~
Missing type name after '['.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingOpenParenthesisAfterKeyword
PS C:\WINDOWS\System32>
The comment from #John Hanley is the correct answer. I tried to use a Linux shell script as a PowerShell script on a Windows machine.
The simplest solution for my case is to convert the shell script to a PowerShell script and run the converted script from PowerShell.
Converted script can be found here: GCP | disks.list method returning error when ran as part of a script . Despite working, it is still throwing some errors.
I'm trying to create a provisioned product in service catalog by using PowerShell.
cmdlet $newProduct = New-SCProvisionedProduct -ProvisionedProductName $product_name -ProductId $product_id
-ProvisioningArtifactId $artifact_id -ProvisioningParameter #( #{key="Server_size";value="$server.serversize"},{key= "Key_pair",value="demo_key"} )
But I don't know how to pass multiple values in provisioning parameter it showing some error
New-SCProvisionedProduct : Cannot bind parameter 'ProvisioningParameter'.
Cannot convert the "[" value of type "System.String" to type
"Amazon.ServiceCatalog.Model.ProvisioningParameter".
At line:1 char:162
+ ... -ProvisioningArtifactId $artifact_id -ProvisioningParameter [ {key="S ...
+ ~
+ CategoryInfo : InvalidArgument: (:) [New-SCProvisionedProduct],
ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Amazon.PowerShell
.Cmdlets.SC.NewSCProvisionedProductCmdlet
Could anyone help me with the AWS Powershell command to pass multiple values in provisioning parameter (or) help to sort this error
I am trying to add multiple DNS records using this script add_multipleDNSrecord.sh and i am getting this error
A client error (InvalidChangeBatch) occurred when calling the ChangeResourceRecordSets operation: FATAL problem: UnsupportedCharacter (Value contains unsupported characters) encountered with ' '
But i am able to add single record without any issue from aws cli. can anyone please tell me what went wrong in this script?
#!/bin/bash
# declare STRING variable
STRING="Hello World"
#print variable on a screen
echo $STRING
# Hosted Zone ID
ZONEID="Z24*************"
#Comment
COMMENT="Add new entry to the zone"
# The Time-To-Live of this recordset
TTL=300
# Type
TYPE="A"
# Input File Name
FILENAME=/home/ec2-user/awscli/route53/scripts/test.json
cat >> $FILENAME << EOF
{
"Comment":"$COMMENT",
"Changes":[
{
"Action":"CREATE",
"ResourceRecordSet":{
"ResourceRecords":[
{
"Value":"$IP"
}
],
"Name":"$RECORDSET",
"Type":"$TYPE",
"TTL":$TTL
}
}
]
}
EOF
echo $FILENAME
After Replacing the space and using dot instead of space solves the problem.
Now,The script works fine and its able to add multiple records to the hosted zone.
I'm executing the following:
Set-AzureRmVMExtension `
-VMName 'servername' `
-ResourceGroupName 'rgname' `
-Name 'JoinAD' `
-ExtensionType 'JsonADDomainExtension' `
-Publisher 'Microsoft.Compute' `
-TypeHandlerVersion '1.0' `
-Location 'West Europe' `
-Settings #{'Name' = 'domain.com'; 'OUPath' = 'OU=Server 2012 R2,OU=Servers,DC=domain,DC=com'; 'User' = 'domain.com\username'; 'Restart' = 'true'; 'Options' = 3} `
-ProtectedSettings #{'Password' = 'password'}
and get this error:
Set-AzureRmVMExtension : Long running operation failed with status
'Failed'. StartTime: 18.04.2016 18:03:30 EndTime: 18.04.2016 18:04:50
OperationID: 76825458-6c50-404d-bb1a-b27c722b1760 Status: Failed
ErrorCode: VMExtensionProvisioningError ErrorMessage: VM has reported
a failure when processing extension 'JoinAD'. Error message: "Join
completed for Domain 'ddomain.com'". At line:1 char:1
+ Set-AzureRmVMExtension `
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureRmVMExtension], ComputeCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.SetAzureVMExtensionCommand
What am I missing?
Kept having trouble with extension, therefore opted to perform the domain join using PowerShell Add-Computer without extensions.
One possibly cause might be that NSG configurations block connectivity to the internet and with that to services running in the Azure data center.
While installing the current package, the following error messages are received:
WASX7017E: Exception received while running file /opt/Install_SIPR/updateSiprEar.py; exception information: com.ibm.ws.scripting.ScriptingException: WASX7108E: Invalid data specified for install task: "BindJndiForEJBNonMessageBinding." Errors are: "
ADMA0002E: A validation error occurred in task Binding enterprise Bean to JNDI names. The Java Naming and Directory Interface (JNDI) name is not specified for enterprise bean DqEvalPersistService in module GfmEjb.
ADMA0002E: A validation error occurred in task Binding enterprise Bean to JNDI names. The Java Naming and Directory Interface (JNDI) name is not specified for enterprise bean JumService in module GfmEjb."
The messages are associated to the following statement:
AdminApp.update(appName, 'app', '[ -operation update -contents ' + earFileName + ' -nopreCompileJSPs -installed.ear.destination $(APP_INSTALL_ROOT)/' + cell + ' -distributeApp -nouseMetaDataFromBinary -deployejb -createMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn -noprocessEmbeddedConfig -filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink -MapResRefToEJB [[ GfmEjb EventHandlerMDB GfmEjb.jar,META-INF/ejb-jar.xml mail/DefaultMail javax.mail.Session mail/DefaultMail "" "" "" ][ GfmWebServices "" GfmWeb.war,WEB-INF/web.xml mail/DefaultMail javax.mail.Session mail/DefaultMail "" "" "" ][ GfmWebServices "" GfmWeb.war,WEB-INF/web.xml GfmOracle javax.sql.DataSource jdbc/GFMDS "" "" "" ][ GfmEjb EventHandlerMDB GfmEjb.jar,META-INF/ejb-jar.xml GfmOracle javax.sql.DataSource jdbc/GFMDS "" "" "" ]] -MapModulesToServers [[ GfmEjb GfmEjb.jar,META-INF/ejb-jar.xml ' + installString + ' ][ GfmWebServices GfmWeb.war,WEB-INF/web.xml ' + installString + ' ]]]' )
NOTE: the installString contains cell, node, appServer, allwebservers, and allwebserverNodes information.
What am I doing wrong?
The error message is simply saying that there is an EJB in the application that does not have a JNDI name specified for it. I think adding this:
-BindJndiForEJBNonMessageBinding [[ "GfmEjb" JumService GfmEjb.jar,META-INF/ejb-jar.xml ejb/JumService ]]
to the command should fix this problem.