I am trying to use the '-ReplicationGroupName' parameter on the 'New-AzureRmRecoveryServicesAsrReplicationProtectedItem' cmdlet, however, I am struggling to understand exactly how it should be used...
I am trying to use it with the '-HyperVToAzure' switch but I receive the error;
"Parameter set cannot be resolved using the specified named parameters"
Which seems to suggest that the '-ReplicationGroupName' parameter can only be used in conjunction with the '-VMwareToAzure' switch. Is this correct? Is there any way of using ASR Replication Groups with Hyper-V (or physical) protected items?
Or have I misunderstood the use of this parameter completely and should be looking at something else entirely...?!
It is only for “VMware to Azure” and “Azure to Azure”. There is no replication group construct in “Hyper-V to Azure”.
Related
I am attempting to create a policy to lock down resource groups and would like to just use a list of high level resource types instead of trying to granularly assign types as there are hundreds. is this possible? Using a powershell script I pulled the list of types and was trying to just use top level ones such as:
["Microsoft.KeyVault","Microsoft.AzureData","Microsoft.Billing","Microsoft.Cache","Microsoft.Consumption","Microsoft.ContainerInstance","Microsoft.ContainerRegistry","Microsoft.ContainerService","Microsoft.DBforPostgreSQL","Microsoft.DevOps","Microsoft.MachineLearning","Microsoft.ServiceBus","Microsoft.Sql","Microsoft.SqlVirtualMachine","Microsoft.Storage","Microsoft.Web"]
but it didn't validate it. Is there a possibility of a syntax error in my array, am I doing something else wrong, or is it just straight up not possible?
Maybe you can use "notContains" to check the resource type:
{
"field": "type",
"notContains": "Microsoft.KeyVault"
}
I use jooq to generate objects against a local database, but when running "for real" later in production the actual databases will have different names. To remedy this I use the <outputSchemaToDefault>true</outputSchemaToDefault> config option (maven).
At the same time, we have multiple databases (schemas), and are using a connection pool to the server like "jdbc:mysql://localhost:3306/" (without specifying a database here).
How do I tell jooq which database to use when running queries?
I have tried all config I can think of:
new Settings()
.withRenderSchema(true) // true/false seems to make no difference.
.withRenderCatalog(true) // true/false seems to make no difference.
.withRenderMapping(new RenderMapping()
.withDefaultSchema("my_database") // Seems to have no effect.
// The above 3 configs always give me an error saying "no database selected".
// Adding this gives me 'my_database.my_table' does not exist - while it actually does.
.withSchemata(new MappedSchema()
.withInputExpression(Pattern.compile(".*"))
.withOutput("my_database")
));
I have also tried using a database/schema name, as in not configuring outputSchemaToDefault. But then, adding the MappedSchema code above, but that gives me errors with "'my_databasemy_database.my_table' does not exist", which is correct. I have no clue why that code gives me the database/schema name twice?
Edit:
When jooq tells me that the db.table does not exist, if I put a break point in a good place and get the sql from jooq and run exactly that against my database it does work. But jooq fails to run it.
Also, I'm using version 3.15.3 of jooq.
I solved it. Instead of using .withInputExpression(Pattern.compile(".*")), it seems to work with .withInput("").
I'm still not sure why it works, or if this is the "correct" way of solving it. But at least it is a way forward.
No clue why using the pattern, I got the name twice though. But that one I'll leave alone.
I have a question about how to change resources like RAM, number of cores for existing VM on node node-1 using terraform. I referred this example https://github.com/Telmate/terraform-provider-proxmox/blob/master/examples/cloudinit_example.tf, but this will create VM, I need to change and/or handle existing VM resources. Could anyone explan how to do this? Thanks in advance.
please do check documentation before asking question directly. If you didn't find it please cross check it with source code. It's just pretty straight forward. Provide existing name and vmid. Further add resources, network and add what all you really required.
Example code is here.
provider "proxmox" {
pm_tls_insecure = true
pm_api_url = "https://proxmox-server01.example.com:8006/api2/json"
pm_password = "secret"
pm_user = "terraform-user#pve"
pm_otp = ""
}
resource "proxmox_vm_qemu" "cloudinit-test" {
vmid = <Existing VMID>
name = "<Existing Name of VM>"
# Node name has to be the same name as within the cluster
# this might not include the FQDN
target_node = "proxmox-server02"
cores = 2
sockets = 1
vcpus = 0
cpu = "host"
memory = 2048
scsihw = "lsi"
# Setup the disk
disk {
size = 32
type = "virtio"
storage = "ceph-storage-pool"
storage_type = "rbd"
iothread = 1
ssd = 1
discard = "on"
}
# Setup the network interface and assign a vlan tag: 256
network {
model = "virtio"
bridge = "vmbr0"
}
}
I am currently working on a project where i deploy multiple arm templates each deploying a VM and doing few operations on them. I wanted handle quota issues by calling template validation before triggerring the first deployment. So, i created a template which has logic to create required VMs and i am using this template only for validation (to check if quota will not be exceeded).
Since our code already has the ResourceManagementClient, i tried the following code:
Deployment parameters = new Deployment(
new DeploymentProperties(DeploymentMode.Incremental)
{
Template = templateFile,
Parameters = parameterFile,
});
DeploymentsValidateOperation dp = deployments.StartValidate(groupName, "validation", parameters);
But when i try to access the Value from the variable dp, i keep getting the following exception:
Generic Exception System.InvalidOperationException: The operation has
not completed yet. at Azure.Core.ArmOperationHelpers`1.get_Value()
at
Azure.ResourceManager.Resources.DeploymentsValidateOperation.get_Value()
at DeployTemplate.Program.d__3.MoveNext() in
\Program.cs:line 88
I even added a loop after the "StartValidate" to wait till the dp.HasCompleted is set to true. But this seems to run indefinetly. I also tried the "StartValidateAsync" method, which seems to have the same issue.
I wanted to understand if i am using this method correctly? if there is a better way to do the template validations? I could not find any examples on this method`s usage. if possible please share any code snippet where this method is used for my reference.
Note: Currently, Since this is not working, i am testing with Fluent Api way. That seems to be working. But, it requires lot of changes in our code as it creates ambiguity with many classes in "Azure.ResourceManager.Resources" which are already used for other operations.
I found that even though the deployment operations HasCompleted field is not set, when I call dp.GetRawResponse(), it returns the exact errors expected.
I now use this to validate my templates.
Exception of type 'Microsoft.WindowsAzure.StorageClient.StorageClientException' was thrown.
Sometimes even if we have the fabric running and the role manager is up, we get an exception of this sort.
The code breaks at the line:
emailAddressClient.CreateTableIfNotExist("EmailAddress");
public EmailAddressDataContext(CloudStorageAccount account) :
base(account.TableEndpoint.AbsoluteUri, account.Credentials)
{
this.storageAccount = account;
CloudTableClient emailAddressClient =
new CloudTableClient(storageAccount.TableEndpoint.AbsoluteUri,
storageAccount.Credentials);
emailAddressClient.CreateTableIfNotExist("EmailAddress");
}
I give Windows Azure tables camel-cased names all the time without issues.
I wonder if by chance you already used this table name and recently deleted it? For a time after deletion (when the table is still being deleted asynchronously), you won't be able to recreate it. I believe 409 Conflict is the error code to expect in that case.
I agree with Steve Marx, casing does not seem to affect this issue. In fact Microsoft's Azure diagnostics tables are created with unusual casing eg: WADPerformanceCounters. I get the problem even in the dev environment. So it is something else entirely - my opinion.
Error fixed in my case: The problem was an error with the connection string as defined in (or lack thereof) in the webrole or workerrole project properties.
Fix:
Right-click on the webrole under "Roles" folder in your cloud application. Select "Properties" from the context menu.
Select the "Settings" tab.
Verify or Add a setting for you connection string that you will use to initialize table storage.
Mine was a simple error - no setting for my connection string.
Easy fix is to change "EmailAddress" to "Emailaddress". For some reasons it would not allow CamelCasing. So please make sure, you just have one capital letter in the name of the table that too at the beginning. Since the table names are case insensitive, you can also name it as 'emailaddress'