Commit Graph
41 Commits
Author SHA1 Message Date
Brendan Dixon eb3662e0e1 [#769] -- HostGAPlugin requests should never go through proxy
[#764] -- waagent -configuration-path:/path -start not take effect
[#761] -- MetadataProtocol has no client object
[#757] -- deprovision is executed even if input 'n'
[#754] -- /etc/resolv.conf is removed if create a VM base on an specialized image
[#746] -- Agent WALinuxAgent-2.2.12 is blacklisted - skipping download
[#740] -- Duplicate logging on RHEL/CentOS

Signed-off-by: Brendan Dixon <brendandixon@me.com>
2017-06-21 13:41:05 -07:00
-bat 9bed39863b Fix for the issue on recent FreeBSD 11 with the resource disc (#743)
* Make sure the initial device is a valid disc, and fallback if not

    This is the same check the fallback code uses, and is necessary as on
    later FreeBSD 11 versions the disc are retruned in reverse order. Thus
    the original function returns 'pass1' instead of 'da1' which fails. This
    fixes the issue and allows the resource disc to be mounted again, though
    relying on the fallback is not the cleanest solution.

* Skip 'pass' devices when looking for the resource disk

This fixes the error introduced in FreeBSD 11 where the order of
outout from camcontrol changed from da1,pass1 to pass1,da1 and thus
waagent misidentified the disc as 'pass1'. Instead of taking the
first device, we now split the string at ',' and return the first
device which does not begin 'pass'.
2017-06-05 13:12:33 -07:00
Reyk Floeter aad62676a7 Add initial support for the OpenBSD operating system (#712)
* Add initial support for the OpenBSD operating system

There are some differences between FreeBSD, OpenBSD, and Linux.

Notes:

- OpenBSD ships LibreSSL, but WALinuxAgent needs OpenSSL for CMS, so
use the openssl port and the "eopenssl" binary instead.

- Don't run the custom DHCP client but parse /var/db/dhclient.leases.hvn0.
OpenBSD's lease file uses a modified syntax.

- OpenBSD does not have /proc.  WALinuxAgent should never assume that
the /proc filesystem is available.

- OpenBSD does not have sudo, but its replacement doas.  The OpenBSD
class implements support for modifying the doas.conf file.

- Unlike FreeBSD, OpenBSD supports and mounts UDF DVDs just fine.

- Create a swap partition instead of a swap file on the resource disk.

- Many other minor changes for OpenBSD

TODO:

- The /proc checks needs to be replaced with pgrep/ps etc. checks for
OpenBSD.  For now it just checks if /proc is available or returns
without error.
Make sure to install waagent with --register-service as setuptools
will not set the permissions of /etc/rc.d/waagent correctly (the file
has to be executable to be used by OpenBSD's rc system).

* Remove debug statement that was use to fix mount_dvd on OpenBSD.

* I accidentally replaced the FreeBSD resource disk handler.

The OpenBSD disk handler is an addition, not a replacement.

Found by jonathangray

* pylint

pylint found one bug in setting the password; other changes are just
for the style.

* strip newline from generated password hash.

Issue reported by Lili Deng.

* Keep AutoUpdate enabled, it was disabled for initial porting.

Pointed out by @hglkrijger

* Use a wildcard and delete all DHCP lease files on *BSD.

Requested by @hglkrijger
2017-05-30 15:27:22 -07:00
Brendan Dixon 90cf4f680f [#711] -- There are too many log print to /var/log/waagent.log
[#714] -- Questionable split call in common/conf.py
[#717] -- Remove extension logs during deprovision
[#720] -- Reset of RDMA drivers not taking effect
[#724] -- Location of configuration file should be editable issue

Signed-off-by: Brendan Dixon <brendandixon@me.com>
2017-05-23 15:45:33 -07:00
brendandixon 5c90636dd8 Added Provisioning telemetry duration (#702)
Correctly handle cleaning directories that include symlinks
Reduced polling interval #701
Enable selective agent testing
Improved FIPS configuration variable name
Reduced cloud-init files removed on deprovision #631

Signed-off-by: Brendan Dixon <brendandixon@me.com>
2017-05-08 16:27:56 -07:00
Brendan Dixon 66305f0bea Enabled FIPS support
Signed-off-by: Brendan Dixon <brendandixon@me.com>
2017-05-01 14:44:22 -07:00
jgreat 5e64b3dfa4 change option order for mkfs. Alpine is being picky 2017-04-29 17:17:53 -05:00
Vitaly Kuznetsov 7537e51f00 Fix issues with resource disk mount (#600) (#629)
* Check mount output to detect already mounted resource disk (#600)

mount(8) returns '32' in a variety of cases, we need to check the output
to be sure the resource disk is already mounted.

* Pass '-n' to sfdisk when not writing

Some old versions of sfdisk(8) will open block device in O_RDWR mode regardless
of the face that we're actually just querying partition type and not changing
it and if device is opened in this mode it will trigger partition rescan when
it is closed. This creates a race as partitions (/dev/sd*) will be going away
and re-appear later. Specify '-n' to indicate no write is required, sfdisk(8)
always opens the device in O_RDONLY now.

* Re-read partition table after changing partition type

Some old sfdisk(8) versions don't do syncronious partition re-read after
making changes. The kernel will re-read it anyway in background but this
will cause races with further mkfs as partition devices will be
disappearing. Do explicit partition rescan after we change partition id.
2017-03-31 11:19:28 -07:00
Hans Krijger 39668a6620 wait for partition before mounting (#613)
* wait for partition before mounting

* correct error thrown when swap size is invalid
2017-03-08 16:01:58 -08:00
Hans Krijger de6866b8f4 ignore return code 32 (#577) 2017-01-26 17:18:35 -08:00
Hans Krijger b3288a9609 add more logging when mount fails 2017-01-26 17:00:15 -08:00
Hans Krijger 58baf8979a Unhandled errors (#564)
* ensure path exists before access

* handle read only filesystems

* check for swap file before getting size

* fix customdata decoding
2017-01-20 13:15:55 -08:00
Hans Krijger 446b6c7e16 correct mkfile size check (#562) 2017-01-19 13:59:45 -08:00
Hans Krijger 9ea18d8658 Add telemetry event for host plugin usage (#560)
* reformat file

* add host plugin event; minor cleanup

* clean up imports
2017-01-18 18:50:01 -08:00
ccic cb9c20f6a1 fix the issues for mounting resourcedisk (#517) 2016-12-14 11:36:39 -08:00
Hans Krijger 515415a478 Update version to 2.2.2 (#511)
* logging update

* updating version for testing

* updating version to 2.2.2
2016-12-12 11:59:00 -08:00
Yoon Hong 84f41eb73c Add more logging to prevent unnecessary confusion in case of sfdisk --part-type failure (#478) (#509) 2016-12-08 11:26:02 -08:00
Yoon Hong ab717b5d7c Fix resource disk partition format detection (#478) (#501) 2016-12-06 14:30:15 -08:00
Yoon Hong 41af2e23c8 use dd right away without using fallocate when file system is xfs (#468) (#502) 2016-12-06 11:34:20 -08:00
William Douglas cd2ee7bbb7 Fix resource disk partition format detection (#478)
With recent versions of sfdisk the -c command is deprecated and
--part-type is recommended to be used instead. This use also requires
the output to be stripped instead of rstripped due to a leading space.
2016-11-18 16:06:42 -08:00
Hongjiang Zhang a737bfbf84 Fix the issue of failing to find resource disk for FreeBSD
FreeBSD VM gets a UUID from host which informs where resource
disk locates. But that UUID string was not exposed from VM kernel,
as a result, the agent used a hard code "2:1:0" as the location of
resource disk. That should be updated after FreeBSD VM kernel
exposed UUID through "sysctl dev.storvsc" command.

But considering compatible with previous FreeBSD VM, the hard code
logic cannot be removed, and they are left there as a fallback.
2016-09-08 14:23:49 +08:00
Hans Krijger b950ba1600 update the force option for mkfs.xfs 2016-08-31 13:18:49 -07:00
Hans Krijger 866c423e85 pep8 fixes and formatting cleanup; make get_mount_string static
port fix for #183; code cleanup
2016-08-29 17:22:17 -07:00
Steven Luther 8b53e8e4b8 Mount Options feature (#346)
* add testing for mountpoint, some refactoring

* fixed double space in mount string

* patch for ConfigProvider

* revert patch to original string.

* update documentation, add 'n' option for mountopts

* remove test argument

* More descriptive description in README, n to None

* minor var name changes for clarity

* spacing, missing self in get_mount_string

* mount_opts to mount_options

* add config option to writtet WaagentConf, minor style changes.

* mount options fix, is not Note

* add self to get_mount_string args

* self to function, not where it's called

* mount_options = output of function, not the function.

* get_mount_string returns with mount options/if not none

* forgot to remove part of the string

* instantiate resource disk handler, get_switch to get in conf.py

* Added config option to waagent.conf

* minor style fixes

* mountOpts is None change, and also added removed variable.

* revert changes to bin/waagent2.0

* reverted waagent2.0 to e8c641f

* config options added
2016-08-26 14:04:20 -07:00
Hans Krijger b4379817f9 fix dd command 2016-08-11 13:57:38 -07:00
Hans Krijger a936a7a439 correct logic for dd fallback 2016-08-08 12:19:55 -07:00
edneville e8c641f726 Set the umask prior to file creation (#315)
* Set the umask prior to file creation

* Set umask prior to file creation
2016-07-20 10:35:22 -07:00
Brendan Dixon 00aa43ab83 Moved environment monitoring and event collection into child process
Signed-off-by: Brendan Dixon <brendand@microsoft.com>
2016-07-08 15:26:52 -07:00
Ahmet Alp Balkan b7991585d7 Move RDMA pkg installation after provisioning (#288)
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2016-07-06 11:18:00 -07:00
Ahmet Alp Balkan 79f78344b6 Update RDMA IB interface from SharedConfig (#259)
* Update RDMA IB interface from SharedConfig

* wire.py: write_ip_on_rdma → setup_rdma_dev

* rdma.py: rearrange update_dat_conf

* rdma.py: rename a few identifier

* rdma.py: make wait device logs verbose

* rdma: rebase resolve conflicts

* rdma: move setting up device outside the goal state loop

* Typo fix
2016-06-28 12:00:53 -07:00
brendandixon f44bbce877 Correct overlapping processes (#270)
Signed-off-by: Brendan Dixon <brendand@microsoft.com>
2016-06-27 13:14:36 -07:00
Robert Schweikert e821b4c71a Integrate RDMA handling (#255)
* - Integrate RDMA handling

* - RDMA Integration
  + Fix syntax errors
  + Use the full distro name to differentiate properly between openSUSE
    (which has currently no RDMA driver build) and SLES

* - RDMA integration
  + Do not stop the execution of the agent work flow by throwing an
    exception if the RDMA handler is not specialized. Simply log an error
    to indicate that the handler is not supported although it has been
    configured with OS.EnableRDMA=y. The configuration in this case is in
    error.

* - RDMA integration
  + Document he new OS.EnableRDMA configuration setting
2016-06-22 14:10:14 -07:00
Hans Krijger d88231c12b update heartbeat to 30 minutes, formatting fixes (#257) 2016-06-22 13:34:41 -07:00
brendandixon 2799c3b615 Agent Self-Update Feature (#244)
The Agent will monitor for more recent versions and update itself
(without impacting the installed version). If the new Agent fails
(in a very bad way or consistently), the code rolls back to the prior
version.

Signed-off-by: Brendan Dixon <brendand@microsoft.com>
2016-06-21 12:18:06 -07:00
Mariusz Woloszyn edb23411cc Workaround for race condition between azurelinuxagent and scvmmagent (#240) 2016-06-21 11:39:32 -07:00
Hans Krijger 9006eb9dab removing unnecessary call to start scvmm agent (#241) 2016-06-17 12:41:18 -07:00
Hans Krijger 627533ce2d Fixes for SCVMM (#219)
- correct scvmm references
- add unit tests for scvmm detection
- ensure all matching devices are mounted and examined for scvmm configuration
- exit once vmm startup script is found and executed
- fixes #185
2016-06-13 17:10:35 -07:00
Mingye Wang 3c5a9e73d9 fix for #127. try to use posix.fallocate and fallocate before falling back to dd; adds unit tests for basic functionality and shellutil.quote (#215) 2016-06-07 11:38:15 -07:00
Yue Zhang da9ebe0a3d Separate provision agent and guest agent
Ensured correct return
Temporarily disable autoupdate

Signed-off-by: Brendan Dixon <brendand@microsoft.com>
2016-06-01 15:27:32 -07:00
brendandixon e55d8dee0e Revert "Separate provision agent and guest agent" 2016-05-31 11:24:23 -07:00
Yue Zhang efff9d6e0e Separate provision agent and guest agent 2016-05-31 11:15:10 -07:00