How to enable of disable vSphere HA using Python SDK API - vsphere

In vSphere UI there is a button to turn on or off vSphere HA, Cluster > Configure > vSphere Availability > vSphere HA is Turned ON > Edit > vSphere HA.
What is the correct API reference object that will achieve the same?

I figured it out...
def disableVcenterHighAvailabilityMode(vsan_client, clusterName):
print("Disabling vSphere HA Mode.")
cluster = getClusterInstance(clusterName, vsan_client)
clusterConfigSpec = vim.cluster.ConfigSpec()
clusterConfigSpec.dasConfig = cluster.configuration.dasConfig
clusterConfigSpec.dasConfig.enabled = False
cluster.ReconfigureCluster_Task(clusterConfigSpec, True)

Related

In Back4App project, Can multiple apps (different platforms) can access same database and authentication?

I wanted to use back4app as my backend to my mobile apps & web app/site. My question is can I access same db and authentication in single project (shared plan). If yes show me some reference to get. Thank you. (Try to understand my English).
Yes, you can use the same database for your mobile apps and website, you only need to use the same app credentials in your initialization code.
Let me better explain it:
For Android apps, you must use:
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("APP-ID-HERE")
// if defined
.clientKey("CLIENT-KEY-HERE")
.server("https://parseapi.back4app.com")
.build()
);
For iOS (swift):
let configuration = ParseClientConfiguration {
$0.applicationId = "PASTE_YOUR_APPLICATION_ID_HERE"
$0.clientKey = "PASTE_YOUR_CLIENT_ID_HERE"
$0.server = "https://parseapi.back4app.com"
}
Parse.initialize(with: configuration)
For iOS (obj-C):
[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
configuration.applicationId = #"PASTE_YOUR_APPLICATION_ID_HERE";
configuration.clientKey = #"PASTE_YOUR_CLIENT_ID_HERE";
configuration.server = #"https://parseapi.back4app.com/";
}]];
And for the website (JS):
Parse.initialize("YOUR_APP_ID", "YOUR_JS_KEY"); //PASTE HERE YOUR Back4App APPLICATION ID AND YOUR JavaScript KEY
Parse.serverURL = "https://parseapi.back4app.com/";
If you use the credentials (App ID, Client Key / Javascript Key) of the same app, you'll connect all your "different" projects to the same database.
In addition, you can get these credentials following this guide: https://help.back4app.com/hc/en-us/articles/115000754772-Where-are-my-Keys-and-ID-

Karaf Cellar and Managed Service

I've a cluster of two nodes with Cellar. There are managed service set on a configuration create with the configuration admin service.
When I update configuration, there is only one managed service which triggered instead of two.
But when I stop the first node, the managed service is triggered on the other node receiving updated configuration.
I expect that the managed service triggered on two nodes at the same time.
Thanks
Configuration
Karaf 3.0.7
Karaf Cellar 3.0.3
Event producer=true
Event consumer=true
bundle.listener = false
config.listener = true
feature.listener = false
default.bundle.sync = cluster
default.config.sync = cluster
default.feature.sync = cluster
default.obr.urls.sync = cluster

Google Cloud Pub/Sub Emulator: user not authorized creating a new topic

I'm using google-cloud-pubsub in Django and the Google Cloud Pub/Sub Emulator.
I'm trying to create a topic in this way:
publisher = pubsub.PublisherClient ()
topic_path = publisher.topic_path ('my-project', 'my-new-topic')
topic = publisher.create_topic (topic_path)
topic.publish (topic, request.data ['url']. encode ('utf-8'))
but it gives me this exception:
StatusCode.PERMISSION_DENIED, User not authorized to perform this action.
I'm wondering if there is anything else to configure except the PUBSUB_EMULATOR_HOST environment variable.
Do I have to set some permissions, even for the emulator?
The tutorial doesn't explain much more.
Thanks in advance.
4 years late :) but this should solve it:
export PUBSUB_EMULATOR_HOST=localhost:8085
Why
The command in google tutorial (gcloud beta emulators pubsub env-init) for some reason doesn't set the environment variable. So your pubsub apis call the service account instead of the local emulator which result in permission errors.
Manually set it and verify it's set using echo $PUBSUB_EMULATOR_HOST

Load balancing over socket io using haproxy

I have application where clients are two.
1 > Device (socket.io)
2 > Angular (socket.io)
My application is working fine with one server but when I have put in scalable mode then it create problem to make communication between device and angular (socket).
So basically, we need solution where once device connected to a server then some middleware(like haproxy) will help to send all request after that to that particular server only.
Application Uses:
Node
Socket io
Python
Angular
Hosted on AWS and uses : EC2,Elastic cache Redis, DynamoDB
Please let me know if you have any query from my question.
Thanks in advance!

solr4.0, wrong hostname when there is a dot

I am building a full distributed solr cluster on different servers, the servers are server1.mycompany.com and server2.mycompany.com. after configuration when I click server1.mycompany.com in web console, solr try to connect server1:8983/solr rather than server1.mycompany.com:8983/solr. And I use java API:
ZkStateReader zkStateReader = cloudQuery.getCloudSolrServer().getZkStateReader();
ClusterState clusterState = zkStateReader.getClusterState();
System.out.println(clusterState);
I still get "node_name":"server1:8983_solr","base_url":"http://server1:8983/solr".
anyone give a hint? is this a bug or something to be configured?

Resources