VDSM hook VMFEX custom parameters do not work - redhat

On RHEV 3.2 hypervisor with RHEL 6.4 has been installed vdsm hook for vmfex configuration during virtual machine startup.
RPM package - vdsm-hook-vmfex-4.12.1-2.el6.noarch
Custom properties are configured via GUI as follow:
'00:1a:4a:09:09:12':'DB'
where fist parameter is MAC address and second is profile name in UCS.
Virtual machine doesn't start due to problem with VDSM hook.

I've sorted it out.
The custom properties should be wrapped with curly braces as follow:
{'00:1a:4a:09:09:12':'DB'}
to make this work.

Related

Python winrm node definition

Actually I'm using rundeck WinRM overthere plugin to get Windows connection and command excutions, using this node definition template
<node name="XXXXXX"
hostname="1.1.1.1"
osFamily="Windows"
osName="Microsoft Windows Server 2016"
osArch="amd64"
node-executor="overthere-winrm"
file-copier="overthere-winrm"
winrm-cert-trust="all"
winrm-auth-type="ntlm"
winrm-protocol="https"
winrm-cmd="PowerShell"
winrm-password-storage-path="keys/project/TEST/XXXXX.password">
Note the above lines with
node-executor="overthere-winrm"
file-copier="overthere-winrm"
I'm trying to setup py-winrm plugin on a similar way like winrm-overthere plugin. I don't know if it's possible to setup pywinrm node and file executor on node definition when using pywinrm plugin.
Question
Can I setup pywinrm plugin with node-executor and file-copier attribute on node definition?
This setup enable me to use SSH globally on a project and pywinrm on Windows nodes.
Thanks in advance
Sure, is defined as a property like the old Overthere WinRM plugin, look at the rundeck documentation.
In the Pywinrm plugin case:
node-executor="WinRMPython"
file-copier="WinRMcpPython"

Using environment variables to configure Docker deployment of Lagom Scala application

We're developing several Lagom-based Scala micro-services. They are configured using variable replacement in application.conf, eg.
mysql = {
url = "jdbc:mysql://"${?ENV_MYSQL_DATABASE_URL}
During development, we set these variables as Java System Properties via a env.sbt file that calls System.setProperty("ENV_MYSQL_DATABASE_URL", url). This is working fine.
Now I want to deploy this in a container to my local Docker installation. We are using the SbtReactiveAppPlugin to build the Docker image from build.sbt and simply run sbt Docker/publishLocal. This works as expected, a Docker image is created and I can fire it up.
However, passing in environment variables using the standard docker or docker-compose mechanisms does not seem to work. While I can see that the environment variables are set correctly inside the Docker container (verified using env on a bash and also by doing log.debug("ENV_MYSQL_DATABASE_URL via env: " + sys.env("ENV_MYSQL_DATABASE_URL")) inside the service), they are not used by the application.conf and not available in the configuration system. The values are empty/unset (verified through configuration.getString("ENV_MYSQL_DATABASE_URL").toString() and the exceptions thrown by the mysql system and other systems).
The only way I've gotten it to work was by fudging this into the JAVA_OPTS via JAVA_OPTS=-D ENV_MYSQL_DATABASE_URL=..... However, this seems like a hack, and doesn't appear to scale very well with dozens of environment parameters.
Am I missing something, is there a way to easily use the environment variables inside the Lagom application and application.conf?
Thanks!
I've used Lightbend config to configure Lagom services via environment variables in docker containers for many years, so know that it can be done and has been pretty straightforward in my experience.
With that in mind, when you say that they're not used by application.conf, do you mean that they're unset? Note that unless you're passing a very specific option as a Java property, configuration.getString("ENV_MYSQL_DATABASE_URL") will not read from an environment variable, so checking that will not tell you anything about whether mysql.url is affected by the environment variable. configuration.getString("mysql.url") will give you a better idea of what's going on.
I suspect that in fact your Docker image is being built with the dev-mode properties hardcoded in, and since Java system properties take precedence over everything else, they're shadowing the environment variable.
You may find it useful to structure your application.conf along these lines:
mysql_database_url = "..." # Some reasonable default default for dev-mode
mysql_database_url = ${?ENV_MYSQL_DATABASE_URL}
mysql {
url = "jdbc://"${mysql_database_url}
}
In this case, you have a reasonable default for a developer (probably including in the docs some instructions for running MySQL in a way compatible with that configuration). The default can then be overridden via setting a Java property (e.g. JAVA_OPTS=-Dmysql_database_url) or by setting the ENV_MYSQL_DATABASE_URL environment variable.
While I agree with the answer provided by Levi Ramsey, I would suggest you to use typesafe's config to load the your config

Eclipse Che - Server wont start on Windows

I'm trying to install eclipse che on my windows 8. I have all the required environment variables in place. Docker is up and running on VM. but when i run
$: Che run
It wont start. Please check the image below for reference.
che.properties config file
che.user.workspaces.storage=${che.home}/workspaces
che.machine.projects.internal.storage=/projects
che.conf.storage=${catalina.base}/temp/local-storage
che.ide.context=ide
project.template_location_dir=${che.home}/templates
project.template_descriptions_dir=${che.home}/templates
oauth.github.clientid=***
oauth.github.clientsecret=***
oauth.github.authuri= https://github.com/login/oauth/authorize
oauth.github.tokenuri= https://github.com/login/oauth/access_token
oauth.github.redirecturis= http://localhost:${SERVER_PORT}/ide/api/oauth/callback
auth.oauth.access_denied_error_page=/error-oauth
user.self.creation.allowed=false
notification.server.propagate_events=
schedule.core_pool_size=10
machine.docker.registry=http://192.168.99.100:5000
docker.registry.auth.url=http://192.168.99.100:5000
docker.registry.auth.username=user1
docker.registry.auth.password=pass
docker.registry.auth.email=user1#email.com
docker.connection.tcp.connection_timeout_ms=600000
docker.connection.tcp.read_timeout_ms=600000
machine.server.ext.archive=${che.home}/lib/ws-agent.zip
machine.server.terminal.archive=${che.home}/lib/terminal
machine.logs.location=${che.logs.dir}/machine/logs
machine.default_mem_size_mb=1024
machine.supported_docker_version=1.6.0,1.6.1,1.6.2,1.7.1,1.8.1
machine.ws_agent.max_start_time_ms=60000
machine.ws_agent.ping_delay_ms=2000
machine.ws_agent.ping_conn_timeout_ms=2000
machine.docker.machine_extra_hosts=NULL
machine.docker.che_api.endpoint=http://che-host:8080/ide/api
machine.docker.pull_image=true
machine.docker.local_node_host=http://192.168.99.100:5000
api.endpoint=http://localhost:${SERVER_PORT}/ide/api
org.everrest.asynchronous=false
org.everrest.asynchronous.pool.size=20
org.everrest.asynchronous.queue.size=500
org.everrest.asynchronous.job.timeout=10
org.everrest.asynchronous.cache.size=1024
org.everrest.asynchronous.service.path=/async/
This is likely due to the nature of the way virtualbox is configured to use Docker Machine on your computer. We'll need some more details on your configuration. Can you post a question on GitHub issues at github.com/eclipse/che?
Something you can test.
docker-machine rm default
Start che a second time - and see if that fixes the issue
I don't think the che.properties is your configuration issue. This seems like something with virtualbox. Please post an issue to /github.com/eclipse/che for tracking & discussion.

Cant access to FTP using Eclipse

I am using the Remote System software on Eclipse. I can successfully log in to my FTP account but when I try to view the directories, I get the following message:
Message: Operation failed due to network I/O error
'java.net.SocketException: Connection reset by peer: socket write
error'
Any ideas are welcome.
Looks like there could be some negotiation issue.
Try following solution:
I've got the same exception and in my case the problem was in a
renegotiation procecess. In fact my client closed a connection when
the server tried to change a cipher suite. After digging it appears
that in the jdk 1.6 update 22 renegotiation process is disabled by
default. If your security constraints can effort this, try to enable
the unsecure renegotiation by setting the
sun.security.ssl.allowUnsafeRenegotiation system property to true.
http://www.oracle.com/technetwork/java/javase/overview/tlsreadme2-176330.html
Setting the System Properties/Mode Configuration The various modes are
set using the corresponding system properties, which must be set
before the SunJSSE library is initialized. There are several ways to
set these properties:
From the command line:
% java -Dsun.security.ssl.allowUnsafeRenegotiation=true Main Within
the application:
java.lang.System.setProperty("sun.security.ssl.allowUnsafeRenegotiation",
true); In the Java Deployment environment (Plug-In/Web Start), there
are several ways to set the system properties. (See Java Web App and
Next Generation Web Browser Plugin for more information.)
Use the Java Control Panel to set the Runtime Environment Property on
a local/per-VM basis. This creates a local deployment.properties file.
Deployers can also distribute a enterprise-wide deployment.properties
file by using the deployment.config mechanism. (See Deployment
Configuration File and Properties.)
To set a property for a specific applet, use the HTML subtag
"java_arguments" within the tag. (See Java Arguments.)
To set the property in a specific Java Web Start application or applet
using the new Plugin2 (6u10+), use the JNLP "property" sub-element of
the "resources" element. (See Resources Element.)

Configuring FQDN for GCE instance on startup

I am trying to start a google compute engine (GCE) instance with a pre-configured FQDN. We are intending to run an application that is licensed based on the contents of /etc/hosts.
I am starting the instances using the Google Cloud SDK utility - gcloud.
I have tried setting the "hostname" key using the metadata option like so:
gcloud compute instances create mynode (standard opts) --metadata hostname=mynode.example.com
Whenever I log into the developer console, under computer, instances, I can see hostname under "Custom metadata". This appears to be a new, custome key - it has no impact on what:
http://metadata.google.internal/computeMetadata/v1/instance/hostname
returns.
I have also tried setting "instance/hostname" like the below, which causes a parsing error when using gcloud.
--metadata instance/hostname=mynode.example.com
I have successfully used the startup scripts functionality of the metadata server to run a startup script that parses the new, internal IP address of the newly created instance, updated /etc/hosts. This appears to work but doesn't feel "like the google way".
Can I configure the FQDN (specifically, a domain name, as the instance name is always the hostname) of an instance, during instance creation, using the metaserver functionality?
try this:
Go to your GCE >> VM instances panel.
stop your gce instance.
clic on the instance name.
Edit your instance, adding this values on Custom metadata fields:
Key field: hostname / Value field: your.server.hostname
Key field: startup-script / Value field: sudo -s hostnamectl set-hostname your.server.hostname
setup-example-image.png
Finally, start your instance and test with a hostnamectl command.
regards!
According to this article 'hostname' is part of the default metadata entries that provide information about your instance and it is NOT possible to manually edit any of the default metadata pairs. You can also take a look at this video from the Google Team. Within the first few minutes it is mentioned that you cannot modify default metadata pairs. As such, it does not seem like you can specify the hostname upon instance creation other than through the use of a start-up script like you've done already. It is also worth mentioning that the hostname you've specified will get deleted and auto-synced by the metadata server upon reboot unless you're using a start-up script or something that would modify it every time.
If what you're currently doing works for what you're trying to accomplish, it might be the only workaround to your scenario.
Here is a patch for /usr/share/google/set-hostname to set FQDN to GCE instance.
https://gist.github.com/yuki-takeichi/3080521322f0f1d159ea6a343e2323e6
Before you use this patch, you must set your desired FQDN in your instance's metadata by specifying hostname key.
Hostname is set each time instance's IP address is renewed by dhclient. set-hostname is just a hook script which dhclient executes and serves new IP address and internal hostame to, and modifies /etc/hosts. This patch changes the source of hostname by querying instance's metadata from metadata server.
The original set-hostname script is here:
https://github.com/GoogleCloudPlatform/compute-image-packages/blob/master/google_config/bin/set_hostname.
Use this patch at your own risk.
When creating a VM, you can specify a custom FQDN hostname as an optional parameter. This feature is currently in Beta.
$ gcloud beta compute instances create INSTANCE_NAME --hostname example.hostname
This should work across OSes, and eliminate the need for workaround scripts.
More info in the docs.
-- Sirui (Product Manager, Google Compute Engine)
I've looked throughout this site to find answered questions and found a few things that work but with a couple solutions combined. This thread seems the place to answer.
1) echo example.com > /etc/hostname
2) add -- 127.0.1.1 example.com in /etc/hosts
3) add -- hostnamectl set-hostname
example.com -- command to /etc/rc.local script
4) uncomment /etc/dhcp/dhclient.conf line:
supersede domain-name "example.com";
5) profit.... Seems to stick after each reboot
(Note example.com is your domain name: fqdndomain.com - yourfqdndomain.org)
Also note this is for Ubuntu or Debian. Other Unix May slightly vary. I've tested this on Ubuntu 16.04
Always on the wording NOT possible to manually edit any of the default metadata pairs, how about the instant level default metadata "/scheduling"? we could set them manually as mentioned in this article